Version 1
[yaffs-website] / web / themes / contrib / bootstrap / templates / system / system-themes-page.html.twig
1 {#
2 /**
3  * @file
4  * Theme override for the Appearance page.
5  *
6  * Available variables:
7  * - attributes: HTML attributes for the main container.
8  * - theme_groups: A list of theme groups. Each theme group contains:
9  *   - attributes: HTML attributes specific to this theme group.
10  *   - title: Title for the theme group.
11  *   - state: State of the theme group, e.g. installed or uninstalled.
12  *   - themes: A list of themes within the theme group. Each theme contains:
13  *     - attributes: HTML attributes specific to this theme.
14  *     - screenshot: A screenshot representing the theme.
15  *     - description: Description of the theme.
16  *     - name: Theme name.
17  *     - version: The theme's version number.
18  *     - is_default: Boolean indicating whether the theme is the default theme
19  *       or not.
20  *     - is_admin: Boolean indicating whether the theme is the admin theme or
21  *       not.
22  *     - notes: Identifies what context this theme is being used in, e.g.,
23  *       default theme, admin theme.
24  *     - incompatible: Text describing any compatibility issues.
25  *     - operations: A list of operation links, e.g., Settings, Enable, Disable,
26  *       etc. these links should only be displayed if the theme is compatible.
27  *
28  * @ingroup templates
29  *
30  * @see template_preprocess_system_themes_page()
31  */
32 #}
33 <div{{ attributes.addClass('form-group') }}>
34   {% for theme_group in theme_groups %}
35     {%
36       set theme_group_classes = [
37         'system-themes-list',
38         'system-themes-list-' ~ theme_group.state,
39         'clearfix',
40         'panel',
41         'panel-default',
42       ]
43     %}
44     <div{{ theme_group.attributes.addClass(theme_group_classes) }}>
45       <div class="panel-heading">
46         <a class="panel-title" href="#system-themes-list--{{ theme_group.state }}" aria-controls="#system-themes-list--{{ theme_group.state }}" aria-expanded="false" aria-pressed="false" data-toggle="collapse" role="button">
47           {{ theme_group.title }} ({{ theme_group.themes|length }})
48         </a>
49       </div>
50       {%
51         set table_classes = [
52           'table',
53           'panel-collapse',
54           theme_group.state == 'uninstalled' ? 'collapse',
55           'fade',
56           theme_group.state != 'uninstalled' ? 'in',
57       ]
58       %}
59       <table id="system-themes-list--{{ theme_group.state }}" class="{{ table_classes|join(' ')}}">
60         {% for theme in theme_group.themes %}
61           {%
62             set theme_classes = [
63               theme.is_default ? 'theme-default',
64               theme.is_admin ? 'theme-admin',
65               'theme-selector',
66               'clearfix',
67             ]
68           %}
69           <tr{{ theme.attributes.addClass(theme_classes) }}>
70             <td class="col-sm-3">
71               {% if theme.screenshot %}
72                 {{ theme.screenshot }}
73               {% endif %}
74             </td>
75             <td class="theme-info col-sm-9">
76               <h4 class="theme-info__header">
77                 {{- theme.name }} {{ theme.version -}}
78                 {% if theme.notes %}
79                   ({{ theme.notes|safe_join(', ') }})
80                 {%- endif -%}
81               </h4>
82               <div class="theme-info__description help-block">{{ theme.description }}</div>
83               {# Display operation links if the theme is compatible. #}
84               {% if theme.incompatible %}
85                 <div class="incompatible">{{ theme.incompatible }}</div>
86               {% else %}
87                 {{ theme.operations }}
88               {% endif %}
89             </td>
90           </tr>
91         {% endfor %}
92       </table>
93     </div>
94   {% endfor %}
95 </div>