1 |
efrain |
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/acceptances
|
|
|
19 |
|
|
|
20 |
Template for the user acceptances page.
|
|
|
21 |
|
|
|
22 |
Classes required for JS:
|
|
|
23 |
-
|
|
|
24 |
|
|
|
25 |
Data attributes required for JS:
|
|
|
26 |
-
|
|
|
27 |
|
|
|
28 |
Context variables required for this template:
|
|
|
29 |
* policies
|
|
|
30 |
|
|
|
31 |
Example context (json):
|
|
|
32 |
{
|
|
|
33 |
"hasonbehalfagreements": true,
|
|
|
34 |
"canrevoke": true,
|
|
|
35 |
"policies": [
|
|
|
36 |
{
|
|
|
37 |
"versions": [
|
|
|
38 |
{
|
|
|
39 |
"isfirst": true,
|
|
|
40 |
"policyid": 1,
|
|
|
41 |
"viewurl": "/",
|
|
|
42 |
"name": "Terms & conditions",
|
|
|
43 |
"revision": "2.0",
|
|
|
44 |
"hasarchived": true,
|
|
|
45 |
"timeaccepted": "1 Mar 2018",
|
|
|
46 |
"iscurrent": true,
|
|
|
47 |
"isoptional": false,
|
|
|
48 |
"agreement": {
|
|
|
49 |
"onbehalf": false,
|
|
|
50 |
"status": false,
|
|
|
51 |
"canaccept": true,
|
|
|
52 |
"acceptlink": "#"
|
|
|
53 |
}
|
|
|
54 |
},
|
|
|
55 |
{
|
|
|
56 |
"isfirst": false,
|
|
|
57 |
"policyid": 1,
|
|
|
58 |
"viewurl": "/",
|
|
|
59 |
"name": "Terms & conditions",
|
|
|
60 |
"revision": "1.0-beta",
|
|
|
61 |
"acceptedby": "<a href=\"#\">Mary Smith</a>",
|
|
|
62 |
"note": "Based on parent's agreement via email",
|
|
|
63 |
"hasarchived": false,
|
|
|
64 |
"timeaccepted": "15 Feb 2018",
|
|
|
65 |
"iscurrent": true,
|
|
|
66 |
"isoptional": false,
|
|
|
67 |
"agreement": {
|
|
|
68 |
"onbehalf": true,
|
|
|
69 |
"status": true,
|
|
|
70 |
"canaccept": false
|
|
|
71 |
}
|
|
|
72 |
}
|
|
|
73 |
]
|
|
|
74 |
}
|
|
|
75 |
]
|
|
|
76 |
}
|
|
|
77 |
}}
|
|
|
78 |
{{^canrevoke}}
|
|
|
79 |
<div class="alert alert-info">{{#str}} contactdpo, tool_policy {{/str}}</div>
|
|
|
80 |
{{/canrevoke}}
|
|
|
81 |
|
|
|
82 |
<table class="generaltable fullwidth">
|
|
|
83 |
<thead>
|
|
|
84 |
<tr>
|
|
|
85 |
<th>{{#str}} policydocname, tool_policy {{/str}}</th>
|
|
|
86 |
<th>{{#str}} policydocrevision, tool_policy {{/str}}</th>
|
|
|
87 |
<th>{{#str}} response, tool_policy {{/str}}</th>
|
|
|
88 |
<th>{{#str}} responseon, tool_policy {{/str}}</th>
|
|
|
89 |
{{#hasonbehalfagreements}}
|
|
|
90 |
<th>{{#str}} responseby, tool_policy {{/str}}</th>
|
|
|
91 |
<th>{{#str}} acceptancenote, tool_policy {{/str}}</th>
|
|
|
92 |
{{/hasonbehalfagreements}}
|
|
|
93 |
<th></th>
|
|
|
94 |
</tr>
|
|
|
95 |
</thead>
|
|
|
96 |
<tbody>
|
|
|
97 |
{{#policies}}
|
|
|
98 |
{{#versions}}
|
|
|
99 |
{{#agreement}}
|
|
|
100 |
<tr {{^isfirst}}class="archived{{policyid}}" style="display:none"{{/isfirst}}>
|
|
|
101 |
<td>
|
|
|
102 |
{{^isfirst}}
|
|
|
103 |
<div style="float:left">
|
|
|
104 |
<svg
|
|
|
105 |
width="24"
|
|
|
106 |
height="24"
|
|
|
107 |
viewBox="0 0 24 24"
|
|
|
108 |
fill="none"
|
|
|
109 |
xmlns="http://www.w3.org/2000/svg"
|
|
|
110 |
>
|
|
|
111 |
<path
|
|
|
112 |
d="M6.85046 13.4005C5.74589 13.4005 4.85046 12.5051 4.85046 11.4005V3.40051H2.85046V11.4005C2.85046 13.6097 4.64132 15.4005 6.85046 15.4005H17.156L13.3714 19.1852L14.7856 20.5994L21.1495 14.2354L14.7856 7.87146L13.3714 9.28567L17.4862 13.4005H6.85046Z"
|
|
|
113 |
fill="currentColor"
|
|
|
114 |
/>
|
|
|
115 |
</svg>
|
|
|
116 |
</div>
|
|
|
117 |
{{/isfirst}}
|
|
|
118 |
<div {{^isfirst}}style="margin-left: 36px" {{/isfirst}}>
|
|
|
119 |
<div><a href="{{viewurl}}">{{{name}}}</a></div>
|
|
|
120 |
</div>
|
|
|
121 |
</td>
|
|
|
122 |
<td>
|
|
|
123 |
<a class="small mr-1" href="{{viewurl}}">{{{revision}}}</a>
|
|
|
124 |
{{#iscurrent}}<span class="badge badge-sm badge-success">{{#str}} status1, tool_policy {{/str}}</span>{{/iscurrent}}
|
|
|
125 |
{{#isoptional}}<span class="badge badge-sm badge-info">{{#str}} policydocoptionalyes, tool_policy {{/str}}</span>{{/isoptional}}
|
|
|
126 |
</td>
|
|
|
127 |
<td>
|
|
|
128 |
{{>tool_policy/user_agreement}}
|
|
|
129 |
</td>
|
|
|
130 |
<td><small>{{timeaccepted}}</small></td>
|
|
|
131 |
{{#hasonbehalfagreements}}
|
|
|
132 |
<td>{{{acceptedby}}}</td>
|
|
|
133 |
<td>{{{note}}}</td>
|
|
|
134 |
{{/hasonbehalfagreements}}
|
|
|
135 |
<td>
|
|
|
136 |
{{#hasarchived}}<a class="showarchived" data-target=".archived{{policyid}}" data-status="hidden" href="#">
|
|
|
137 |
<div class="toggleoff" style="display:none">{{#pix}}t/less, moodle, {{#str}}detailedless, moodle{{/str}}{{/pix}}</div>
|
|
|
138 |
<div class="toggleon">{{#pix}}t/more, moodle, {{#str}}detailedmore, moodle{{/str}}{{/pix}}</div>
|
|
|
139 |
</a>{{/hasarchived}}
|
|
|
140 |
</td>
|
|
|
141 |
</tr>
|
|
|
142 |
{{/agreement}}
|
|
|
143 |
{{/versions}}
|
|
|
144 |
{{/policies}}
|
|
|
145 |
</tbody>
|
|
|
146 |
</table>
|
|
|
147 |
{{#returnurl}}
|
|
|
148 |
<div><a role="button" href="{{returnurl}}" class="btn btn-primary">{{#str}} back {{/str}}</a></div>
|
|
|
149 |
{{/returnurl}}
|
|
|
150 |
{{#js}}
|
|
|
151 |
require(['jquery'], function($) {
|
|
|
152 |
$('body').on('click', '.showarchived', function(e) {
|
|
|
153 |
e.preventDefault();
|
|
|
154 |
var target = $(this).attr('data-target'),
|
|
|
155 |
status = $(this).attr('data-status');
|
|
|
156 |
if (status === 'hidden') {
|
|
|
157 |
$(target).show();
|
|
|
158 |
$(this).attr('data-status', 'shown');
|
|
|
159 |
$(this).find('.toggleoff').show();
|
|
|
160 |
$(this).find('.toggleon').hide();
|
|
|
161 |
} else {
|
|
|
162 |
$(target).hide();
|
|
|
163 |
$(this).attr('data-status', 'hidden');
|
|
|
164 |
$(this).find('.toggleon').show();
|
|
|
165 |
$(this).find('.toggleoff').hide();
|
|
|
166 |
}
|
|
|
167 |
});
|
|
|
168 |
});
|
|
|
169 |
{{/js}}
|