MDL-64506 templates: BS2 pull-x -> BS4 float-x
[moodle.git] / admin / tool / lp / templates / user_evidence_list_page.mustache
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/>.
16 }}
17 {{!
18     User evidence list page.
20     Data attributes required for JS:
21     * data-action = user-evidence-delete
22     * data-region = user-evidence-list
23     * data-region = user-evidence-node
24     * data-id = user evidence ID
25     * data-userid = user evidence user ID
27     Context variables required for this template:
28     * userid - The ID of the user whose page we're viewing
29     * canmanage - Whether the current user can manage the evidence
30     * evidence - The list of evidence
31     * navigation - Buttons to add to the page
32     * pluginbaseurl - The plugin base URL
33 }}
35 <div data-region="user-evidence-list">
36 <div class="float-left">
37     {{#navigation}}
38         {{{.}}}
39     {{/navigation}}
40 </div>
41 <table class="generaltable fullwidth">
42     <caption>{{#str}}listofevidence, tool_lp{{/str}}</caption>
43     <thead>
44         <tr>
45             <th scope="col" width="20%">{{#str}}userevidencename, tool_lp{{/str}}</th>
46             <th scope="col">{{#str}}userevidencesummary, tool_lp{{/str}}</th>
47             <th scope="col">{{#str}}linkedcompetencies, tool_lp{{/str}} ({{#str}}status, tool_lp{{/str}} / {{#str}}reviewer, tool_lp{{/str}})</th>
48             {{#canmanage}}
49                 <th scope="col">{{#str}}actions, tool_lp{{/str}}</th>
50             {{/canmanage}}
51         </tr>
52     </thead>
53     <tbody>
54         {{#evidence}}
55         <tr data-region='user-evidence-node' data-id="{{id}}" data-userid="{{userid}}">
56             <td><a href="{{pluginbaseurl}}/user_evidence.php?id={{id}}">{{{name}}}</a></td>
57             <td>
58                 {{^hasurlorfiles}}
59                     -
60                 {{/hasurlorfiles}}
61                 {{#hasurlorfiles}}
62                     <ul class="user-evidence-documents">
63                         {{#url}}
64                             <li>{{#pix}}url, tool_lp{{/pix}} <a href="{{url}}" title="{{url}}">{{urlshort}}</a></li>
65                         {{/url}}
66                         {{#files}}
67                             <li>{{#pix}}{{icon}}{{/pix}} <a href="{{url}}" title="{{filename}}">{{filenameshort}}</a></li>
68                         {{/files}}
69                     </ul>
70                 {{/hasurlorfiles}}
71             </td>
72             <td>
73                 {{^competencycount}}
74                 -
75                 {{/competencycount}}
76                 {{#competencycount}}
77                     <ul class="user-evidence-competencies">
78                     {{#usercompetencies}}
79                         <li>
80                             {{{competency.shortname}}} <small><em>{{competency.idnumber}}</em></small> ({{usercompetency.statusname}}{{#usercompetency.reviewer.fullname}} / {{usercompetency.reviewer.fullname}}{{/usercompetency.reviewer.fullname}})
81                         </li>
82                     {{/usercompetencies}}
83                     </ul>
84                 {{/competencycount}}
85             </td>
86             {{#canmanage}}
87             <td>
88                 <div style="display: inline-block;">
89                 <ul title="{{#str}}edit{{/str}}" class="user-evidence-actions">
90                 <li>
91                     <a href="#">{{#str}}edit{{/str}}</a><b class="caret"></b>
92                     <ul class="dropdown dropdown-menu">
93                         <li class="dropdown-item">
94                             <a href="{{pluginbaseurl}}/user_evidence_edit.php?id={{id}}&amp;userid={{userid}}&amp;return=list">
95                                 {{#pix}}t/edit{{/pix}} {{#str}}editthisuserevidence, tool_lp{{/str}}
96                             </a>
97                         </li>
98                         {{#userhasplan}}
99                         <li class="dropdown-item">
100                             <a href="#" data-action="link-competency">
101                                 {{#pix}}t/add{{/pix}} {{#str}}linkcompetencies, tool_lp{{/str}}
102                             </a>
103                         </li>
104                         {{/userhasplan}}
105                         <li class="dropdown-item">
106                             <a data-action="send-competencies-review" href="#">
107                                 {{#pix}}t/edit{{/pix}} {{#str}}sendcompetenciestoreview, tool_lp{{/str}}
108                             </a>
109                         </li>
110                         <li class="dropdown-item">
111                             <a data-action="user-evidence-delete" href="#">
112                                 {{#pix}}t/delete{{/pix}} {{#str}}deletethisuserevidence, tool_lp{{/str}}
113                             </a>
114                         </li>
115                     </ul>
116                 </ul>
117             </div>
118             {{/canmanage}}
119             </td>
120         </tr>
121         {{/evidence}}
122     </tbody>
123 </table>
125 {{^evidence}}
126     <p class="alert alert-info">{{#str}}nouserevidence, tool_lp{{/str}}</p>
127 {{/evidence}}
129 </div>
131 {{#js}}
132 require(['tool_lp/user_evidence_actions'], function(UserEvidenceActions) {
133     var uea = new UserEvidenceActions('list');
134     uea.enhanceMenubar('.user-evidence-actions');
135 });
136 {{/js}}