templates/frontend/articles.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 form-control-bg-grey overflow-hidden">
  19.     {% if articles|length >= 1 %}
  20.         {% if articles[0].isMulti == 0 %}
  21.             <div class="row px-3 px-sm-0">
  22.                 <div class="col-12 px-0">
  23.                     <h4 class="pb-3 text-truncate">{{ articles[0].name }}</h4>
  24.                 </div>
  25.             </div>
  26.             <div class="row mb-3 px-3 px-sm-0">
  27.                 <div class="col-12 px-0">
  28.                     <div class="bg-white border-xy p-3 p-sm-5">
  29.                         {{ articles[0].articleDetails[0].copy|raw }}
  30.                     </div>
  31.                 </div>
  32.             </div>
  33.         {% else %}
  34.             {% for article in articles %}
  35.                 {% set counter = 0 %}
  36.                 {% set authorNames = '' %}
  37.                 {% set names = '' %}
  38.                 {% set data = {} %}
  39.                 {% for authors in article.articleDetails %}
  40.                     {% set authorNames = authorNames ~ nzo_decrypt(authors.user.firstName) ~' '~ nzo_decrypt(authors.user.lastName) ~ ', ' %}
  41.                     {% if nzo_decrypt(authors.user.firstName) ~' '~ nzo_decrypt(authors.user.lastName) not in data %}
  42.                         {% set data = data|merge([nzo_decrypt(authors.user.firstName) ~' '~ nzo_decrypt(authors.user.lastName)]) %}
  43.                         {% set names = authorNames %}
  44.                     {% endif %}
  45.                 {% endfor %}
  46.                 {% set authors = '' %}
  47.                 {% for author in data %}
  48.                     {% if counter < 3 %}
  49.                         {% set authors = authors ~' '~ author ~ ', ' %}
  50.                     {% endif %}
  51.                     {% set counter = counter + 1 %}
  52.                 {% endfor %}
  53.                 <div class="row mb-3 px-3 px-sm-0">
  54.                     <div class="col-12  p-3 p-sm-5 bg-white border-xy">
  55.                         <div class="row d-table w-100">
  56.                             <div class="col-2 col-sm-1 d-table-cell align-middle text-center">
  57.                                 <i class="{{ article.icon }} fs-1"></i>
  58.                             </div>
  59.                             <div class="col-10 col-sm-11">
  60.                                 <a href="{{ path('article_list_page', {'pageId':app.request.get('pageId') ,'articleId':article.id }) }}">
  61.                                     <h6>{{ article.name }}</h6>
  62.                                 </a>
  63.                                 <span class="w-100">{{ article.description }}</span>
  64.                                 <p class="info w-100 pt-4 mb-0">{{ article.articleCount }} articles in this collection</p>
  65.                                 <p class="info w-100 mb-0">
  66.                                     {% if authors|length > 0 %}
  67.                                         Written by {{ authors|trim(', ') }}
  68.                                         {{ render(controller(
  69.                                             'App\\Controller\\ArticlesController::articleAuthorsAction', {'articleId':article.id}
  70.                                         )) }}
  71.                                     {% endif %}
  72.                                 </p>
  73.                             </div>
  74.                         </div>
  75.                     </div>
  76.                 </div>
  77.             {% endfor %}
  78.         {% endif %}
  79.     {% endif %}
  80. </div>
  81. <div class="overlay"></div>
  82. <div class="spanner">
  83.     <div class="loader"></div>
  84.     <p class="text-light fw-bold" style="font-size: 36px;">Loading...</p>
  85. </div>
  86. {% endblock %}
  87. {% block javascripts %}
  88.     {{ parent() }}
  89.     <script>
  90.         $(document).ready(function () {
  91.             $('body').addClass('form-control-bg-grey');
  92.         });
  93.     </script>
  94. {% endblock %}