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 core_user/edit_profile_fields
20 UI for editing profile fields
22 Example context (json):
24 "baseurl": "index.php",
31 {"id": 1, "name": "Field1", "isfirst": true, "islast": false},
32 {"id": 2, "name": "Field2", "isfirst": false, "islast": false},
33 {"id": 3, "name": "Field3", "isfirst": false, "islast": true}
54 <div class="row profileeditor">
55 <div class="col align-self-end">
56 <a tabindex="0" role="button" class="btn btn-secondary float-right" data-action="editcategory">{{#str}}profilecreatecategory, admin{{/str}}</a>
60 <div class="categorieslist">
62 <div data-category-id="{{id}}" id="category-{{id}}" class="mt-2">
63 <div class="row justify-content-between align-items-end">
64 <div class="col-6 categoryinstance">
67 <a href="#" data-action="editcategory" data-id="{{id}}" data-name="{{name}}">
68 {{#pix}}t/edit, core, {{#str}}edit{{/str}}{{/pix}}</a>
70 <a href="{{baseurl}}?action=deletecategory&id={{id}}&sesskey={{sesskey}}">
71 {{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}</a>
74 <a href="{{baseurl}}?id={{id}}&action=movecategory&dir=up&sesskey={{sesskey}}">
75 {{#pix}}t/up, core, {{#str}}moveup{{/str}}{{/pix}}</a>
77 {{#isfirst}}{{#pix}}spacer, moodle{{/pix}}{{/isfirst}}
79 <a href="{{baseurl}}?id={{id}}&action=movecategory&dir=down&sesskey={{sesskey}}">
80 {{#pix}}t/down, core, {{#str}}movedown{{/str}}{{/pix}}</a>
84 <div class="col-auto text-right">
85 {{#addfieldmenu}}{{> core/action_menu}}{{/addfieldmenu}}
89 <table class="generaltable fullwidth profilefield">
93 <th scope="col" class="col-8">{{#str}}profilefield, admin{{/str}}</th>
94 <th scope="col" class="col-3 text-right">{{#str}}edit{{/str}}</th>
103 <td class="col-3 text-right">
104 <a href="#" data-action="editfield" data-id="{{id}}" data-name="{{name}}">
105 {{#pix}}t/edit, core, {{#str}}edit{{/str}}{{/pix}}</a>
106 <a href="{{baseurl}}?action=deletefield&id={{id}}&sesskey={{sesskey}}">
107 {{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}</a>
109 <a href="{{baseurl}}?id={{id}}&action=movefield&dir=up&sesskey={{sesskey}}">
110 {{#pix}}t/up, core, {{#str}}moveup{{/str}}{{/pix}}</a>
112 {{#isfirst}}{{#pix}}spacer, moodle{{/pix}}{{/isfirst}}
114 <a href="{{baseurl}}?id={{id}}&action=movefield&dir=down&sesskey={{sesskey}}">
115 {{#pix}}t/down, core, {{#str}}movedown{{/str}}{{/pix}}</a>
117 {{#islast}}{{#pix}}spacer, moodle{{/pix}}{{/islast}}
125 <tr class="nofields alert alert-danger alert-block fade in">
127 {{#str}}profilenofieldsdefined, admin{{/str}}
138 require(['core_user/edit_profile_fields'], function(s) {