From 56cc669c3992213626b9765be91fc5cc76bc6378 Mon Sep 17 00:00:00 2001 From: Mathew May Date: Fri, 22 Feb 2019 15:25:12 +0800 Subject: [PATCH] MDL-58428 theme: Move templates from admin --- admin/templates/setting.mustache | 43 +++-------- .../setting_configcolourpicker.mustache | 25 ++----- .../templates/setting_configduration.mustache | 37 ++++------ admin/templates/setting_configfile.mustache | 46 ++++-------- .../setting_configmultiselect.mustache | 24 ++----- ...etting_configmultiselect_optgroup.mustache | 51 +++---------- admin/templates/setting_configselect.mustache | 24 ++----- .../setting_configselect_optgroup.mustache | 42 ++--------- admin/templates/setting_configtext.mustache | 27 ++----- .../templates/setting_configtextarea.mustache | 26 ++----- admin/templates/setting_configtime.mustache | 55 +++++--------- .../setting_courselist_frontpage.mustache | 27 ++----- admin/templates/setting_description.mustache | 11 +-- .../setting_devicedetectregex.mustache | 23 ++---- admin/templates/setting_emoticons.mustache | 22 ++---- .../templates/setting_gradecat_combo.mustache | 27 ++----- admin/templates/settings.mustache | 32 +++------ .../settings_search_results.mustache | 6 +- .../setting_configduration.mustache | 31 -------- .../core_admin/setting_configfile.mustache | 33 --------- ...etting_configmultiselect_optgroup.mustache | 35 --------- .../core_admin/setting_configtime.mustache | 36 ---------- .../templates/core_admin/setting.mustache | 40 +++++++++-- .../setting_configcolourpicker.mustache | 22 +++++- .../setting_configduration.mustache} | 24 ++++++- .../core_admin/setting_configfile.mustache | 52 ++++++++++++++ .../setting_configmultiselect.mustache | 21 +++++- ...etting_configmultiselect_optgroup.mustache | 71 +++++++++++++++++++ .../core_admin/setting_configselect.mustache} | 29 +++++--- .../setting_configselect_optgroup.mustache | 68 ++++++++++++++++++ .../core_admin/setting_configtext.mustache | 24 ++++++- .../setting_configtextarea.mustache | 23 +++++- .../core_admin/setting_configtime.mustache | 56 +++++++++++++++ .../setting_courselist_frontpage.mustache | 24 ++++++- .../core_admin/setting_description.mustache | 11 ++- .../setting_devicedetectregex.mustache | 20 ++++-- .../core_admin/setting_emoticons.mustache | 19 ++++- .../setting_gradecat_combo.mustache | 24 ++++++- .../templates/core_admin/settings.mustache | 29 ++++++-- .../settings_search_results.mustache | 6 +- 40 files changed, 631 insertions(+), 615 deletions(-) delete mode 100644 theme/boost/templates/core_admin/setting_configduration.mustache delete mode 100644 theme/boost/templates/core_admin/setting_configfile.mustache delete mode 100644 theme/boost/templates/core_admin/setting_configmultiselect_optgroup.mustache delete mode 100644 theme/boost/templates/core_admin/setting_configtime.mustache rename theme/{boost => bootstrapbase}/templates/core_admin/setting.mustache (53%) rename theme/{boost => bootstrapbase}/templates/core_admin/setting_configcolourpicker.mustache (67%) rename theme/{boost/templates/core_admin/setting_configselect.mustache => bootstrapbase/templates/core_admin/setting_configduration.mustache} (53%) create mode 100644 theme/bootstrapbase/templates/core_admin/setting_configfile.mustache rename theme/{boost => bootstrapbase}/templates/core_admin/setting_configmultiselect.mustache (60%) create mode 100644 theme/bootstrapbase/templates/core_admin/setting_configmultiselect_optgroup.mustache rename theme/{boost/templates/core_admin/setting_configselect_optgroup.mustache => bootstrapbase/templates/core_admin/setting_configselect.mustache} (62%) create mode 100644 theme/bootstrapbase/templates/core_admin/setting_configselect_optgroup.mustache rename theme/{boost => bootstrapbase}/templates/core_admin/setting_configtext.mustache (52%) rename theme/{boost => bootstrapbase}/templates/core_admin/setting_configtextarea.mustache (56%) create mode 100644 theme/bootstrapbase/templates/core_admin/setting_configtime.mustache rename theme/{boost => bootstrapbase}/templates/core_admin/setting_courselist_frontpage.mustache (57%) rename theme/{boost => bootstrapbase}/templates/core_admin/setting_description.mustache (85%) rename theme/{boost => bootstrapbase}/templates/core_admin/setting_devicedetectregex.mustache (69%) rename theme/{boost => bootstrapbase}/templates/core_admin/setting_emoticons.mustache (80%) rename theme/{boost => bootstrapbase}/templates/core_admin/setting_gradecat_combo.mustache (69%) rename theme/{boost => bootstrapbase}/templates/core_admin/settings.mustache (62%) rename theme/{boost => bootstrapbase}/templates/core_admin/settings_search_results.mustache (91%) diff --git a/admin/templates/setting.mustache b/admin/templates/setting.mustache index 9881bbccc02..f7f2c568e40 100644 --- a/admin/templates/setting.mustache +++ b/admin/templates/setting.mustache @@ -13,34 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting - - Admin setting template. - - Context variables required for this template: - * labelfor - id of the form element - * title - Setting title - * override - Overridden message - * warning - Warning message - * name - Setting name - * error - Error message - * element - The Element HTML - * forceltr - Force this element to be displayed LTR - * default - Default value - - Example context (json): - { - "title": "Setting title", - "labelfor": "id0", - "override": "Overidden", - "warning": "Warning", - "name": "Name", - "error": "Error", - "element": "Raw HTML", - "forceltr": false, - "default": "Default value" - } }} {{! @template core_admin/setting @@ -71,8 +43,11 @@ "default": "Default value" } }} -
-
+{{! + Setting. +}} +
+
- {{{name}}} + {{{name}}}
-
+
{{#error}}
{{error}}
{{/error}} {{{element}}} {{#default}} -
{{{default}}}
+
{{{default}}}
{{/default}} +
{{{description}}}
-
{{{description}}}
diff --git a/admin/templates/setting_configcolourpicker.mustache b/admin/templates/setting_configcolourpicker.mustache index c1503f8d17a..3de5aac311d 100644 --- a/admin/templates/setting_configcolourpicker.mustache +++ b/admin/templates/setting_configcolourpicker.mustache @@ -13,26 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_configcolourpicker - - Admin setting colour picker template. - - Context variables required for this template: - * icon - optional icon context (see pix_icon) - * name - element name - * id - element id - * value - element value - * haspreviewconfig - show preview of selected color - - Example context (json): - { - "icon": false, - "name": "name0", - "id": "id0", - "value": "#555655", - "haspreviewconfig": false - } }} {{! @template core_admin/setting_configcolourpicker @@ -55,13 +35,16 @@ "haspreviewconfig": false } }} +{{! + Setting configcolourpicker. +}}
{{#icon}} {{>core/pix_icon}} {{/icon}}
- + {{#haspreviewconfig}} {{/haspreviewconfig}} diff --git a/admin/templates/setting_configduration.mustache b/admin/templates/setting_configduration.mustache index bc66bbe8145..d2faa4ae953 100644 --- a/admin/templates/setting_configduration.mustache +++ b/admin/templates/setting_configduration.mustache @@ -13,24 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_configduration - - Admin duration setting template. - - Context variables required for this template: - * name - form element name - * options - list of options for units containing name, value, selected - * value - yes - * id - element id - - Example context (json): - { - "name": "test", - "value": "5", - "id": "test0", - "options": [ { "name": "Minutes", "value": "mins", "selected": true } ] - } }} {{! @template core_admin/setting_configduration @@ -51,13 +33,18 @@ "options": [ { "name": "Minutes", "value": "mins", "selected": true } ] } }} +{{! + Setting configduration. +}}
- - - +
+ + + +
diff --git a/admin/templates/setting_configfile.mustache b/admin/templates/setting_configfile.mustache index b7d71cb9ad9..1f0b5d5d6b8 100644 --- a/admin/templates/setting_configfile.mustache +++ b/admin/templates/setting_configfile.mustache @@ -13,29 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_configfile - - Admin file setting template. - - Context variables required for this template: - * name - form element name - * id - element id - * size - size of the field - * readonly - Make the field readonly - * value - value - * showvalidity - Show a green check if the path is readable - * valid - True if the path is readable - - Example context (json): - { - "name": "test", - "value": "/my-super-secret-path/file", - "id": "test0", - "readonly": true, - "showvalidity": true, - "valid": false - } }} {{! @template core_admin/setting_configfile @@ -61,15 +38,20 @@ "valid": false } }} +{{! + Setting configfile. +}}
- - {{#showvalidity}} - {{#valid}} - - {{/valid}} - {{^valid}} - - {{/valid}} - {{/showvalidity}} +
+ + {{#showvalidity}} + {{#valid}} + + {{/valid}} + {{^valid}} + + {{/valid}} + {{/showvalidity}} +
diff --git a/admin/templates/setting_configmultiselect.mustache b/admin/templates/setting_configmultiselect.mustache index ce866e9abed..49eb55c1e74 100644 --- a/admin/templates/setting_configmultiselect.mustache +++ b/admin/templates/setting_configmultiselect.mustache @@ -13,25 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_configmultiselect - - Admin multiselect setting template. - - Context variables required for this template: - * name - form element name - * id - element id - * size - element size - * options - list of options containing name, value, selected - - Example context (json): - { - "name": "test", - "id": "test0", - "size": "3", - "options": [ { "name": "Option 1", "value": "V", "selected": true }, - { "name": "Option 2", "value": "V", "selected": true } ] - } }} {{! @template core_admin/setting_configmultiselect @@ -53,9 +34,12 @@ { "name": "Option 2", "value": "V", "selected": true } ] } }} +{{! + Setting configmultiselect. +}}
- {{#options}} {{/options}} diff --git a/admin/templates/setting_configmultiselect_optgroup.mustache b/admin/templates/setting_configmultiselect_optgroup.mustache index cff46fdab77..20d66e1226c 100644 --- a/admin/templates/setting_configmultiselect_optgroup.mustache +++ b/admin/templates/setting_configmultiselect_optgroup.mustache @@ -13,44 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_configmultiselect_optgroup - - Admin multiselect setting template with optgroup support. - - Context variables required for this template: - * name - form element name - * id - element id - * size - element size - * options - list of options not grouped - * optgroups - list of options grouped containing the group label and for each option: name, value, selected - - Example context (json): - { - "name": "test", - "id": "test0", - "size": "3", - "options": [ - { "name": "Option 1", "value": "V", "selected": false }, - { "name": "Option 2", "value": "V", "selected": true } - ], - "optgroups": [ - { - "label": "Group 1", - "options": [ - { "name": "Option 3", "value": "V", "selected": false }, - { "name": "Option 4", "value": "V", "selected": true } - ] - }, - { - "label": "Group 2", - "options": [ - { "name": "Option 5", "value": "V", "selected": false }, - { "name": "Option 6", "value": "V", "selected": true } - ] - } - ] - } }} {{! @template core_admin/setting_configmultiselect_optgroup @@ -91,13 +53,16 @@ ] } }} +{{! + Setting configmultiselect with optgroup support. +}}
- + {{#options}} + + {{/options}} + {{#optgroups}} {{#options}} diff --git a/admin/templates/setting_configselect.mustache b/admin/templates/setting_configselect.mustache index 18e92136941..9b6c6e1f793 100644 --- a/admin/templates/setting_configselect.mustache +++ b/admin/templates/setting_configselect.mustache @@ -13,25 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_configselect - - Admin select setting template. - - Context variables required for this template: - * name - form element name - * id - element id - * options - list of options containing name, value, selected - - Example context (json): - { - "name": "test", - "id": "test0", - "options": [ - { "name": "Option 1", "value": "V", "selected": true }, - { "name": "Option 2", "value": "V", "selected": true } - ] - } }} {{! @template core_admin/setting_configselect @@ -53,8 +34,11 @@ ] } }} +{{! + Setting configselect. +}}
- {{#options}} {{/options}} diff --git a/admin/templates/setting_configselect_optgroup.mustache b/admin/templates/setting_configselect_optgroup.mustache index aeb794bf7bd..95f818baa7e 100644 --- a/admin/templates/setting_configselect_optgroup.mustache +++ b/admin/templates/setting_configselect_optgroup.mustache @@ -13,42 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_configselect_optgroup - - Admin select with optgroup setting template. - - Context variables required for this template: - * name - form element name - * id - element id - * options - list of options (not grouped) - * optgroups - list of options grouped containing the group label and for each option: name, value, selected - - Example context (json): - { - "name": "test", - "id": "test0", - "options": [ - { "name": "Option 1", "value": "V", "selected": false }, - { "name": "Option 2", "value": "V", "selected": false } - ], - "optgroups": [ - { - "label": "Group 1", - "options": [ - { "name": "Option 3", "value": "V", "selected": true }, - { "name": "Option 4", "value": "V", "selected": false } - ] - }, - { - "label": "Group 2", - "options": [ - { "name": "Option 5", "value": "V", "selected": false }, - { "name": "Option 6", "value": "V", "selected": false } - ] - } - ] - } }} {{! @template core_admin/setting_configselect_optgroup @@ -87,8 +51,11 @@ ] } }} +{{! + Setting configselect with optgroup support. +}}
- {{#options}} {{/options}} @@ -102,3 +69,4 @@
+ diff --git a/admin/templates/setting_configtext.mustache b/admin/templates/setting_configtext.mustache index b41893c93c7..a31f73a3355 100644 --- a/admin/templates/setting_configtext.mustache +++ b/admin/templates/setting_configtext.mustache @@ -13,28 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_configtext - - Admin text setting template. - - Context variables required for this template: - * name - form element name - * id - element id - * value - element value - * size - element size - * forceltr - always display as ltr - * attributes - list of additional attributes containing name, value - - Example context (json): - { - "name": "test", - "id": "test0", - "value": "A tall, dark stranger will have more fun than you.", - "size": "21", - "forceltr": false, - "attributes": [ { "name": "readonly", "value": "readonly" } ] - } }} {{! @template core_admin/setting_configtext @@ -59,6 +37,9 @@ "attributes": [ { "name": "readonly", "value": "readonly" } ] } }} +{{! + Setting configtext. +}}
- +
diff --git a/admin/templates/setting_configtextarea.mustache b/admin/templates/setting_configtextarea.mustache index 1eee2ffcf95..002b0cd7e2d 100644 --- a/admin/templates/setting_configtextarea.mustache +++ b/admin/templates/setting_configtextarea.mustache @@ -13,27 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_configtextarea - - Admin textarea setting template. - - Context variables required for this template: - * name - form element name - * id - element id - * rows - number of rows - * cols - number of cols - * value - default value - * forceltr - always display as ltr - - Example context (json): - { - "name": "test", - "cols": "30", - "rows": "3", - "value": "Excellent day for putting Slinkies on an escalator.", - "id": "test0" - } }} {{! @template core_admin/setting_configtextarea @@ -57,6 +36,9 @@ "id": "test0" } }} +{{! + Setting configtextarea. +}}
- +
diff --git a/admin/templates/setting_configtime.mustache b/admin/templates/setting_configtime.mustache index 69c5a79d22f..90d37b325d5 100644 --- a/admin/templates/setting_configtime.mustache +++ b/admin/templates/setting_configtime.mustache @@ -13,30 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_configtime - - Admin time setting template. - - Context variables required for this template: - * name - form element name - * id - element id - * hours - list of valid hour options containing name, value, selected - * minutes - list of valid minute options containing name, value, selected - - Example context (json): - { - "name": "test", - "id": "test0", - "minutes": [ - { "name": "00", "value": "0", "selected": true }, - { "name": "01", "value": "1", "selected": false } - ], - "hours": [ - { "name": "1", "value": "1", "selected": true }, - { "name": "2", "value": "2", "selected": false } - ] - } }} {{! @template core_admin/setting_configtime @@ -63,18 +39,23 @@ ] } }} -
- - : - - +{{! + Setting configtime. +}} +
+
+ + : + + +
diff --git a/admin/templates/setting_courselist_frontpage.mustache b/admin/templates/setting_courselist_frontpage.mustache index 3a3603054a4..ef89725be44 100644 --- a/admin/templates/setting_courselist_frontpage.mustache +++ b/admin/templates/setting_courselist_frontpage.mustache @@ -13,28 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_courselist_frontpage - - Admin courselist_frontpage setting template. - - Context variables required for this template: - * selects list of select objects containing id, name, key and options. - options is another nested list of items containing name, value and selected - - Example context (json): - { - "selects": [ - { - "id": "i1", - "name": "s1", - "key": "k1", - "options": [ - { "name": "Fish", "value": "snapper", "selected": true } - ] - } - ] - } }} {{! @template core_admin/setting_courselist_frontpage @@ -59,9 +37,12 @@ ] } }} +{{! + Setting courselist_frontpage. +}}
{{#selects}} - {{#options}} {{/options}} diff --git a/admin/templates/setting_description.mustache b/admin/templates/setting_description.mustache index c6d0e57b1b2..09bda33e17b 100644 --- a/admin/templates/setting_description.mustache +++ b/admin/templates/setting_description.mustache @@ -34,12 +34,13 @@ {{! Setting description. }} -
-
+
+
- {{{name}}}
-
{{{description}}}
-
\ No newline at end of file +
+
{{{description}}}
+
+
diff --git a/admin/templates/setting_devicedetectregex.mustache b/admin/templates/setting_devicedetectregex.mustache index e4bea2317d6..97f97f250ef 100644 --- a/admin/templates/setting_devicedetectregex.mustache +++ b/admin/templates/setting_devicedetectregex.mustache @@ -13,20 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_devicedetectregex - - Admin devicedetectregex setting template. - - Context variables required for this template: - * expressions - List of expressions containing index, name, expression and value - - Example context (json): - { - "expressions": [ - { "index": "i1", "name": "Name", "expression": "/bird|yellow/", "value": "Canary" } - ] - } }} {{! @template core_admin/setting_devicedetectregex @@ -43,7 +29,10 @@ ] } }} - +{{! + Setting devicedetectregex. +}} +
@@ -54,10 +43,10 @@ {{#expressions}} {{/expressions}} diff --git a/admin/templates/setting_emoticons.mustache b/admin/templates/setting_emoticons.mustache index 072e1a7c1d4..8a245ddcbbd 100644 --- a/admin/templates/setting_emoticons.mustache +++ b/admin/templates/setting_emoticons.mustache @@ -13,23 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_emoticons - - Admin emoticons setting template. - - Context variables required for this template: - * name - form element name - * id - element id - - Example context (json): - { - "emoticons": [ - { "fields": [ - { "name": "Smile", "field": "f1", "value": ":)" } - ]} - ] - } }} {{! @template core_admin/setting_emoticons @@ -49,6 +32,9 @@ ] } }} +{{! + Setting emoticons. +}}
{{#str}}devicedetectregexexpression, admin{{/str}}
- + - +
@@ -65,7 +51,7 @@ {{#fields}} {{/fields}}
- + diff --git a/admin/templates/setting_gradecat_combo.mustache b/admin/templates/setting_gradecat_combo.mustache index d2ab931094d..9e71c27f29b 100644 --- a/admin/templates/setting_gradecat_combo.mustache +++ b/admin/templates/setting_gradecat_combo.mustache @@ -13,28 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/setting_gradecat_combo - - Admin gradecat_combo setting template. - - Context variables required for this template: - * name - form element name - * id - element id - * options - list of options containing name, value and selected - * forced - is it forced - * advanced - is it advanced - - Example context (json): - { - "name": "test", - "id": "test0", - "options": [ - { "name": "Option name", "value": "Value", "selected": true } - ], - "forced": true, - "advanced": true - } }} {{! @template core_admin/setting_gradecat_combo @@ -59,8 +37,11 @@ "advanced": true } }} +{{! + Setting configselect. +}}
- {{#options}} {{/options}} diff --git a/admin/templates/settings.mustache b/admin/templates/settings.mustache index b8694e8512c..0067f8e4564 100644 --- a/admin/templates/settings.mustache +++ b/admin/templates/settings.mustache @@ -13,27 +13,6 @@ You should have received a copy of the GNU General Public License along with Moodle. If not, see . -}}{{! - @template core_admin/settings - - Admin settings form template. - - Context variables required for this template: - * actionurl - url to submit to - * params - list of parameters containing name and value - * return - page to return to - * title - form title - * settings - raw html for settings - * showsave - true if we need save buttons - - Example context (json): - { - "actionurl": "/", - "return": "/", - "title": "Settings Form", - "settings": "RAW HTML", - "showsave": true - } }} {{! @template core_admin/settings @@ -57,8 +36,11 @@ "showsave": true } }} +{{! + Settings. +}}
-
+
{{#params}} @@ -70,8 +52,10 @@ {{/title}} {{{settings}}} {{#showsave}} -
- +
+
+ +
{{/showsave}}
diff --git a/admin/templates/settings_search_results.mustache b/admin/templates/settings_search_results.mustache index df82b0ff616..66531548b66 100644 --- a/admin/templates/settings_search_results.mustache +++ b/admin/templates/settings_search_results.mustache @@ -58,8 +58,10 @@ {{/results}} {{#showsave}} -
- +
+
+ +
{{/showsave}} {{/hasresults}} diff --git a/theme/boost/templates/core_admin/setting_configduration.mustache b/theme/boost/templates/core_admin/setting_configduration.mustache deleted file mode 100644 index 50c355d267f..00000000000 --- a/theme/boost/templates/core_admin/setting_configduration.mustache +++ /dev/null @@ -1,31 +0,0 @@ -{{! - 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 . -}} -{{! - Setting configduration. -}} -
-
- - - -
-
- diff --git a/theme/boost/templates/core_admin/setting_configfile.mustache b/theme/boost/templates/core_admin/setting_configfile.mustache deleted file mode 100644 index d382a8a6af4..00000000000 --- a/theme/boost/templates/core_admin/setting_configfile.mustache +++ /dev/null @@ -1,33 +0,0 @@ -{{! - 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 . -}} -{{! - Setting configfile. -}} -
-
- - {{#showvalidity}} - {{#valid}} - - {{/valid}} - {{^valid}} - - {{/valid}} - {{/showvalidity}} -
-
- diff --git a/theme/boost/templates/core_admin/setting_configmultiselect_optgroup.mustache b/theme/boost/templates/core_admin/setting_configmultiselect_optgroup.mustache deleted file mode 100644 index 6398e7550c1..00000000000 --- a/theme/boost/templates/core_admin/setting_configmultiselect_optgroup.mustache +++ /dev/null @@ -1,35 +0,0 @@ -{{! - 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 . -}} -{{! - Setting configmultiselect with optgroup support. -}} -
- - -
- diff --git a/theme/boost/templates/core_admin/setting_configtime.mustache b/theme/boost/templates/core_admin/setting_configtime.mustache deleted file mode 100644 index b8e966649b1..00000000000 --- a/theme/boost/templates/core_admin/setting_configtime.mustache +++ /dev/null @@ -1,36 +0,0 @@ -{{! - 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 . -}} -{{! - Setting configtime. -}} -
-
- - : - - -
-
- diff --git a/theme/boost/templates/core_admin/setting.mustache b/theme/bootstrapbase/templates/core_admin/setting.mustache similarity index 53% rename from theme/boost/templates/core_admin/setting.mustache rename to theme/bootstrapbase/templates/core_admin/setting.mustache index 32151be80e0..ed172466eba 100644 --- a/theme/boost/templates/core_admin/setting.mustache +++ b/theme/bootstrapbase/templates/core_admin/setting.mustache @@ -15,10 +15,36 @@ along with Moodle. If not, see . }} {{! - Setting. + @template core_admin/setting + + Admin setting template. + + Context variables required for this template: + * labelfor - id of the form element + * title - Setting title + * override - Overridden message + * warning - Warning message + * name - Setting name + * error - Error message + * element - The Element HTML + * forceltr - Force this element to be displayed LTR + * default - Default value + + Example context (json): + { + "title": "Setting title", + "labelfor": "id0", + "override": "Overidden", + "warning": "Warning", + "name": "Name", + "error": "Error", + "element": "Raw HTML", + "forceltr": false, + "default": "Default value" + } }} -
-
+
+
- {{{name}}} + {{{name}}}
-
+
{{#error}}
{{error}}
{{/error}} {{{element}}} {{#default}} -
{{{default}}}
+
{{{default}}}
{{/default}} -
{{{description}}}
+
{{{description}}}
diff --git a/theme/boost/templates/core_admin/setting_configcolourpicker.mustache b/theme/bootstrapbase/templates/core_admin/setting_configcolourpicker.mustache similarity index 67% rename from theme/boost/templates/core_admin/setting_configcolourpicker.mustache rename to theme/bootstrapbase/templates/core_admin/setting_configcolourpicker.mustache index a93872154a1..eb8c4877db4 100644 --- a/theme/boost/templates/core_admin/setting_configcolourpicker.mustache +++ b/theme/bootstrapbase/templates/core_admin/setting_configcolourpicker.mustache @@ -15,7 +15,25 @@ along with Moodle. If not, see . }} {{! - Setting configcolourpicker. + @template core_admin/setting_configcolourpicker + + Admin setting colour picker template. + + Context variables required for this template: + * icon - optional icon context (see pix_icon) + * name - element name + * id - element id + * value - element value + * haspreviewconfig - show preview of selected color + + Example context (json): + { + "icon": false, + "name": "name0", + "id": "id0", + "value": "#555655", + "haspreviewconfig": false + } }}
@@ -23,7 +41,7 @@ {{>core/pix_icon}} {{/icon}}
- + {{#haspreviewconfig}} {{/haspreviewconfig}} diff --git a/theme/boost/templates/core_admin/setting_configselect.mustache b/theme/bootstrapbase/templates/core_admin/setting_configduration.mustache similarity index 53% rename from theme/boost/templates/core_admin/setting_configselect.mustache rename to theme/bootstrapbase/templates/core_admin/setting_configduration.mustache index 0f5c8ed9d8e..3bad98c30da 100644 --- a/theme/boost/templates/core_admin/setting_configselect.mustache +++ b/theme/bootstrapbase/templates/core_admin/setting_configduration.mustache @@ -15,10 +15,28 @@ along with Moodle. If not, see . }} {{! - Setting configselect. + @template core_admin/setting_configduration + + Admin duration setting template. + + Context variables required for this template: + * name - form element name + * options - list of options for units containing name, value, selected + * value - yes + * id - element id + + Example context (json): + { + "name": "test", + "value": "5", + "id": "test0", + "options": [ { "name": "Minutes", "value": "mins", "selected": true } ] + } }} -
- + + + {{#showvalidity}} + {{#valid}} + + {{/valid}} + {{^valid}} + + {{/valid}} + {{/showvalidity}} +
+ diff --git a/theme/boost/templates/core_admin/setting_configmultiselect.mustache b/theme/bootstrapbase/templates/core_admin/setting_configmultiselect.mustache similarity index 60% rename from theme/boost/templates/core_admin/setting_configmultiselect.mustache rename to theme/bootstrapbase/templates/core_admin/setting_configmultiselect.mustache index 149f16b0c67..7465a7ba0b6 100644 --- a/theme/boost/templates/core_admin/setting_configmultiselect.mustache +++ b/theme/bootstrapbase/templates/core_admin/setting_configmultiselect.mustache @@ -15,11 +15,28 @@ along with Moodle. If not, see . }} {{! - Setting configmultiselect. + @template core_admin/setting_configmultiselect + + Admin multiselect setting template. + + Context variables required for this template: + * name - form element name + * id - element id + * size - element size + * options - list of options containing name, value, selected + + Example context (json): + { + "name": "test", + "id": "test0", + "size": "3", + "options": [ { "name": "Option 1", "value": "V", "selected": true }, + { "name": "Option 2", "value": "V", "selected": true } ] + } }}
- {{#options}} {{/options}} diff --git a/theme/bootstrapbase/templates/core_admin/setting_configmultiselect_optgroup.mustache b/theme/bootstrapbase/templates/core_admin/setting_configmultiselect_optgroup.mustache new file mode 100644 index 00000000000..9fa61c54707 --- /dev/null +++ b/theme/bootstrapbase/templates/core_admin/setting_configmultiselect_optgroup.mustache @@ -0,0 +1,71 @@ +{{! + 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_admin/setting_configmultiselect_optgroup + + Admin multiselect setting template with optgroup support. + + Context variables required for this template: + * name - form element name + * id - element id + * size - element size + * options - list of options not grouped + * optgroups - list of options grouped containing the group label and for each option: name, value, selected + + Example context (json): + { + "name": "test", + "id": "test0", + "size": "3", + "options": [ + { "name": "Option 1", "value": "V", "selected": false }, + { "name": "Option 2", "value": "V", "selected": true } + ], + "optgroups": [ + { + "label": "Group 1", + "options": [ + { "name": "Option 3", "value": "V", "selected": false }, + { "name": "Option 4", "value": "V", "selected": true } + ] + }, + { + "label": "Group 2", + "options": [ + { "name": "Option 5", "value": "V", "selected": false }, + { "name": "Option 6", "value": "V", "selected": true } + ] + } + ] + } +}} +
+ + +
+ diff --git a/theme/boost/templates/core_admin/setting_configselect_optgroup.mustache b/theme/bootstrapbase/templates/core_admin/setting_configselect.mustache similarity index 62% rename from theme/boost/templates/core_admin/setting_configselect_optgroup.mustache rename to theme/bootstrapbase/templates/core_admin/setting_configselect.mustache index 6628240653b..a90c260add8 100644 --- a/theme/boost/templates/core_admin/setting_configselect_optgroup.mustache +++ b/theme/bootstrapbase/templates/core_admin/setting_configselect.mustache @@ -15,21 +15,30 @@ along with Moodle. If not, see . }} {{! - Setting configselect with optgroup support. + @template core_admin/setting_configselect + + Admin select setting template. + + Context variables required for this template: + * name - form element name + * id - element id + * options - list of options containing name, value, selected + + Example context (json): + { + "name": "test", + "id": "test0", + "options": [ + { "name": "Option 1", "value": "V", "selected": true }, + { "name": "Option 2", "value": "V", "selected": true } + ] + } }}
- {{#options}} {{/options}} - {{#optgroups}} - - {{#options}} - - {{/options}} - - {{/optgroups}}
- diff --git a/theme/bootstrapbase/templates/core_admin/setting_configselect_optgroup.mustache b/theme/bootstrapbase/templates/core_admin/setting_configselect_optgroup.mustache new file mode 100644 index 00000000000..ea5da127de6 --- /dev/null +++ b/theme/bootstrapbase/templates/core_admin/setting_configselect_optgroup.mustache @@ -0,0 +1,68 @@ +{{! + 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_admin/setting_configselect_optgroup + + Admin select with optgroup setting template. + + Context variables required for this template: + * name - form element name + * id - element id + * options - list of options (not grouped) + * optgroups - list of options grouped containing the group label and for each option: name, value, selected + + Example context (json): + { + "name": "test", + "id": "test0", + "options": [ + { "name": "Option 1", "value": "V", "selected": false }, + { "name": "Option 2", "value": "V", "selected": false } + ], + "optgroups": [ + { + "label": "Group 1", + "options": [ + { "name": "Option 3", "value": "V", "selected": true }, + { "name": "Option 4", "value": "V", "selected": false } + ] + }, + { + "label": "Group 2", + "options": [ + { "name": "Option 5", "value": "V", "selected": false }, + { "name": "Option 6", "value": "V", "selected": false } + ] + } + ] + } +}} +
+ +
+ diff --git a/theme/boost/templates/core_admin/setting_configtext.mustache b/theme/bootstrapbase/templates/core_admin/setting_configtext.mustache similarity index 52% rename from theme/boost/templates/core_admin/setting_configtext.mustache rename to theme/bootstrapbase/templates/core_admin/setting_configtext.mustache index dba4fd74093..236228a7922 100644 --- a/theme/boost/templates/core_admin/setting_configtext.mustache +++ b/theme/bootstrapbase/templates/core_admin/setting_configtext.mustache @@ -15,8 +15,28 @@ along with Moodle. If not, see . }} {{! - Setting configtext. + @template core_admin/setting_configtext + + Admin text setting template. + + Context variables required for this template: + * name - form element name + * id - element id + * value - element value + * size - element size + * forceltr - always display as ltr + * attributes - list of additional attributes containing name, value + + Example context (json): + { + "name": "test", + "id": "test0", + "value": "A tall, dark stranger will have more fun than you.", + "size": "21", + "forceltr": false, + "attributes": [ { "name": "readonly", "value": "readonly" } ] + } }}
- +
diff --git a/theme/boost/templates/core_admin/setting_configtextarea.mustache b/theme/bootstrapbase/templates/core_admin/setting_configtextarea.mustache similarity index 56% rename from theme/boost/templates/core_admin/setting_configtextarea.mustache rename to theme/bootstrapbase/templates/core_admin/setting_configtextarea.mustache index f8430b80245..ec6ded3c9bb 100644 --- a/theme/boost/templates/core_admin/setting_configtextarea.mustache +++ b/theme/bootstrapbase/templates/core_admin/setting_configtextarea.mustache @@ -15,8 +15,27 @@ along with Moodle. If not, see . }} {{! - Setting configtextarea. + @template core_admin/setting_configtextarea + + Admin textarea setting template. + + Context variables required for this template: + * name - form element name + * id - element id + * rows - number of rows + * cols - number of cols + * value - default value + * forceltr - always display as ltr + + Example context (json): + { + "name": "test", + "cols": "30", + "rows": "3", + "value": "Excellent day for putting Slinkies on an escalator.", + "id": "test0" + } }}
- +
diff --git a/theme/bootstrapbase/templates/core_admin/setting_configtime.mustache b/theme/bootstrapbase/templates/core_admin/setting_configtime.mustache new file mode 100644 index 00000000000..b86b691d16a --- /dev/null +++ b/theme/bootstrapbase/templates/core_admin/setting_configtime.mustache @@ -0,0 +1,56 @@ +{{! + 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_admin/setting_configtime + + Admin time setting template. + + Context variables required for this template: + * name - form element name + * id - element id + * hours - list of valid hour options containing name, value, selected + * minutes - list of valid minute options containing name, value, selected + + Example context (json): + { + "name": "test", + "id": "test0", + "minutes": [ + { "name": "00", "value": "0", "selected": true }, + { "name": "01", "value": "1", "selected": false } + ], + "hours": [ + { "name": "1", "value": "1", "selected": true }, + { "name": "2", "value": "2", "selected": false } + ] + } +}} +
+ + : + + +
+ diff --git a/theme/boost/templates/core_admin/setting_courselist_frontpage.mustache b/theme/bootstrapbase/templates/core_admin/setting_courselist_frontpage.mustache similarity index 57% rename from theme/boost/templates/core_admin/setting_courselist_frontpage.mustache rename to theme/bootstrapbase/templates/core_admin/setting_courselist_frontpage.mustache index de5d3421a51..2fe18cc1028 100644 --- a/theme/boost/templates/core_admin/setting_courselist_frontpage.mustache +++ b/theme/bootstrapbase/templates/core_admin/setting_courselist_frontpage.mustache @@ -15,11 +15,31 @@ along with Moodle. If not, see . }} {{! - Setting courselist_frontpage. + @template core_admin/setting_courselist_frontpage + + Admin courselist_frontpage setting template. + + Context variables required for this template: + * selects list of select objects containing id, name, key and options. + options is another nested list of items containing name, value and selected + + Example context (json): + { + "selects": [ + { + "id": "i1", + "name": "s1", + "key": "k1", + "options": [ + { "name": "Fish", "value": "snapper", "selected": true } + ] + } + ] + } }}
{{#selects}} - {{#options}} {{/options}} diff --git a/theme/boost/templates/core_admin/setting_description.mustache b/theme/bootstrapbase/templates/core_admin/setting_description.mustache similarity index 85% rename from theme/boost/templates/core_admin/setting_description.mustache rename to theme/bootstrapbase/templates/core_admin/setting_description.mustache index 09bda33e17b..c6d0e57b1b2 100644 --- a/theme/boost/templates/core_admin/setting_description.mustache +++ b/theme/bootstrapbase/templates/core_admin/setting_description.mustache @@ -34,13 +34,12 @@ {{! Setting description. }} -
-
+
+
+ {{{name}}}
-
-
{{{description}}}
-
-
+
{{{description}}}
+
\ No newline at end of file diff --git a/theme/boost/templates/core_admin/setting_devicedetectregex.mustache b/theme/bootstrapbase/templates/core_admin/setting_devicedetectregex.mustache similarity index 69% rename from theme/boost/templates/core_admin/setting_devicedetectregex.mustache rename to theme/bootstrapbase/templates/core_admin/setting_devicedetectregex.mustache index 7f3ac48a88c..cc8886288a0 100644 --- a/theme/boost/templates/core_admin/setting_devicedetectregex.mustache +++ b/theme/bootstrapbase/templates/core_admin/setting_devicedetectregex.mustache @@ -15,9 +15,21 @@ along with Moodle. If not, see . }} {{! - Setting devicedetectregex. + @template core_admin/setting_devicedetectregex + + Admin devicedetectregex setting template. + + Context variables required for this template: + * expressions - List of expressions containing index, name, expression and value + + Example context (json): + { + "expressions": [ + { "index": "i1", "name": "Name", "expression": "/bird|yellow/", "value": "Canary" } + ] + } }} - +
@@ -28,10 +40,10 @@ {{#expressions}} {{/expressions}} diff --git a/theme/boost/templates/core_admin/setting_emoticons.mustache b/theme/bootstrapbase/templates/core_admin/setting_emoticons.mustache similarity index 80% rename from theme/boost/templates/core_admin/setting_emoticons.mustache rename to theme/bootstrapbase/templates/core_admin/setting_emoticons.mustache index fe2c75c26f5..4c36174504e 100644 --- a/theme/boost/templates/core_admin/setting_emoticons.mustache +++ b/theme/bootstrapbase/templates/core_admin/setting_emoticons.mustache @@ -15,7 +15,22 @@ along with Moodle. If not, see . }} {{! - Setting emoticons. + @template core_admin/setting_emoticons + + Admin emoticons setting template. + + Context variables required for this template: + * name - form element name + * id - element id + + Example context (json): + { + "emoticons": [ + { "fields": [ + { "name": "Smile", "field": "f1", "value": ":)" } + ]} + ] + } }}
{{#str}}devicedetectregexexpression, admin{{/str}}
- + - +
@@ -33,7 +48,7 @@ {{#fields}} {{/fields}}
- + diff --git a/theme/boost/templates/core_admin/setting_gradecat_combo.mustache b/theme/bootstrapbase/templates/core_admin/setting_gradecat_combo.mustache similarity index 69% rename from theme/boost/templates/core_admin/setting_gradecat_combo.mustache rename to theme/bootstrapbase/templates/core_admin/setting_gradecat_combo.mustache index b06d29de43d..d64d75fea0d 100644 --- a/theme/boost/templates/core_admin/setting_gradecat_combo.mustache +++ b/theme/bootstrapbase/templates/core_admin/setting_gradecat_combo.mustache @@ -15,10 +15,30 @@ along with Moodle. If not, see . }} {{! - Setting configselect. + @template core_admin/setting_gradecat_combo + + Admin gradecat_combo setting template. + + Context variables required for this template: + * name - form element name + * id - element id + * options - list of options containing name, value and selected + * forced - is it forced + * advanced - is it advanced + + Example context (json): + { + "name": "test", + "id": "test0", + "options": [ + { "name": "Option name", "value": "Value", "selected": true } + ], + "forced": true, + "advanced": true + } }}
- {{#options}} {{/options}} diff --git a/theme/boost/templates/core_admin/settings.mustache b/theme/bootstrapbase/templates/core_admin/settings.mustache similarity index 62% rename from theme/boost/templates/core_admin/settings.mustache rename to theme/bootstrapbase/templates/core_admin/settings.mustache index c75925ad595..009730532f3 100644 --- a/theme/boost/templates/core_admin/settings.mustache +++ b/theme/bootstrapbase/templates/core_admin/settings.mustache @@ -15,10 +15,29 @@ along with Moodle. If not, see . }} {{! - Settings. + @template core_admin/settings + + Admin settings form template. + + Context variables required for this template: + * actionurl - url to submit to + * params - list of parameters containing name and value + * return - page to return to + * title - form title + * settings - raw html for settings + * showsave - true if we need save buttons + + Example context (json): + { + "actionurl": "/", + "return": "/", + "title": "Settings Form", + "settings": "RAW HTML", + "showsave": true + } }} -
+
{{#params}} @@ -30,10 +49,8 @@ {{/title}} {{{settings}}} {{#showsave}} -
-
- -
+
+
{{/showsave}}
diff --git a/theme/boost/templates/core_admin/settings_search_results.mustache b/theme/bootstrapbase/templates/core_admin/settings_search_results.mustache similarity index 91% rename from theme/boost/templates/core_admin/settings_search_results.mustache rename to theme/bootstrapbase/templates/core_admin/settings_search_results.mustache index 66531548b66..df82b0ff616 100644 --- a/theme/boost/templates/core_admin/settings_search_results.mustache +++ b/theme/bootstrapbase/templates/core_admin/settings_search_results.mustache @@ -58,10 +58,8 @@ {{/results}} {{#showsave}} -
-
- -
+
+
{{/showsave}} {{/hasresults}}