weekly release 5.0dev
[moodle.git] / admin / templates / themeselector / theme_card.mustache
blobc8a163e8336e55f9d6b041e0b67a233e36cc4c40
1 {{!
2     This file is part of Moodle - http://moodle.org/
4     Moodle is free software: you can redistribute it and/or modify
5     it under the terms of the GNU General Public License as published by
6     the Free Software Foundation, either version 3 of the License, or
7     (at your option) any later version.
9     Moodle is distributed in the hope that it will be useful,
10     but WITHOUT ANY WARRANTY; without even the implied warranty of
11     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12     GNU General Public License for more details.
14     You should have received a copy of the GNU General Public License
15     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
17 {{!
18     @template core_admin/themeselector/theme_card
20     This template renders the singular card for a theme.
22     Example context (json):
23     {
24         "name": "Boost",
25         "choose": "boost",
26         "image": "http://moodlesite/theme/image.php?theme=boost&image=screenshot&component=theme",
27         "current": true,
28         "actionurl": "http://moodlesite/admin/themeselector.php",
29         "sesskey": "123XYZ",
30         "settingsurl": "http://moodlesite/admin/settings.php?section=themesettingboost",
31         "reporturl": "http://moodlesite/report/themeusage/index.php?themechoice=boost"
32     }
34 <div class="card theme-card" role="listitem" id="theme-card-{{choose}}" aria-labelledby="theme-name-{{choose}} {{#current}}current-theme-{{choose}}{{/current}}">
35     <div class="card-img card-img-top" style='background-image: url("{{image}}");'></div>
36     <div class="card-body p-3">
37         <div class="d-flex">
38             <div class="flex-grow-1">
39                 <h3 class="h5" id="theme-name-{{choose}}">{{name}}</h3>
40             </div>
41             <div>
42                 <button
43                     type="button"
44                     id="theme-preview-{{choose}}"
45                     class="btn btn-link p-0"
46                     title="{{#str}}previewthemename, moodle, {{name}}{{/str}}"
47                     data-action="preview"
48                     data-name="{{name}}"
49                     data-image="{{image}}"
50                     data-current="{{current}}"
51                     data-actionurl="{{actionurl}}"
52                     data-choose="{{choose}}"
53                     data-sesskey="{{sesskey}}">
54                     <i class="icon fa fa-info-circle m-0" aria-hidden="true"></i>
55                     <span class="visually-hidden">{{#str}}previewthemename, moodle, {{name}}{{/str}}</span>
56                 </button>
57                 {{#reporturl}}
58                     <a
59                         href="{{reporturl}}"
60                         id="theme-usage-report-{{choose}}"
61                         class="btn btn-link p-0 ms-2"
62                         title="{{#str}}themeusagereportname, admin, {{name}}{{/str}}">
63                         <i class="icon fa fa-area-chart m-0" aria-hidden="true"></i>
64                         <span class="visually-hidden">{{#str}}themeusagereportname, admin, {{name}}{{/str}}</span>
65                     </a>
66                 {{/reporturl}}
67                 {{#settingsurl}}
68                     <a
69                         href="{{settingsurl}}"
70                         id="theme-settings-{{choose}}"
71                         class="btn btn-link p-0 ms-2"
72                         title="{{#str}}themeeditsettingsname, admin, {{name}}{{/str}}">
73                         <i class="icon fa fa-cog m-0" aria-hidden="true"></i>
74                         <span class="visually-hidden">{{#str}}themeeditsettingsname, admin, {{name}}{{/str}}</span>
75                     </a>
76                 {{/settingsurl}}
77             </div>
78         </div>
79     </div>
80     <div class="d-flex align-items-end flex-column p-3">
81         {{#current}}
82             <strong><span class="text-success" id="current-theme-{{choose}}">{{#str}}currenttheme, moodle{{/str}}</span></strong>
83             {{#definedinconfig}}
84                 <div class="alert alert-info p-1">{{#str}}configoverride, admin{{/str}}</div>
85             {{/definedinconfig}}
86         {{/current}}
87         {{^current}}
88             {{#actionurl}}
89                 <form method="post" action="{{actionurl}}" id="theme-select-form-{{choose}}">
90                     <input type="hidden" name="sesskey" value="{{sesskey}}">
91                     <input type="hidden" name="choose" value="{{choose}}">
92                     <button type="submit" class="btn btn-primary">
93                         <span aria-hidden="true">{{#str}}selecttheme, moodle{{/str}}</span>
94                         <span class="visually-hidden">{{#str}}selectthemename, moodle, {{name}}{{/str}}</span>
95                     </button>
96                 </form>
97             {{/actionurl}}
98         {{/current}}
99     </div>
100 </div>