category.html.twig 3.18 KB
Newer Older
Carl Schwan's avatar
Carl Schwan committed
1 2 3 4 5
{#
SPDX-FileCopyrightText: 2020 Carl Schwan <carl@carlschwan.eu>

SPDX-License-Identifier: AGPL-3.0-or-later
#}
6 7
<section class="category">
  <h2>
8 9
    {% if category.name != 'unmaintained' %}
      <a href="{{ path('app_main_category_intl', {'_locale': locale, 'category': category.name | lower }) }}">
10
        {{ category.name | capitalize | trans }}
11 12
      </a>
      {% if category.icon is not null %}
13
        <img aria-hidden="true" width="36" height="36" src="{{ asset('icons/categories/' ~ category.icon) }}"
Carl Schwan's avatar
Carl Schwan committed
14 15 16
             {% if lazy %}
               loading="lazy"
             {% endif %}
17 18 19 20 21 22 23 24
             alt="{{ category.name }}" title="{{ category.name }}"/>
      {% endif %}
    {% else %}
      <a id="unmaintained-collapse-link" class="collapsed" data-toggle="collapse" href="#{{ category.name }}-collapse">
        {% trans %}Unmaintained{% endtrans %}
        <i class="icon icon_expand-all"></i>
      </a>
    {% endif %}
25 26
  </h2>

27 28 29 30
  <div class="{{ category.name == 'unmaintained' ? 'collapse' }}" id="{{ category.name }}-collapse">
    <h3 class="applications-title">{% trans %}Applications{% endtrans %}</h3>
    <div class="applications row align-items-stretch">
      {% for application in category.applications %}
31 32
        <div class="app text-center col-12 col-sm-6 col-md-4 col-lg-3 p-2">
          <div class="p-3 h-100">
33
            <div aria-hidden="true">
Carl Schwan's avatar
Carl Schwan committed
34
              <a href="{{ path('app_main_application_intl', {'_locale': locale, 'application' : application.simplifiedId }) }}">
35
                <img width="48" height="48" src="{{ asset('icons/' ~ application.icon) }}"
Carl Schwan's avatar
Carl Schwan committed
36
                     loading="lazy"
37 38 39
                     alt="{{ application.name | l10n(locale) }}" title="{{ application.name | l10n(locale) }}"/>
              </a>
            </div>
Carl Schwan's avatar
Carl Schwan committed
40
            <a href="{{ path('app_main_application_intl', {'_locale': locale, 'application' : application.simplifiedId }) }}">
41 42 43 44 45 46 47
              {{ application.name | l10n(locale) }}
            </a>
            <p>{{ application.genericName | l10n(locale) }}</p>
          </div>
        </div>
      {% endfor %}
    </div>
48 49 50 51 52 53 54

    {% if category.addons | length > 0 %}
      <h3 class="addons-title">{% trans %}Addons{% endtrans %}</h3>
      <div class="addons row align-items-stretch">
        {% for application in category.addons %}
          <div class="app text-center col-12 col-sm-6 col-md-4 col-lg-3 p-2">
            <div class="p-3 h-100">
55
              <div aria-hidden="true">
Carl Schwan's avatar
Carl Schwan committed
56
                <a href="{{ path('app_main_application_intl', {'_locale': locale, 'application' : application.simplifiedId }) }}">
57 58 59 60
                  <img width="48" height="48" src="{{ asset('icons/' ~ application.icon) }}"
                       alt="{{ application.name | l10n(locale) }}" title="{{ application.name | l10n(locale) }}"/>
                </a>
              </div>
Carl Schwan's avatar
Carl Schwan committed
61
              <a href="{{ path('app_main_application_intl', {'_locale': locale, 'category': category.name | lower, 'application' : application.simplifiedId }) }}">
62 63 64 65 66 67 68 69 70
                {{ application.name | l10n(locale) }}
              </a>
              <p>{{ application.genericName | l10n(locale) }}</p>
            </div>
          </div>
        {% endfor %}
      </div>
    {% endif %}
  </div>
71
</section>