Moodle release 4.3.3
[moodle.git] / admin / templates / setting_encryptedpassword.mustache
blobf5b05d64185f966c0b38435be265385affa55d80
1 {{!
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/>.
17 {{!
18     @template core_admin/setting_encryptedpassword
20     Admin encrypted password template.
22     Context variables required for this template:
23     * name - form element name
24     * set - whether it is set or empty
25     * id - element id
27     Example context (json):
28     {
29         "name": "test",
30         "id": "test0",
31         "set": true
32     }
34 <div class="core_admin_encryptedpassword" data-encryptedpasswordid="{{ id }}"
35         {{#novalue}}data-novalue="y"{{/novalue}}>
36     {{#set}}
37         <span>{{# str }} encryptedpassword_set, admin {{/ str }}</span>
38     {{/set}}
39     {{^set}}
40         <a href="#" title="{{# str }} encryptedpassword_edit, admin {{/ str }}">
41             <span>{{# str }} novalueclicktoset, form {{/ str }}</span>
42             {{# pix }} t/passwordunmask-edit, core, {{# str }} passwordunmaskedithint, form {{/ str }}{{/ pix }}
43         </a>
44     {{/set}}
45     <input style="display: none" type="password" name="{{name}}" disabled>
46     {{!
47         Using buttons instead of links here allows them to be connected to the label, so the button
48         works if you click the label.
49     }}
50     {{#set}}
51         <button type="button" id="{{id}}" title="{{# str }} encryptedpassword_edit, admin {{/ str }}" class="btn btn-link" data-editbutton>
52             {{# pix }} t/passwordunmask-edit, core, {{/ pix }}
53         </button>
54     {{/set}}
55     <button type="button" style="display: none" title="{{# str }} cancel {{/ str }}" class="btn btn-link" data-cancelbutton>
56         <i class="icon fa fa-times"></i>
57     </button>
58 </div>
60 {{#js}}
61 require(['core_form/encryptedpassword'], function(encryptedpassword) {
62     new encryptedpassword.EncryptedPassword("{{ id }}");
63 });
64 {{/js}}