MDL-64506 templates: Move BS2 btns' to BS4 btns'
[moodle.git] / admin / tool / policy / templates / page_nopermission.mustache
CommitLineData
6109f234
SA
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 tool_policy/page_nopermission
19
20 Template for showing to the user the policy docs to agree.
21
22 Classes required for JS:
23 * policyactions
24
25 Data attributes required for JS:
26 -
27
28 Context variables required for this template:
29 * pluginbaseurl
30 * haspermissionagreedocs - status of the capability of the user to accept policy documents
31 * messagetitle - Message title to display, with the error.
32 * messagedesc - Message description to display, with the error.
33 * supportname - name of the support contact; displayed when the user does not have permission to accept policy documents
34 * supportemail - email of the support contact; displayed when the user does not have permission to accept policy documents
35 * behalfuser - If behalfid is defined and valid, full name of the behalf user with a link to his/her profile; null otherwise
36 * policies - Array with all the links to current policies (for showing them if needed).
37
38 Example context (json):
39 {
40 "haspermissionagreedocs": false,
41 "messagetitle": "You don't have permission",
42 "messagedesc": "Sorry you don't have permission to accept",
43 "policies": [
44 "Policy 1",
45 "Policy 2"
46 ],
47 "supportname": "Admin",
48 "supportemail": "admin@yoursite.com"
49 }
50}}
51
52{{^haspermissionagreedocs}}
53 <h3>{{{messagetitle}}}</h3>
54 <p class="m-t-1 m-b-1">{{{messagedesc}}}</p>
55
56 <div class="policies">
57 <ul>
58 {{# policies }}
59 <li>{{{.}}}</li>
60 {{/ policies }}
61 </ul>
62 </div>
63
64 <p class="m-t-3">{{#str}}nopermissiontoagreedocscontact, tool_policy{{/str}}</p>
29551c4b 65 <div class="agreedoc-officer card">
6109f234
SA
66 <div>
67 <p class="m-b-0">{{{supportname}}}</p>
68 <p class="m-b-0"><a href="mailto:{{supportemail}}">{{supportemail}}</a></p>
69 </div>
70 </div>
71{{/haspermissionagreedocs}}
72
73{{#js}}
74// Initialise the JS for the modal window which displays the policy versions.
75require(['tool_policy/policyactions'], function(ActionsMod) {
76 ActionsMod.init();
77});
78{{/js}}