templates/default/galeria.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block body_id 'homepage' %}
  3. {% block javascripts %}
  4. {{ parent() }}
  5. {{ encore_entry_script_tags('showGallery') }}
  6. {% endblock %}
  7. {#
  8. the homepage is a special page which displays neither a header nor a footer.
  9. this is done with the 'trick' of defining empty Twig blocks without any content
  10. #}
  11. {% block header %}{% endblock %}
  12. {% block footer %}{% endblock %}
  13. {% set heroImgPath = '/build/images/heroes/' %}
  14. {% block body %}
  15. <div class="galeria">
  16.     <div class="header-template">
  17.         <h2> Наші Герої</h1>
  18.         <p class="lead mb-0">Борися з <s>хамами</s> порушниками любими законними методами. Побачив порушника - скинь фотку :)</p>
  19.     </div>
  20.     <div class="row mb-4 ms-2 me-2 justify-content-between">
  21.         {% for hero in heros %}
  22.         <div class="card">
  23.             {% if is_mobile() %}
  24.                 <a href="{{ heroImgPath ~ hero.heroFileName }}" class="col-sm-4 parking-data-toggle-lightbox">
  25.                     <img src="{{ heroImgPath ~ hero.heroFileName }}" class="img-fluid card-img-top hero">
  26.                 </a>
  27.             {% else %}
  28.                 <a href="{{ heroImgPath ~ hero.heroFileName }}" data-toggle="lightbox" data-gallery="example-gallery" class="col-sm-4 parking-data-toggle-lightbox">
  29.                     <img src="{{ heroImgPath ~ hero.heroFileName }}" class="img-fluid card-img-top hero">
  30.                 </a>
  31.             {% endif %}
  32.             <div class="card-body d-flex flex-column">
  33.                 <h5 class="card-title"><b>{{ hero.heroName }}</b></h5>
  34.                 {% if(hero.heroDescription|length < 100) %}
  35.                     <p>{{ hero.heroDescription }} </p>
  36.                 {% else %}
  37.                     {% set left_text = hero.heroDescription|slice(100, -1) %}
  38.                     {% set small_text = hero.heroDescription|slice(0, 100) %}
  39.                 <span> {{ small_text }} </span>
  40.                 <div class="collapse" id="collapseExample-{{loop.index}}">
  41.                     <span class="smart">
  42.                         {{ left_text }}
  43.                     </span>
  44.                 </div>
  45.                 <a data-bs-toggle="collapse" href="#collapseExample-{{loop.index}}" role="button" aria-expanded="false" aria-controls="collapseExample">
  46.                 </a>
  47.                 {% endif %}
  48.                 <p class="card-text">
  49.                 <small class="text-muted">Змінено {{  hero.updatedAt|ago }}</small>
  50.                 </p>
  51.                 <a href="/hero/{{hero.id}}" class="btn btn-primary show-details mt-auto">Деталі</a>
  52.             </div>
  53.         </div>
  54.         {% if loop.index % 3 == 0 %}
  55.     </div>
  56.     <div class="row mb-4 ms-2 me-2 justify-content-between">
  57.         {% endif %}
  58.         {% endfor %}
  59.         <div class="card" onclick="window.location='/hero/new'">
  60.             <div class="card-body d-flex align-items-center">
  61.                 <img src="{{ asset('build/images/file_plus_icon.png') }}" class="card-img-bottom">
  62.             </div>
  63.         </div>
  64.     </div>
  65.     {% endblock %}