templates/frontend/articles_list.html.twig line 1

Open in your IDE?
  1. {% extends 'layout.html.twig' %}
  2. {% block meta_decription %}
  3.     {{ parent() }}
  4. {% endblock %}
  5. {% block stylesheets %}
  6.     {{ parent() }}
  7.     <style>
  8.         html,body{
  9.             width:100%;
  10.             margin:0;
  11.             height:100%;
  12.             background: #f4f4f4 !important;
  13.         }
  14.     </style>
  15. {% endblock %}
  16. {% block body %}
  17. <div class="hidden users-flash mb-0" id="flash"></div>
  18. <div class="container mb-3">
  19.     <div class="row mb-3 px-3 px-sm-0">
  20.         <div class="col-12">
  21.             <div class="row mb-3">
  22.                 <div class="col-12">
  23.                     <h4 class="pb-1 text-truncate">
  24.                         <i class="me-2 {{ article.icon }}"></i>
  25.                         {{ article.name }}
  26.                     </h4>
  27.                 </div>
  28.                 <div class="col-12">
  29.                     {% if article.isMulti == 1 %}
  30.                         <span class="d-block mb-1 fs-5">{{ article.description }}</span>
  31.                         <p class="info w-100 pt-3 pb-0 my-0">{{ article.articleCount }} articles in this collection</p>
  32.                         <p class="info w-100 pt-0">
  33.                             {% set counter = 0 %}
  34.                             {% set authorNames = '' %}
  35.                             {% set names = '' %}
  36.                             {% set data = {} %}
  37.                             {% for authors in article.articleDetails %}
  38.                                 {% set authorNames = authorNames ~ nzo_decrypt(authors.user.firstName) ~' '~ nzo_decrypt(authors.user.lastName) ~ ', ' %}
  39.                                 {% if nzo_decrypt(authors.user.firstName) ~' '~ nzo_decrypt(authors.user.lastName) not in data %}
  40.                                     {% set data = data|merge([nzo_decrypt(authors.user.firstName) ~' '~ nzo_decrypt(authors.user.lastName)]) %}
  41.                                     {% set names = authorNames %}
  42.                                 {% endif %}
  43.                             {% endfor %}
  44.                             {% set authors = '' %}
  45.                             {% set separator = ', ' %}
  46.                             {% if data|length <= 2 %}
  47.                                 {% set separator = ' & ' %}
  48.                             {% endif %}
  49.                             {% for author in data %}
  50.                                 {% if counter < 3 %}
  51.                                     {% set authors = authors ~' '~ author ~ separator %}
  52.                                 {% endif %}
  53.                                 {% set counter = counter + 1 %}
  54.                             {% endfor %}
  55.                             {% if authors|length > 0 %}
  56.                                 {{ authors|trim(separator) }}
  57.                                 {{ render(controller(
  58.                                     'App\\Controller\\ArticlesController::articleAuthorsAction', {
  59.                                         'articleId':article.id
  60.                                     }
  61.                                 )) }}
  62.                             {% endif %}
  63.                         </p>
  64.                     {% endif %}
  65.                 </div>
  66.             </div>
  67.             {% if article.isMulti == 1 %}
  68.                 {% set counter = 0 %}
  69.                 {% for articleDetails in article.articleDetails %}
  70.                     {% set marginBottom = 'mb-3' %}
  71.                     {% set counter = counter + 1 %}
  72.                     {% if counter == article.articleDetails|length %}
  73.                         {% set marginBottom = '' %}
  74.                     {% endif %}
  75.                     <div class="row {{ marginBottom }}">
  76.                         <div class="col-12  p-3 p-sm-5 bg-white border-xy">
  77.                             <div class="row d-table w-100">
  78.                                 <div class="col-12">
  79.                                     <a href="{{ path('article_details_page', {
  80.                                         'pageId': app.request.get('pageId'),
  81.                                         'articleId': app.request.get('articleId'),
  82.                                         'articleDetailId': articleDetails.id,
  83.                                     }) }}">
  84.                                         <h6>{{ articleDetails.name }}</h6>
  85.                                     </a>
  86.                                     <span class="d-block">{{ articleDetails.description }}</span>
  87.                                     <span class="d-block pt-3">
  88.                                         Written By {{ nzo_decrypt(articleDetails.user.firstName) ~' '~ nzo_decrypt(articleDetails.user.lastName) }}
  89.                                         {{ render(controller(
  90.                                             'App\\Controller\\ArticlesController::articleListAuthorsAction', {
  91.                                                 'articleDetailId':articleDetails.id,
  92.                                                 'showAuthors':0
  93.                                             }
  94.                                         )) }}
  95.                                     </span>
  96.                                 </div>
  97.                             </div>
  98.                         </div>
  99.                     </div>
  100.                 {% endfor %}
  101.             {% else %}
  102.                 <div class="row mb-3 px-3 px-sm-0">
  103.                     <div class="col-12">
  104.                         {{ article.articleDetails[0].copy()|raw }}
  105.                     </div>
  106.                 </div>
  107.             {% endif %}
  108.         </div>
  109.     </div>
  110. </div>
  111. <div class="overlay"></div>
  112. <div class="spanner">
  113.     <div class="loader"></div>
  114.     <p class="text-light fw-bold" style="font-size: 36px;">Loading...</p>
  115. </div>
  116. {% endblock %}
  117. {% block javascripts %}
  118.     {{ parent() }}
  119.     <script>
  120.         $(document).ready(function () {
  121.             $('body').addClass('form-control-bg-grey');
  122.         });
  123.     </script>
  124. {% endblock %}