weekly release 4.0dev
[moodle.git] / contentbank / templates / bankcontent.mustache
... / ...
CommitLineData
1{{!
2 This file is part of Moodle - http://moodle.org/
3
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.
8
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.
13
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/>.
16}}
17{{!
18 @template core_contentbank/bankcontent
19
20 Example context (json):
21 {
22 "contents": [
23 {
24 "name": "Accordion.h5p",
25 "title": "accordion.h5p",
26 "timemodified": 1589792272,
27 "size": "699.3KB",
28 "bytes": 716126,
29 "type": "Archive (H5P)",
30 "author": "Admin user",
31 "link": "http://something/contentbank/contenttype/h5p/view.php?url=http://something/pluginfile.php/1/contentbank/public/accordion.h5p",
32 "icon" : "http://something/theme/image.php/boost/core/1581597850/f/h5p-64",
33 "visibilityunlisted": true
34 },
35 {
36 "name": "resume.pdf",
37 "title": "resume",
38 "timemodified": 1589792039,
39 "size": "699.3KB",
40 "uses": 3,
41 "bytes": 716126,
42 "type": "Archive (PDF)",
43 "author": "Admin user",
44 "icon": "http://something/theme/image.php/boost/core/1584597850/f/pdf-64",
45 "visibilityunlisted": false
46 }
47 ],
48 "tools": [
49 {
50 "name": "Add",
51 "dropdown": true,
52 "link": "http://something/contentbank/edit.php?contextid=1",
53 "contenttypes": [
54 {
55 "name": "H5P Interactive Content",
56 "baseurl": "http://something/contentbank/edit.php?contextid=1&plugin=h5p",
57 "types": [
58 {
59 "typename": "H5P Interactive Content"
60 },
61 {
62 "typename": "Accordion",
63 "typeeditorparams": "library=Accordion-1.4",
64 "typeicon": "http://something/pluginfile.php/1/core_h5p/libraries/13/H5P.Accordion-1.4/icon.svg"
65 }
66 ]
67 }
68 ]
69 },
70 {
71 "name": "Upload",
72 "link": "http://something/contentbank/contenttype/h5p/view.php?url=http://something/pluginfile.php/1/contentbank/public/accordion.h5p",
73 "icon" : "i/upload"
74 },
75 {
76 "icon": "i/export"
77 }
78 ]
79 }
80
81}}
82<div class="content-bank-container {{#viewlist}}view-list{{/viewlist}} {{^viewlist}}view-grid{{/viewlist}}"
83data-region="contentbank">
84 <div class="d-flex justify-content-between flex-column flex-sm-row">
85 <div class="cb-search-container mb-2">
86 {{>core_contentbank/bankcontent/search}}
87 </div>
88 <div class="cb-toolbar-container mb-2 d-flex">
89 {{>core_contentbank/bankcontent/toolbar}}
90 </div>
91 </div>
92 <div class="pb-3 border">
93 <div class="content-bank">
94 <div class="cb-navbar bg-light p-2 border-bottom">
95 <div class="cb-navbar-breadbrumb">
96 {{#pix}} i/folder {{/pix}}
97 </div>
98 <div class="cb-navbar-totalsearch d-none">
99 </div>
100 </div>
101 {{#contents.0}}
102 <div class="cb-content-wrapper d-flex px-2" data-region="filearea">
103 <div class="cb-heading bg-white">
104 <div class="cb-file cb-column d-flex">
105 <div class="title">{{#str}} contentname, contentbank {{/str}}</div>
106 <button class="btn btn-sm cb-btnsort dir-none ml-auto" data-string="contentname" data-action="sortname"
107 title="{{#str}} sortbyx, core, {{#str}} contentname, contentbank {{/str}} {{/str}}">
108 <span class="default">{{#pix}} t/sort, core, {{#str}}sort, core {{/str}} {{/pix}}</span>
109 <span class="desc">{{#pix}} t/sort_desc, core, {{#str}}desc, core{{/str}} {{/pix}}</span>
110 <span class="asc">{{#pix}} t/sort_asc, core, {{#str}}asc, core{{/str}} {{/pix}}</span>
111 </button>
112 </div>
113 <div class="cb-uses cb-column d-flex">
114 <div class="title">{{#str}} uses, contentbank {{/str}}</div>
115 <button class="btn btn-sm cb-btnsort dir-none ml-auto" data-string="uses" data-action="sortuses"
116 title="{{#str}} sortbyx, core, {{#str}} uses, contentbank {{/str}} {{/str}}">
117 <span class="default">{{#pix}} t/sort, core, {{#str}}sort, core {{/str}} {{/pix}}</span>
118 <span class="desc">{{#pix}} t/sort_desc, core, {{#str}}desc, core{{/str}} {{/pix}}</span>
119 <span class="asc">{{#pix}} t/sort_asc, core, {{#str}}asc, core{{/str}} {{/pix}}</span>
120 </button>
121 </div>
122 <div class="cb-date cb-column d-flex">
123 <div class="title">{{#str}} lastmodified, contentbank {{/str}}</div>
124 <button class="btn btn-sm cb-btnsort dir-none ml-auto" data-string="lastmodified" data-action="sortdate"
125 title="{{#str}} sortbyx, core, {{#str}} lastmodified, contentbank {{/str}} {{/str}}">
126 <span class="default">{{#pix}} t/sort, core, {{#str}}sort, core {{/str}} {{/pix}}</span>
127 <span class="desc">{{#pix}} t/sort_desc, core, {{#str}}desc, core{{/str}} {{/pix}}</span>
128 <span class="asc">{{#pix}} t/sort_asc, core, {{#str}}asc, core{{/str}} {{/pix}}</span>
129 </button>
130 </div>
131 <div class="cb-size cb-column d-flex">
132 <div class="title">{{#str}} size, contentbank {{/str}}</div>
133 <button class="btn btn-sm cb-btnsort dir-none ml-auto" data-string="size" data-action="sortsize"
134 title="{{#str}} sortbyx, core, {{#str}} size, contentbank {{/str}} {{/str}}">
135 <span class="default">{{#pix}} t/sort, core, {{#str}}sort, core {{/str}} {{/pix}}</span>
136 <span class="desc">{{#pix}} t/sort_desc, core, {{#str}}desc, core{{/str}} {{/pix}}</span>
137 <span class="asc">{{#pix}} t/sort_asc, core, {{#str}}asc, core{{/str}} {{/pix}}</span>
138 </button>
139 </div>
140 <div class="cb-type cb-column d-flex">
141 <div class="title">{{#str}} type, contentbank {{/str}}</div>
142 <button class="btn btn-sm cb-btnsort dir-none ml-auto" data-string="type" data-action="sorttype"
143 title="{{#str}} sortbyx, core, {{#str}} type, contentbank {{/str}} {{/str}}">
144 <span class="default">{{#pix}} t/sort, core, {{#str}}sort, core {{/str}} {{/pix}}</span>
145 <span class="desc">{{#pix}} t/sort_desc, core, {{#str}}desc, core{{/str}} {{/pix}}</span>
146 <span class="asc">{{#pix}} t/sort_asc, core, {{#str}}asc, core{{/str}} {{/pix}}</span>
147 </button>
148 </div>
149 <div class="cb-author cb-column d-flex last">
150 <div class="title">{{#str}} author, contentbank {{/str}}</div>
151 <button class="btn btn-sm cb-btnsort dir-none ml-auto" data-string="author" data-action="sortauthor"
152 title="{{#str}} sortbyx, core, {{#str}} author, contentbank {{/str}} {{/str}}">
153 <span class="default">{{#pix}} t/sort, core, {{#str}}sort, core {{/str}} {{/pix}}</span>
154 <span class="desc">{{#pix}} t/sort_desc, core, {{#str}}desc, core{{/str}} {{/pix}}</span>
155 <span class="asc">{{#pix}} t/sort_asc, core, {{#str}}asc, core{{/str}} {{/pix}}</span>
156 </button>
157 </div>
158 </div>
159 {{#contents}}
160 <div class="cb-listitem {{#visibilityunlisted}}cb-unlisted{{/visibilityunlisted}}"
161 data-file="{{ title }}"
162 data-name="{{ name }}"
163 data-bytes="{{ bytes }}"
164 data-uses="{{ uses }}"
165 data-timemodified="{{ timemodified }}"
166 data-type="{{ type }}"
167 data-author="{{ author }}">
168 <div class="cb-file cb-column position-relative">
169 <div class="cb-thumbnail" role="img" aria-label="{{ name }}"
170 style="background-image: url('{{{ icon }}}');">
171 </div>
172 <a href="{{{ link }}}" class="cb-link stretched-link" title="{{ name }}">
173 <span class="cb-name word-break-all clamp-2" data-region="cb-content-name">
174 {{{ name }}}
175 </span>
176 </a>
177 </div>
178 <div class="cb-uses cb-column small">
179 {{ uses }}
180 </div>
181 <div class="cb-date cb-column small">
182 {{#userdate}} {{ timemodified }}, {{#str}} strftimedatetimeshort, core_langconfig {{/str}} {{/userdate}}
183 </div>
184 <div class="cb-size cb-column small">
185 {{ size }}
186 </div>
187 <div class="cb-type cb-column small">
188 {{{ type }}}
189 </div>
190 <div class="cb-type cb-column last small">
191 {{{ author }}}
192 </div>
193 </div>
194 {{/contents}}
195 </div>
196 {{/contents.0}}
197 {{^contents.0}}
198 <div class="cb-content-wrapper d-flex flex-wrap p-2" data-region="filearea">
199 <div class="w-100 p-3 text-center text-muted">
200 {{#str}} nocontentavailable, core_contentbank {{/str}}
201 </div>
202 </div>
203 {{/contents.0}}
204 </div>
205 </div>
206</div>