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