{{! 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 . }} {{! @template core_customfield/list Moodle list template. The purpose of this template is to render a list. Classes required for JS: * none Data attributes required for JS: * data-component * data-area * data-itemid Context variables required for this template: * attributes Array of name / value pairs. Example context (json): { "component": "core_nonexisting", "area": "course", "itemid": 0, "usescategories": 1, "categories": [ { "id": "0", "nameeditable": "Other fields", "addfieldmenu": "Add field", "fields": [ { "id": 0, "name": "Field name", "shortname": "shortname", "type": "Text" }, { "id": 0, "name": "Another field", "shortname": "checkme", "type": "Checkbox" } ] }, { "id": "00", "nameeditable": "Empty category", "addfieldmenu": "Add field", "fields": [] } ], "singleselect" : "select" } }} {{{alert}}}
{{#usescategories}} {{#str}}addnewcategory, core_customfield{{/str}} {{/usescategories}}
{{^categories}} {{{nocategories}}} {{/categories}}
{{#categories}}
{{#usescategories}}

{{> core/drag_handle}}{{{nameeditable}}} {{#pix}} t/delete, core, {{#str}} delete, moodle {{/str}} {{/pix}}

{{/usescategories}}
{{{addfieldmenu}}}
{{#fields}} {{/fields}} {{^fields}} {{/fields}}
{{#str}} customfield, core_customfield {{/str}} {{#str}} shortname, core_customfield {{/str}} {{#str}} type, core_customfield {{/str}} {{#str}} action, core_customfield {{/str}}
{{> core/drag_handle}}{{{name}}} {{{shortname}}} {{{type}}} {{#pix}} t/edit, core, {{#str}} edit, moodle {{/str}} {{/pix}} {{#pix}} t/delete, core, {{#str}} delete, moodle {{/str}} {{/pix}}
{{# str }} therearenofields, core_customfield {{/ str }}
{{/categories}}
{{#js}} require(['core_customfield/form'], function(s) { s.init(); }); {{/js}}