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/>.
18 @template tool_policy/acceptances
20 Template for the user acceptances page.
22 Classes required for JS:
25 Data attributes required for JS:
28 Context variables required for this template:
31 Example context (json):
33 "hasonbehalfagreements": true,
41 "name": "Terms & conditions",
44 "timeaccepted": "1 Mar 2018",
56 "name": "Terms & conditions",
57 "revision": "1.0-beta",
58 "acceptedby": "<a href=\"#\">Mary Smith</a>",
59 "note": "Based on parent's agreement via email",
61 "timeaccepted": "15 Feb 2018",
73 <table class="generaltable fullwidth">
76 <th>{{#str}} policydocname, tool_policy {{/str}}</th>
77 <th>{{#str}} policydocrevision, tool_policy {{/str}}</th>
78 <th>{{#str}} agreed, tool_policy {{/str}}</th>
79 <th>{{#str}} agreedon, tool_policy {{/str}}</th>
80 {{#hasonbehalfagreements}}
81 <th>{{#str}} agreedby, tool_policy {{/str}}</th>
82 <th>{{#str}} acceptancenote, tool_policy {{/str}}</th>
83 {{/hasonbehalfagreements}}
90 <tr {{^isfirst}}class="archived{{policyid}}" style="display:none"{{/isfirst}}>
93 <div style="float:left">
94 {{#pix}} level, tool_policy {{/pix}}
97 <div {{^isfirst}}style="margin-left: 24px" {{/isfirst}}>
98 <div><a href="{{viewurl}}">{{{name}}}</a></div>
102 <a href="{{viewurl}}">{{{revision}}}</a>
103 {{#iscurrent}}<span class="label label-success">{{#str}} status1, tool_policy {{/str}}{{/iscurrent}}
107 {{>tool_policy/user_agreement}}
111 <td>{{timeaccepted}}</td>
112 {{#hasonbehalfagreements}}
113 <td>{{{acceptedby}}}</td>
115 {{/hasonbehalfagreements}}
117 {{#hasarchived}}<a class="showarchived" data-target=".archived{{policyid}}" data-status="hidden" href="#">
118 <div class="toggleoff" style="display:none">{{#pix}}t/less, moodle, {{#str}}detailedless, moodle{{/str}}{{/pix}}</div>
119 <div class="toggleon">{{#pix}}t/more, moodle, {{#str}}detailedmore, moodle{{/str}}{{/pix}}</div>
128 <div><a role="button" href="{{returnurl}}" class="btn btn-primary">{{#str}} back {{/str}}</a></div>
131 require(['jquery'], function($) {
132 $('body').on('click', '.showarchived', function(e) {
134 var target = $(this).attr('data-target'),
135 status = $(this).attr('data-status');
136 if (status === 'hidden') {
138 $(this).attr('data-status', 'shown');
139 $(this).find('.toggleoff').show();
140 $(this).find('.toggleon').hide();
143 $(this).attr('data-status', 'hidden');
144 $(this).find('.toggleon').show();
145 $(this).find('.toggleoff').hide();