templates_common/blocks/hero.html.twig line 1

  1. <section>
  2.     <div class="container px-4">
  3.         <div class="flex flex-col lg:flex-row">
  4.             <div class="basis-[37%] p-4 border border-[#ebecee] text-justify dark:border-black dark:text-black dark:text-[120%]">
  5.                 {% include current_request.domain ~'/hero.'~ app.request.locale ~'.html.twig' %}
  6.             </div>
  7.             <div class="md:px-4 basis-[63%] grow flex flex-col place-content-between">
  8.                 {% for post in posts %}
  9.                     <a href="{{ path('app_post_show', {'id': post.id}) }}"
  10.                        class="news-entity relative news-entity2 flex flex-col lg:flex-row items-center max-lg:px-0">
  11.                         {% if post.attachments|first == true and post.attachments|first.path is not empty and current_request.domain != 'qr-pib.kz' %}
  12.                             <img class="block lg:mr-4 max-lg:w-full max-lg:mb-4 md:max-w-[300px]"
  13.                                  src="{% if post.attachments|first %}{{ asset(post.attachments|first.path) | imagine_filter('my_thumb') }} {% else %}/images/default.jpg{% endif %}"
  14.                                  alt="">
  15.                         {% else %}
  16.                             <img class="block lg:mr-4 max-lg:w-full max-lg:mb-4 md:max-w-[300px]"
  17.                                  src="{% if post.attachments|first %}{{ asset('/images/attachments/'~post.attachments|first.imageName) | imagine_filter('my_thumb') }} {% else %}/images/default.jpg{% endif %}"
  18.                                  alt="">
  19.                         {% endif %}
  20.                         <div class="lg:border-b lg:pr-12 dark:border-none w-full">
  21.                             <h4 class="font-extrabold">
  22.                                 {{ post.title|striptags|u.truncate(100, '...')|raw }}
  23.                             </h4>
  24.                             <time class="block my-1 text-[#999fab] dark:text-[120%] dark:text-black dark:font-bold"
  25.                                   datetime="">{{ post.publishedAt ? post.publishedAt|date('d.m.Y') : '' }}</time>
  26.                             <p class="text-[#999FAB] dark:hidden">{{ post.content|trim|striptags|u.truncate(70, '...')|raw }}</p>
  27.                         </div>
  28.                     </a>
  29.                 {% else %}
  30.                     {{ 'No news'|trans }}
  31.                 {% endfor %}
  32.             </div>
  33.         </div>
  34.         {% include 'blocks/morenewsbutton.html.twig' %}
  35.     </div>
  36. </section>