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