book_list.html.twig 1019 Bytes
Newer Older
1
<ul class="books">
Sean Madsen's avatar
Sean Madsen committed
2
{% for book in books %}
3 4
  {% set editionClass = (book.isMultiEdition) ? 'multi_edition' : 'single_edition' %}
  <li class="book {{ editionClass }}">
Sean Madsen's avatar
Sean Madsen committed
5
    <div>
6 7
      {% set language = book.getDefaultLanguage %}
      {% set version = language.getDefaultVersion %}
8
      {% set url = "/" ~ book.slug ~ "/" ~ language.code ~ "/" ~ version.path %}
Sean Madsen's avatar
Sean Madsen committed
9 10 11 12 13
      <a href="{{ url }}">
        <span class="name">
          {{ book.name }}
        </span>
        <span class="edition">
14
          ({{ language.nativeName() }} &ndash; {{ version.name }})
Sean Madsen's avatar
Sean Madsen committed
15
        </span>
Sean Madsen's avatar
Sean Madsen committed
16
      </a>
17 18 19 20
      {% set countOtherEditions = book.countEditions - 1 %}
      {% if countOtherEditions > 0 %}
        <span class="or">&ndash;&nbsp;or&nbsp;&ndash;</span>
        <span class="other-editions">
21
          <a href="/{{ book.slug }}/editions">(See all {{ book.countEditions }} editions)</a>
22 23
        </span>
      {% endif %}
Sean Madsen's avatar
Sean Madsen committed
24 25 26 27
    </div>
    <div class="description">
      {{ book.description }}
    </div>
28

29 30 31
  </li>
{% endfor %}
</ul>