first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,158 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_policy/acceptances
Template for the user acceptances page.
Classes required for JS:
-
Data attributes required for JS:
-
Context variables required for this template:
* policies
Example context (json):
{
"hasonbehalfagreements": true,
"canrevoke": true,
"policies": [
{
"versions": [
{
"isfirst": true,
"policyid": 1,
"viewurl": "/",
"name": "Terms &amp; conditions",
"revision": "2.0",
"hasarchived": true,
"timeaccepted": "1 Mar 2018",
"iscurrent": true,
"isoptional": false,
"agreement": {
"onbehalf": false,
"status": false,
"canaccept": true,
"acceptlink": "#"
}
},
{
"isfirst": false,
"policyid": 1,
"viewurl": "/",
"name": "Terms &amp; conditions",
"revision": "1.0-beta",
"acceptedby": "<a href=\"#\">Mary Smith</a>",
"note": "Based on parent's agreement via email",
"hasarchived": false,
"timeaccepted": "15 Feb 2018",
"iscurrent": true,
"isoptional": false,
"agreement": {
"onbehalf": true,
"status": true,
"canaccept": false
}
}
]
}
]
}
}}
{{^canrevoke}}
<div class="alert alert-info">{{#str}} contactdpo, tool_policy {{/str}}</div>
{{/canrevoke}}
<table class="generaltable fullwidth">
<thead>
<tr>
<th>{{#str}} policydocname, tool_policy {{/str}}</th>
<th>{{#str}} policydocrevision, tool_policy {{/str}}</th>
<th>{{#str}} response, tool_policy {{/str}}</th>
<th>{{#str}} responseon, tool_policy {{/str}}</th>
{{#hasonbehalfagreements}}
<th>{{#str}} responseby, tool_policy {{/str}}</th>
<th>{{#str}} acceptancenote, tool_policy {{/str}}</th>
{{/hasonbehalfagreements}}
<th></th>
</tr>
</thead>
<tbody>
{{#policies}}
{{#versions}}
{{#agreement}}
<tr {{^isfirst}}class="archived{{policyid}}" style="display:none"{{/isfirst}}>
<td>
{{^isfirst}}
<div style="float:left">
{{#pix}} level, tool_policy {{/pix}}
</div>
{{/isfirst}}
<div {{^isfirst}}style="margin-left: 24px" {{/isfirst}}>
<div><a href="{{viewurl}}">{{{name}}}</a></div>
</div>
</td>
<td>
<a href="{{viewurl}}">{{{revision}}}</a>
{{#iscurrent}}<span class="badge bg-success text-white">{{#str}} status1, tool_policy {{/str}}</span>{{/iscurrent}}
{{#isoptional}}<span class="badge bg-info text-white">{{#str}} policydocoptionalyes, tool_policy {{/str}}</span>{{/isoptional}}
</td>
<td>
{{>tool_policy/user_agreement}}
</td>
<td>{{timeaccepted}}</td>
{{#hasonbehalfagreements}}
<td>{{{acceptedby}}}</td>
<td>{{{note}}}</td>
{{/hasonbehalfagreements}}
<td>
{{#hasarchived}}<a class="showarchived" data-target=".archived{{policyid}}" data-status="hidden" href="#">
<div class="toggleoff" style="display:none">{{#pix}}t/less, moodle, {{#str}}detailedless, moodle{{/str}}{{/pix}}</div>
<div class="toggleon">{{#pix}}t/more, moodle, {{#str}}detailedmore, moodle{{/str}}{{/pix}}</div>
</a>{{/hasarchived}}
</td>
</tr>
{{/agreement}}
{{/versions}}
{{/policies}}
</tbody>
</table>
{{#returnurl}}
<div><a role="button" href="{{returnurl}}" class="btn btn-primary">{{#str}} back {{/str}}</a></div>
{{/returnurl}}
{{#js}}
require(['jquery'], function($) {
$('body').on('click', '.showarchived', function(e) {
e.preventDefault();
var target = $(this).attr('data-target'),
status = $(this).attr('data-status');
if (status === 'hidden') {
$(target).show();
$(this).attr('data-status', 'shown');
$(this).find('.toggleoff').show();
$(this).find('.toggleon').hide();
} else {
$(target).hide();
$(this).attr('data-status', 'hidden');
$(this).find('.toggleon').show();
$(this).find('.toggleoff').hide();
}
});
});
{{/js}}
@@ -0,0 +1,67 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_policy/acceptances_filter
Template for the unified filter element.
Context variables required for this template:
* action string - The action URL for the form.
* filteroptions - Array of filter options.
* value string - The option value.
* label string - The option label.
* selected boolean - Whether the option is selected
Example context (json):
{
"action": "/admin/tool/policy/acceptances.php",
"filteroptions": [
{
"value": "1",
"label": "Option 1"
},
{
"value": "2",
"label": "Option 2",
"selected": true
},
{
"value": "3",
"label": "Option 3",
"selected": true
},
{
"value": "4",
"label": "Option 4"
}
]
}
}}
<form method="post" action="{{action}}" class="mb-1" role="search">
<label for="unified-filters" class="sr-only">{{#str}}filters , tool_policy{{/str}}</label>
<select name="unified-filters[]" id="unified-filters" multiple="multiple" data-originaloptionsjson="{{originaloptionsjson}}" class="form-autocomplete-original-select">
{{#filteroptions}}
<option value="{{value}}" {{#selected}}selected="selected"{{/selected}}>{{{label}}}</option>
{{/filteroptions}}
</select>
<input type="hidden" name="unified-filter-submitted" value="1">
</form>
{{#js}}
require(['tool_policy/acceptances_filter'], function(Filter) {
Filter.init();
});
{{/js}}
@@ -0,0 +1,94 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_policy/guestconsent
Template for the guest consent message.
Classes required for JS:
* eupopup
* policyactions
Data attributes required for JS:
-
Context variables required for this template:
* pluginbaseurl
* returnurl - urlencoded URL to return to
* haspolicies - true if there are guest policies; false otherwise
* policies - array of policy documents
Example context (json):
{
"pluginbaseurl": "https://example.com",
"returnurl": "/",
"haspolicies": true,
"policies": [
{
"id": 1,
"name": "Terms &amp; conditions"
}
]
}
}}
{{#haspolicies}}
{{! Only show message if there is some policy related to guests. }}
<div {{!
}}class="eupopup eupopup-container eupopup-container-block eupopup-container-bottom eupopup-block eupopup-style-compact" {{!
}}role="dialog" {{!
}}aria-label="{{# str }} acceptancepolicies, tool_policy {{/str}}"{{!
}}>
</div>
<div class="eupopup-markup d-none">
<div class="eupopup-head"></div>
<div class="eupopup-body">
{{# str }} guestconsentmessage, tool_policy {{/ str }}
<ul>
{{#policies}}
<li>
<a href="{{pluginbaseurl}}/view.php?versionid={{id}}{{#returnurl}}&amp;returnurl={{.}}{{/returnurl}}" {{!
}}data-action="view-guest" data-versionid="{{id}}" data-behalfid="1">
{{{name}}}
</a>
</li>
{{/policies}}
</ul>
</div>
<div class="eupopup-buttons">
<a href="#" class="eupopup-button eupopup-button_1">{{# str }} guestconsent:continue, tool_policy {{/ str }}</a>
</div>
<div class="clearfix"></div>
<a href="#" class="eupopup-closebutton">x</a>
</div>
{{#js}}
require(['jquery', 'tool_policy/jquery-eu-cookie-law-popup', 'tool_policy/policyactions'], function($, Popup, ActionsMod) {
// Initialise the guest popup.
$(document).ready(function() {
// Initialize popup.
$(document.body).addClass('eupopup');
if ($(".eupopup").length > 0) {
$(document).euCookieLawPopup().init();
}
// Initialise the JS for the modal window which displays the policy versions.
ActionsMod.init('[data-action="view-guest"]');
});
});
{{/js}}
{{/haspolicies}}
@@ -0,0 +1,148 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_policy/page_agreedocs
Template for showing to the user the policy docs to agree.
Classes required for JS:
* policyactions
Data attributes required for JS:
-
Context variables required for this template:
* pluginbaseurl
* myurl
* sesskey
* policies - policy array
* behalfuser - If behalfid is defined and valid, full name of the behalf user with a link to his/her profile; null otherwise
Example context (json):
{
"myurl": "/admin/tool/policy/index.php",
"sesskey": "123456",
"behalfuser": "Sam Student",
"policies": [
{
"id": 1,
"name": "Terms &amp; conditions",
"policymodal": "<a href=\"#\">Terms &amp; conditions</a>",
"summary": "Policy <u>summary</u>",
"versionagreed": false,
"versionlangsagreed": "Agreed",
"versionbehalfsagreed": ""
}
]
}
}}
{{#messages}}{{{.}}}{{/messages}}
<form id="agreedocsform" method="post" action="{{myurl}}">
<input type="hidden" name="sesskey" value="{{sesskey}}">
{{#behalfuser}}
<div class="clearfix">
<div class="float-right mb-2">
{{# str }} viewconsentpageforuser, tool_policy, {{{ . }}} {{/ str }}
</div>
</div>
{{/behalfuser}}
<div class="clearfix">
<div class="float-left">
<h2>{{# str }}consentpagetitle, tool_policy{{/ str }}</h2>
</div>
</div>
<div class="clearfix mt-2">
<h3>{{# str }}agreepolicies, tool_policy {{/ str }}</h3>
</div>
<hr>
{{#policies}}
<input value="{{id}}" name="listdoc[]" type="hidden">
<div class="agreedoc-policy clearfix mt-2 mb-1">
<h3>{{{name}}}</h3>
<div class="agreedoc-content">
<div class="agreedoc-summary mb-2">
{{{summary}}}
</div>
<div class="agreedoc-msg">
{{# str }}refertofullpolicytext, tool_policy, {{{policymodal}}} {{/ str }}
</div>
<div class="agreedoc-form mt-1">
{{#optional}}
<div class="agreedoc-radios">
<div class="agreedoc-radios-1">
<label>
<input type="radio" name="status{{id}}" value="1" {{#versionagreed}}checked="{{.}}"{{/versionagreed}}>
{{# str }}iagree, tool_policy, {{{name}}} {{/ str }}
</label>
</div>
<div class="agreedoc-radios-0">
<label>
<input type="radio" name="status{{id}}" value="0" {{#versiondeclined}}checked="{{.}}"{{/versiondeclined}}>
{{# str }}idontagree, tool_policy, {{{name}}} {{/ str }}
</label>
</div>
</div>
{{/optional}}
{{^optional}}
<div class="agreedoc-checkbox">
<label>
<input value="1" name="status{{id}}" {{#versionagreed}}checked="{{.}}"{{/versionagreed}} type="checkbox">
{{# str }}iagree, tool_policy, {{{name}}} {{/ str }}
<i class="icon fa fa-exclamation-circle text-danger fa-fw" title="{{# str }} required {{/ str }}" ></i>
</label>
</div>
<ul class="agreedoc-msg list-unstyled">
{{#versionlangsagreed}}
<li><small>{{{.}}}</small></li>
{{/versionlangsagreed}}
{{#versionbehalfsagreed}}
<li><small>{{{.}}}</small></li>
{{/versionbehalfsagreed}}
</ul>
{{/optional}}
</div>
</div>
</div>
{{/policies}}
{{# str }}somefieldsrequired, form, <i class="icon fa fa-exclamation-circle text-danger fa-fw" title="{{# str }} required {{/ str }}" ></i>{{/ str }}
<hr>
<input type="submit" class="btn btn-primary" name="submit" value="{{#cleanstr}} next {{/cleanstr}}">
{{#cancancel}}
<input type="submit" class="btn btn-secondary" name="cancel" value="{{#cleanstr}} cancel {{/cleanstr}}">
{{/cancancel}}
</form>
{{#js}}
// Initialise the JS for the modal window which displays the policy versions.
require(['tool_policy/policyactions'], function(ActionsMod) {
ActionsMod.init('[data-action="view"]');
});
{{/js}}
@@ -0,0 +1,151 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_policy/page_managedocs_list
Template for the policy documents management page.
Classes required for JS:
-
Data attributes required for JS:
* data-policy-name
* data-policy-revision
* data-action
Context variables required for this template:
* haspolicies
* policies
Example context (json):
{
"title": "Manage policies",
"backurl": "/",
"pluginbaseurl": "/admin/tool/policy/",
"canviewacceptances": true,
"canmanage": true,
"versions": [
{
"id": 1,
"name": "Terms &amp; conditions",
"typetext": "Site policy",
"audiencetext": "All users",
"statustext": "Active",
"optionaltext": "Optional",
"revision": "1.0",
"timemodified": 1521531208,
"acceptancescounturl": "#",
"acceptancescounttext": "10 out of 1000 (1%)"
},
{
"indented": true,
"name": "Terms &amp; conditions",
"typetext": "Site policy",
"audiencetext": "All users",
"statustext": "Draft",
"optionaltext": "Compulsory",
"revision": "2.0",
"timemodified": 1521531208,
"acceptancescounttext": "N/A"
}
]
}
}}
<h2>{{{title}}}</h2>
{{#backurl}}
<div>
<div class="btn-group">
<a href="{{backurl}}" class="btn btn-secondary">{{#str}} back {{/str}}</a>
</div>
</div>
{{/backurl}}
{{#canaddnew}}
<div>
<div class="btn-group">
<a href="{{pluginbaseurl}}/editpolicydoc.php" class="btn btn-primary">{{#str}} newpolicy, tool_policy {{/str}}</a>
</div>
</div>
{{/canaddnew}}
<table id="tool-policy-managedocs-wrapper" class="generaltable fullwidth listpolicydocuments">
<thead>
<tr>
<th scope="col">{{#str}} policydocname, tool_policy {{/str}}</th>
<th scope="col">{{#str}} status, tool_policy {{/str}}</th>
<th scope="col">{{#str}} policydocrevision, tool_policy {{/str}}</th>
{{#canviewacceptances}}
<th scope="col">{{#str}} usersaccepted, tool_policy {{/str}}</th>
{{/canviewacceptances}}
{{#canmanage}}
<th scope="col"></th>
{{/canmanage}}
</tr>
</thead>
<tbody>
{{#versions}}
<tr data-policy-name="{{{name}}}" data-policy-revision="{{revision}}">
<td>
{{#indented}}
<div style="float:left">
{{#pix}} level, tool_policy {{/pix}}
</div>
{{/indented}}
<div {{#indented}}style="margin-left: 24px" {{/indented}}>
<div>{{{name}}}</div>
<div class="text-muted, muted"><small>{{{typetext}}}, {{{audiencetext}}}, {{{optionaltext}}}</small></div>
</div>
</td>
<td>
{{{statustext}}}
</td>
<td>
{{revision}}
<div class="text-muted, muted">
<small>
<time title="{{#str}} lastmodified, core {{/str}}" datetime="{{#userdate}} {{timemodified}}, %Y-%m-%dT%T%z {{/userdate}}">
{{#userdate}} {{timemodified}}, {{#str}} strftimedatetime, core_langconfig {{/str}} {{/userdate}}
</time>
</small>
</div>
</td>
{{#canviewacceptances}}
<td>
{{#acceptancescounturl}}
<a href="{{acceptancescounturl}}">{{acceptancescounttext}}</a>
{{/acceptancescounturl}}
{{^acceptancescounturl}}
{{acceptancescounttext}}
{{/acceptancescounturl}}
</td>
{{/canviewacceptances}}
{{#canmanage}}
<td>
{{#actionmenu}}
{{>core/action_menu}}
{{/actionmenu}}
</td>
{{/canmanage}}
</tr>
{{/versions}}
</tbody>
</table>
{{#js}}
require(['tool_policy/managedocsactions'], function(ManageDocsActions) {
ManageDocsActions.init('tool-policy-managedocs-wrapper');
});
{{/js}}
@@ -0,0 +1,75 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_policy/page_nopermission
Template for showing to the user the policy docs to agree.
Classes required for JS:
* policyactions
Data attributes required for JS:
-
Context variables required for this template:
* pluginbaseurl
* haspermissionagreedocs - status of the capability of the user to accept policy documents
* messagetitle - Message title to display, with the error.
* messagedesc - Message description to display, with the error.
* supportname - name of the support contact; displayed when the user does not have permission to accept policy documents
* supportemail - email of the support contact; displayed when the user does not have permission to accept policy documents
* behalfuser - If behalfid is defined and valid, full name of the behalf user with a link to his/her profile; null otherwise
* policies - Array with all the links to current policies (for showing them if needed).
Example context (json):
{
"haspermissionagreedocs": false,
"messagetitle": "You don't have permission",
"messagedesc": "Sorry you don't have permission to accept",
"policies": [
"Policy 1",
"Policy 2"
],
"supportname": "Admin",
"supportemail": "moodlesite/user/contactsitesupport.php"
}
}}
{{^haspermissionagreedocs}}
<h3>{{{messagetitle}}}</h3>
<p class="mt-1 mb-1">{{{messagedesc}}}</p>
<div class="policies">
<ul>
{{# policies }}
<li>{{{.}}}</li>
{{/ policies }}
</ul>
</div>
{{#supportemail}}
<p>{{#str}}nopermissiontoagreedocscontact, tool_policy{{/str}}</p>
<p>{{{supportemail}}}</p>
{{/supportemail}}
{{/haspermissionagreedocs}}
{{#js}}
// Initialise the JS for the modal window which displays the policy versions.
require(['tool_policy/policyactions'], function(ActionsMod) {
ActionsMod.init('[data-action="view"]');
});
{{/js}}
@@ -0,0 +1,111 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_policy/page_viewalldoc
Template for viewing all policy versions, one under another.
Classes required for JS:
-
Data attributes required for JS:
-
Context variables required for this template:
* returnurl - url to the previous page
* policies - policy array
Example context (json):
{
"returnurl": "#",
"policies": [
{
"id": "2",
"name": "Terms &amp; conditions",
"summary": "Policy <u>summary</u>",
"content": "Policy <em>content</em>",
"policytypestr": "Site policy",
"policyaudiencestr": "All users"
},
{
"id": "5",
"name": "Privacy",
"summary": "We keep your information private",
"content": "Very private",
"policytypestr": "Privacy policy",
"policyaudiencestr": "Authenticated users"
}
]
}
}}
{{#returnurl}}
<div class="text-right mb-1">
<a href="{{returnurl}}">{{# str }} backtoprevious, tool_policy {{/ str }}</a>
</div>
{{/returnurl}}
<a id="top"></a>
<div id="policies_index">
<h1>{{# str }} listactivepolicies, tool_policy {{/ str }}</h1>
<table class="table">
<thead>
<tr>
<th scope="col">{{# str }}policydocname, tool_policy {{/ str }}</th>
<th scope="col">{{# str }}policydoctype, tool_policy {{/ str }}</th>
<th scope="col">{{# str }}policydocaudience, tool_policy {{/ str }}</th>
</tr>
</thead>
<tbody>
{{#policies }}
<tr>
<td><a href="#policy-{{id}}">{{{name}}}</a></td>
<td>{{{ policytypestr }}}</td>
<td>{{{ policyaudiencestr }}}</td>
</tr>
{{/policies }}
</tbody>
</table>
</div>
{{^policies }}
{{# str }} noactivepolicies, tool_policy {{/ str }}
{{/policies }}
{{#policies }}
<hr>
<div class="policy_version mb-3">
<div class="clearfix mt-2">
<h2><a id="policy-{{id}}">{{{name}}}</a></h2>
</div>
<div class="policy_document_summary clearfix mb-1">
<h3>{{# str }} policydocsummary, tool_policy {{/ str }}</h3>
{{{summary}}}
</div>
<div class="policy_document_content mt-2">
<h3>{{# str }} policydoccontent, tool_policy {{/ str }}</h3>
{{{content}}}
</div>
<div class="float-right">
<a href="#top">
{{# str }} backtotop, tool_policy {{/ str }}
<i class="icon text-primary fa fa-caret-up" title="{{# str }} backtotop, tool_policy {{/ str }}" ></i>
</a>
</div>
</div>
{{/policies }}
@@ -0,0 +1,105 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_policy/page_viewdoc
Template for viewing a policy version document.
Classes required for JS:
-
Data attributes required for JS:
-
Context variables required for this template:
* policy - version document object.
Example context (json):
{
"numpolicy": 1,
"totalpolicies": 2,
"policy": {
"name": "Terms &amp; conditions",
"summary": "Policy <u>summary</u>",
"content": "Policy <em>content</em>"
},
"returnurl": "#",
"editurl": "#",
"accepturl": "#"
}
}}
<a id="top"></a>
<div class="clearfix">
<div class="float-left">
<h2>{{{policy.name}}}</h2>
</div>
{{# numpolicy }}
<div class="float-right">
{{# str }} steppolicies, tool_policy,
{ "numpolicy": {{# quote }}{{numpolicy}}{{/quote }}, "totalpolicies": {{# quote }}{{totalpolicies}}{{/ quote }} }
{{/ str }}
</div>
{{/ numpolicy }}
</div>
{{# numpolicy }}
<div class="clearfix mt-2">
<h3>{{# str }}readpolicy, tool_policy, {{{policy.name}}} {{/ str }}</h3>
</div>
{{/ numpolicy }}
<hr>
<div class="policy_document mt-1">
<div class="policy_document_summary clearfix mb-1">
{{{policy.summary}}}
</div>
<div class="policy_document_content mt-2">
{{{policy.content}}}
</div>
</div>
<hr>
<div class="policy_buttons">
{{#returnurl}}
{{# numpolicy }}
<a role="button" href="{{returnurl}}" class="btn btn-primary">{{#str}} next {{/str}}</a>
{{/ numpolicy }}
{{^ numpolicy }}
<a role="button" href="{{returnurl}}" class="btn btn-primary">{{#str}} back {{/str}}</a>
{{/ numpolicy }}
{{/returnurl}}
{{#editurl}}
<a role="button" href="{{editurl}}" class="btn">{{#str}} edit {{/str}}</a>
{{/editurl}}
{{#accepturl}}
<a role="button" href="{{accepturl}}" class="btn btn-primary">{{#str}} iagree, tool_policy, {{{policy.name}}} {{/str}}</a>
{{/accepturl}}
{{#declineurl}}
<a role="button" href="{{declineurl}}" class="btn btn-link">{{#str}} idontagree, tool_policy, {{{policy.name}}} {{/str}}</a>
{{/declineurl}}
<div class="float-right">
<a href="#top">
{{# str }} backtotop, tool_policy {{/ str }}
<i class="icon text-primary fa fa-caret-up" title="{{# str }} backtotop, tool_policy {{/ str }}" ></i>
</a>
</div>
</div>
@@ -0,0 +1,55 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template tool_policy/user_agreement
Template for the user agreement icon.
Classes required for JS:
-
Data attributes required for JS:
-
Context variables required for this template:
* statusicon
* statustext
* actions
- url
- data
- text
- title
Example context (json):
{
"statusicon": "accepted",
"statustext": "Accepted",
"actions": {
"url": "/admin/tool/policy/accept.php?param=value",
"data": "acceptmodal",
"text": "Withdraw",
"title": "Withdraw acceptance of Site policy"
}
}
}}
<span class="tool_policy-user_agreement-icon">{{#pix}} {{statusicon}}, tool_policy{{/pix}}</span>
<span class="tool_policy-user_agreement-status">{{statustext}}</span>
<span class="tool_policy-user_agreement-actions">
{{#actions}}
<a href="{{url}}" title="{{title}}" data-action="{{data}}"><small>{{text}}</small></a>
{{/actions}}
</span>