-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace markup in
manage.php
with template file
- Add `templates/manage_form.mustache` - Render template with selector HTML and other context from `manage.php`
- Loading branch information
1 parent
499dfcb
commit 4f8a228
Showing
2 changed files
with
99 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
{{! | ||
This file is part of Moodle - https://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 availability_shibboleth2fa/manage_form | ||
Form for managing exceptions from the 2FA condition for users in a course. | ||
Classes required for JS: | ||
* none | ||
Data attributes required for JS: | ||
* none | ||
Context variables required for this template: | ||
* actionurl URL to assign to the `action` attribute of the HTML form | ||
* sesskey Value to assign to the hidden `sesskey` form field | ||
* currentuserselector Fully rendered selector field HTML markup for users that already have an exception | ||
* potentialuserselector Fully rendered selector field HTML markup for users that an exception can be made for | ||
* larrow Left arrow-like character | ||
* larrow Right arrow-like character | ||
Example context (json): | ||
{ | ||
"actionurl": "/availability/condition/shibboleth2fa/manage.php?id=123", | ||
"sesskey": "abc123", | ||
"currentuserselector": "<div><select><option>...</option></select></div>" | ||
"potentialuserselector": "<div><select><option>...</option></select></div>" | ||
"larrow": "◄", | ||
"rarrow": "►" | ||
} | ||
}} | ||
|
||
<form id="assignform" method="post" action="{{actionurl}}"> | ||
<div> | ||
<input type="hidden" name="sesskey" value="{{sesskey}}" /> | ||
<table class="roleassigntable generaltable generalbox boxaligncenter"> | ||
<tr> | ||
<td id="existingcell"> | ||
<p> | ||
<label for="removeselect"> | ||
{{#str}} users_with_exception, availability_shibboleth2fa {{/str}} | ||
</label> | ||
</p> | ||
{{{currentuserselector}}} | ||
</td> | ||
<td id="buttonscell"> | ||
<div id="addcontrols"> | ||
<input name="add" | ||
id="add" | ||
type="submit" | ||
value="{{{larrow}}} {{#str}} add {{/str}}" | ||
title="{{#str}} add {{/str}}" | ||
/> | ||
<br /> | ||
</div> | ||
<div id="removecontrols"> | ||
<input name="remove" | ||
id="remove" | ||
type="submit" | ||
value="{{#str}} remove {{/str}} {{{rarrow}}}" | ||
title="{{#str}} remove {{/str}}" | ||
/> | ||
</div> | ||
</td> | ||
<td id="potentialcell"> | ||
<p> | ||
<label for="addselect"> | ||
{{#str}} users_without_exception, availability_shibboleth2fa {{/str}} | ||
</label> | ||
</p> | ||
{{{potentialuserselector}}} | ||
</td> | ||
</tr> | ||
</table> | ||
</div> | ||
</form> |