MDL-58428 theme: Move templates from admin
authorMathew May <mathewm@hotmail.co.nz>
Fri, 22 Feb 2019 07:25:12 +0000 (15:25 +0800)
committerSara Arjona <sara@moodle.com>
Tue, 26 Feb 2019 11:56:14 +0000 (12:56 +0100)
40 files changed:
admin/templates/setting.mustache
admin/templates/setting_configcolourpicker.mustache
admin/templates/setting_configduration.mustache
admin/templates/setting_configfile.mustache
admin/templates/setting_configmultiselect.mustache
admin/templates/setting_configmultiselect_optgroup.mustache
admin/templates/setting_configselect.mustache
admin/templates/setting_configselect_optgroup.mustache
admin/templates/setting_configtext.mustache
admin/templates/setting_configtextarea.mustache
admin/templates/setting_configtime.mustache
admin/templates/setting_courselist_frontpage.mustache
admin/templates/setting_description.mustache
admin/templates/setting_devicedetectregex.mustache
admin/templates/setting_emoticons.mustache
admin/templates/setting_gradecat_combo.mustache
admin/templates/settings.mustache
admin/templates/settings_search_results.mustache
theme/boost/templates/core_admin/setting_configduration.mustache [deleted file]
theme/boost/templates/core_admin/setting_configfile.mustache [deleted file]
theme/boost/templates/core_admin/setting_configmultiselect_optgroup.mustache [deleted file]
theme/boost/templates/core_admin/setting_configtime.mustache [deleted file]
theme/bootstrapbase/templates/core_admin/setting.mustache [moved from theme/boost/templates/core_admin/setting.mustache with 53% similarity]
theme/bootstrapbase/templates/core_admin/setting_configcolourpicker.mustache [moved from theme/boost/templates/core_admin/setting_configcolourpicker.mustache with 67% similarity]
theme/bootstrapbase/templates/core_admin/setting_configduration.mustache [moved from theme/boost/templates/core_admin/setting_configselect.mustache with 53% similarity]
theme/bootstrapbase/templates/core_admin/setting_configfile.mustache [new file with mode: 0644]
theme/bootstrapbase/templates/core_admin/setting_configmultiselect.mustache [moved from theme/boost/templates/core_admin/setting_configmultiselect.mustache with 60% similarity]
theme/bootstrapbase/templates/core_admin/setting_configmultiselect_optgroup.mustache [new file with mode: 0644]
theme/bootstrapbase/templates/core_admin/setting_configselect.mustache [moved from theme/boost/templates/core_admin/setting_configselect_optgroup.mustache with 62% similarity]
theme/bootstrapbase/templates/core_admin/setting_configselect_optgroup.mustache [new file with mode: 0644]
theme/bootstrapbase/templates/core_admin/setting_configtext.mustache [moved from theme/boost/templates/core_admin/setting_configtext.mustache with 52% similarity]
theme/bootstrapbase/templates/core_admin/setting_configtextarea.mustache [moved from theme/boost/templates/core_admin/setting_configtextarea.mustache with 56% similarity]
theme/bootstrapbase/templates/core_admin/setting_configtime.mustache [new file with mode: 0644]
theme/bootstrapbase/templates/core_admin/setting_courselist_frontpage.mustache [moved from theme/boost/templates/core_admin/setting_courselist_frontpage.mustache with 57% similarity]
theme/bootstrapbase/templates/core_admin/setting_description.mustache [moved from theme/boost/templates/core_admin/setting_description.mustache with 85% similarity]
theme/bootstrapbase/templates/core_admin/setting_devicedetectregex.mustache [moved from theme/boost/templates/core_admin/setting_devicedetectregex.mustache with 69% similarity]
theme/bootstrapbase/templates/core_admin/setting_emoticons.mustache [moved from theme/boost/templates/core_admin/setting_emoticons.mustache with 80% similarity]
theme/bootstrapbase/templates/core_admin/setting_gradecat_combo.mustache [moved from theme/boost/templates/core_admin/setting_gradecat_combo.mustache with 69% similarity]
theme/bootstrapbase/templates/core_admin/settings.mustache [moved from theme/boost/templates/core_admin/settings.mustache with 62% similarity]
theme/bootstrapbase/templates/core_admin/settings_search_results.mustache [moved from theme/boost/templates/core_admin/settings_search_results.mustache with 91% similarity]

index 9881bbc..f7f2c56 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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
         "default": "Default value"
     }
 }}
-<div class="form-item clearfix" id="{{id}}">
-    <div class="form-label">
+{{!
+    Setting.
+}}
+<div class="form-item row" id="{{id}}">
+    <div class="form-label col-sm-3 text-sm-right">
         <label {{#labelfor}}for="{{labelfor}}"{{/labelfor}}>
             {{{title}}}
             {{#override}}
                 <div class="form-warning">{{warning}}</div>
             {{/warning}}
         </label>
-        <span class="form-shortname">{{{name}}}</span>
+        <span class="form-shortname d-block small text-muted">{{{name}}}</span>
     </div>
-    <div class="form-setting">
+    <div class="form-setting col-sm-9">
         {{#error}}
             <div><span class="error">{{error}}</span></div>
         {{/error}}
         {{{element}}}
         {{#default}}
-            <div class="form-defaultinfo {{#forceltr}}text-ltr{{/forceltr}}">{{{default}}}</div>
+            <div class="form-defaultinfo text-muted {{#forceltr}}text-ltr{{/forceltr}}">{{{default}}}</div>
         {{/default}}
+        <div class="form-description mt-3">{{{description}}}</div>
     </div>
-    <div class="form-description">{{{description}}}</div>
 </div>
index c1503f8..3de5aac 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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
         "haspreviewconfig": false
     }
 }}
+{{!
+    Setting configcolourpicker.
+}}
 <div class="form-colourpicker defaultsnext">
     <div class="admin_colourpicker clearfix">
         {{#icon}}
             {{>core/pix_icon}}
         {{/icon}}
     </div>
-    <input type="text" name="{{name}}" id="{{id}}" value="{{value}}" size="12" class="text-ltr">
+    <input type="text" name="{{name}}" id="{{id}}" value="{{value}}" size="12" class="form-control text-ltr">
     {{#haspreviewconfig}}
         <input type="button" id="{{id}}_preview" value={{#quote}}{{#str}}preview{{/str}}{{/quote}} class="admin_colourpicker_preview">
     {{/haspreviewconfig}}
index bc66bbe..d2faa4a 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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
         "options": [ { "name": "Minutes", "value": "mins", "selected": true } ]
     }
 }}
+{{!
+    Setting configduration.
+}}
 <div class="form-duration defaultsnext">
-    <input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="text-ltr">
-    <label class="accesshide" for="{{id}}u">{{#str}}durationunits, admin{{/str}}</label>
-    <select id="{{id}}u" name="{{name}}[u]">
-        {{#options}}
-            <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
-        {{/options}}
-    </select>
+    <div class="form-inline">
+        <input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="form-control text-ltr">
+        <label class="sr-only" for="{{id}}u">{{#str}}durationunits, admin{{/str}}</label>
+        <select id="{{id}}u" name="{{name}}[u]" class="form-control">
+            {{#options}}
+                <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
+            {{/options}}
+        </select>
+    </div>
 </div>
 
index b7d71cb..1f0b5d5 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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
         "valid": false
     }
 }}
+{{!
+    Setting configfile.
+}}
 <div class="form-file defaultsnext">
-    <input type="text" name="{{name}}" id="{{id}}" size="{{size}}" value="{{value}}" class="text-ltr" {{#readonly}}readonly{{/readonly}}>
-    {{#showvalidity}}
-        {{#valid}}
-            <span class="pathok">&#x2714;</span>
-        {{/valid}}
-        {{^valid}}
-            <span class="patherror">&#x2718;</span>
-        {{/valid}}
-    {{/showvalidity}}
+    <div class="form-inline">
+        <input type="text" name="{{name}}" id="{{id}}" size="{{size}}" value="{{value}}" class="form-control text-ltr" {{#readonly}}readonly{{/readonly}}>
+        {{#showvalidity}}
+            {{#valid}}
+                <span class="text-success">&#x2714;</span>
+            {{/valid}}
+            {{^valid}}
+                <span class="text-danger">&#x2718;</span>
+            {{/valid}}
+        {{/showvalidity}}
+    </div>
 </div>
 
index ce866e9..49eb55c 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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
                      { "name": "Option 2", "value": "V", "selected": true } ]
     }
 }}
+{{!
+    Setting configmultiselect.
+}}
 <div class="form-select">
     <input type="hidden" name="{{name}}[xxxxx]" value="1">
-    <select id="{{id}}" name="{{name}}[]" size="{{size}}" multiple>
+    <select id="{{id}}" name="{{name}}[]" size="{{size}}" class="form-control" multiple>
         {{#options}}
             <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
         {{/options}}
index cff46fd..20d66e1 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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
         ]
     }
 }}
+{{!
+    Setting configmultiselect with optgroup support.
+}}
 <div class="form-select">
     <input type="hidden" name="{{name}}[xxxxx]" value="1">
-    <select id="{{id}}" name="{{name}}[]" size="{{size}}" multiple>
-        {{#options}}
-            <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
-        {{/options}}
-        {{#optgroups}}
+    <select id="{{id}}" name="{{name}}[]" size="{{size}}" class="form-control" multiple>
+    {{#options}}
+        <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
+    {{/options}}
+    {{#optgroups}}
             <optgroup label="{{label}}">
                 {{#options}}
                     <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
index 18e9213..9b6c6e1 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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
         ]
     }
 }}
+{{!
+    Setting configselect.
+}}
 <div class="form-select defaultsnext">
-    <select id="{{id}}" name="{{name}}">
+    <select id="{{id}}" name="{{name}}" class="custom-select">
         {{#options}}
             <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
         {{/options}}
index aeb794b..95f818b 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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
         ]
     }
 }}
+{{!
+    Setting configselect with optgroup support.
+}}
 <div class="form-select defaultsnext">
-    <select id="{{id}}" name="{{name}}">
+    <select id="{{id}}" name="{{name}}" class="custom-select">
         {{#options}}
             <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
         {{/options}}
     </select>
 </div>
 
+
index b41893c..a31f73a 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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.
+}}
 <div class="form-text defaultsnext">
-    <input type="text" name="{{name}}" value="{{value}}" size="{{size}}" id="{{id}}" class="{{#forceltr}}text-ltr{{/forceltr}}"{{#attributes}} {{name}}="{{value}}"{{/attributes}}>
+    <input type="text" name="{{name}}" value="{{value}}" size="{{size}}" id="{{id}}" class="form-control {{#forceltr}}text-ltr{{/forceltr}}">
 </div>
index 1eee2ff..002b0cd 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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.
+}}
 <div class="form-textarea">
-    <textarea rows="{{rows}}" cols="{{cols}}" id="{{id}}" name="{{name}}" spellcheck="true" class="{{#forceltr}}text-ltr{{/forceltr}}">{{value}}</textarea>
+    <textarea rows="{{rows}}" cols="{{cols}}" id="{{id}}" name="{{name}}" spellcheck="true" class="form-control {{#forceltr}}text-ltr{{/forceltr}}">{{value}}</textarea>
 </div>
index 69c5a79..90d37b3 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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
         ]
     }
 }}
-<div class="form-time defaultsnext text-ltr">
-    <label class="accesshide" for="{{id}}h">{{#str}}hours{{/str}}</label>
-    <select id="{{id}}h" name="{{name}}[h]">
-        {{#hours}}
-            <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
-        {{/hours}}
-    </select>:
-    <label class="accesshide" for="{{id}}m">{{#str}}minutes{{/str}}</label>
-    <select id="{{id}}m" name="{{name}}[m]">
-        {{#minutes}}
-            <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
-        {{/minutes}}
-    </select>
+{{!
+    Setting configtime.
+}}
+<div class="form-time defaultsnext">
+    <div class="form-inline text-ltr">
+        <label class="sr-only" for="{{id}}h">{{#str}}hours{{/str}}</label>
+        <select id="{{id}}h" name="{{name}}[h]" class="custom-select">
+            {{#hours}}
+                <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
+            {{/hours}}
+        </select>:
+        <label class="sr-only" for="{{id}}m">{{#str}}minutes{{/str}}</label>
+        <select id="{{id}}m" name="{{name}}[m]" class="custom-select">
+            {{#minutes}}
+                <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
+            {{/minutes}}
+        </select>
+    </div>
 </div>
 
index 3a36030..ef89725 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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
         ]
     }
 }}
+{{!
+    Setting courselist_frontpage.
+}}
 <div class="form-group">
     {{#selects}}
-        <select id="{{id}}{{key}}" name="{{name}}[]" class="form-select">
+        <select id="{{id}}{{key}}" name="{{name}}[]" class="custom-select">
             {{#options}}
                 <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
             {{/options}}
index c6d0e57..09bda33 100644 (file)
 {{!
     Setting description.
 }}
-<div class="form-item form-horizontal clearfix">
-    <div class="form-label">
+<div class="form-item row">
+    <div class="form-label col-sm-3 text-sm-right">
         <label>
             {{{title}}}
         </label>
-        <span class="form-shortname ">{{{name}}}</span>
     </div>
-    <div class="controls felement fstatic">{{{description}}}</div>
-</div>
\ No newline at end of file
+    <div class="form-setting col-sm-9">
+        <div class="form-description">{{{description}}}</div>
+    </div>
+</div>
index e4bea23..97f97f2 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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
         ]
     }
 }}
-<table class="generaltable">
+{{!
+    Setting devicedetectregex.
+}}
+<table class="table table-striped">
     <thead>
         <tr>
             <th>{{#str}}devicedetectregexexpression, admin{{/str}}</th>
         {{#expressions}}
             <tr>
                 <td class="c{{index}}">
-                    <input type="text" name="{{name}}[expression{{index}}]" class="form-text text-ltr" value="{{expression}}">
+                    <input type="text" name="{{name}}[expression{{index}}]" class="form-control" value="{{expression}}">
                 </td>
                 <td class="c{{index}}">
-                    <input type="text" name="{{name}}[value{{index}}]" class="form-text text-ltr" value="{{value}}">
+                    <input type="text" name="{{name}}[value{{index}}]" class="form-control" value="{{value}}">
                 </td>
             </tr>
         {{/expressions}}
index 072e1a7..8a245dd 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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.
+}}
 <div class="form-group">
     <table id="emoticonsetting" class="admintable generaltable">
         <thead>
@@ -65,7 +51,7 @@
                 <tr>
                     {{#fields}}
                         <td class="c{{index}}">
-                            <input type="text" name="{{name}}[{{field}}]" class="form-text text-ltr" value="{{value}}">
+                            <input type="text" name="{{name}}[{{field}}]" class="form-text form-control text-ltr" value="{{value}}">
                         </td>
                     {{/fields}}
                     <td>
index d2ab931..9e71c27 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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
         "advanced": true
     }
 }}
+{{!
+    Setting configselect.
+}}
 <div class="form-group">
-    <select id="{{id}}" name="{{name}}[value]" class="form-select">
+    <select id="{{id}}" name="{{name}}[value]" class="form-select custom-select">
         {{#options}}
             <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
         {{/options}}
index b8694e8..0067f8e 100644 (file)
 
     You should have received a copy of the GNU General Public License
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
-}}{{!
-    @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
         "showsave": true
     }
 }}
+{{!
+    Settings.
+}}
 <form action="{{actionurl}}" method="post" id="adminsettings">
-    <div class="settingsform clearfix">
+    <div class="settingsform">
         {{#params}}
             <input type="hidden" name="{{name}}" value="{{value}}">
             <input type="hidden" name="action" value="save-settings">
         {{/title}}
         {{{settings}}}
         {{#showsave}}
-            <div class="form-buttons">
-                <input type="submit" class="form-submit" value={{#quote}}{{#str}}savechanges, admin{{/str}}{{/quote}}>
+            <div class="row">
+                <div class="offset-sm-3 col-sm-3">
+                    <button type="submit" class="btn btn-primary">{{#str}}savechanges, admin{{/str}}</button>
+                </div>
             </div>
         {{/showsave}}
     </div>
index df82b0f..6653154 100644 (file)
                 </fieldset>
             {{/results}}
             {{#showsave}}
-                <div class="form-buttons">
-                    <input type="submit" class="form-submit" value={{#quote}}{{#str}}savechanges, admin{{/str}}{{/quote}}>
+                <div class="row">
+                    <div class="offset-sm-3 col-sm-3">
+                        <button type="submit" class="btn btn-primary">{{#str}}savechanges, admin{{/str}}</button>
+                    </div>
                 </div>
             {{/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 (file)
index 50c355d..0000000
+++ /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 <http://www.gnu.org/licenses/>.
-}}
-{{!
-    Setting configduration.
-}}
-<div class="form-duration defaultsnext">
-    <div class="form-inline">
-        <input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="form-control text-ltr">
-        <label class="sr-only" for="{{id}}u">{{#str}}durationunits, admin{{/str}}</label>
-        <select id="{{id}}u" name="{{name}}[u]" class="form-control">
-            {{#options}}
-                <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
-            {{/options}}
-        </select>
-    </div>
-</div>
-
diff --git a/theme/boost/templates/core_admin/setting_configfile.mustache b/theme/boost/templates/core_admin/setting_configfile.mustache
deleted file mode 100644 (file)
index d382a8a..0000000
+++ /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 <http://www.gnu.org/licenses/>.
-}}
-{{!
-    Setting configfile.
-}}
-<div class="form-file defaultsnext">
-    <div class="form-inline">
-        <input type="text" name="{{name}}" id="{{id}}" size="{{size}}" value="{{value}}" class="form-control text-ltr" {{#readonly}}readonly{{/readonly}}>
-        {{#showvalidity}}
-            {{#valid}}
-                <span class="text-success">&#x2714;</span>
-            {{/valid}}
-            {{^valid}}
-                <span class="text-danger">&#x2718;</span>
-            {{/valid}}
-        {{/showvalidity}}
-    </div>
-</div>
-
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 (file)
index 6398e75..0000000
+++ /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 <http://www.gnu.org/licenses/>.
-}}
-{{!
-    Setting configmultiselect with optgroup support.
-}}
-<div class="form-select">
-    <input type="hidden" name="{{name}}[xxxxx]" value="1">
-    <select id="{{id}}" name="{{name}}[]" size="{{size}}" class="form-control" multiple>
-    {{#options}}
-        <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
-    {{/options}}
-    {{#optgroups}}
-            <optgroup label="{{label}}">
-                {{#options}}
-                    <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
-                {{/options}}
-            </optgroup>
-        {{/optgroups}}
-    </select>
-</div>
-
diff --git a/theme/boost/templates/core_admin/setting_configtime.mustache b/theme/boost/templates/core_admin/setting_configtime.mustache
deleted file mode 100644 (file)
index b8e9666..0000000
+++ /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 <http://www.gnu.org/licenses/>.
-}}
-{{!
-    Setting configtime.
-}}
-<div class="form-time defaultsnext">
-    <div class="form-inline text-ltr">
-        <label class="sr-only" for="{{id}}h">{{#str}}hours{{/str}}</label>
-        <select id="{{id}}h" name="{{name}}[h]" class="custom-select">
-            {{#hours}}
-                <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
-            {{/hours}}
-        </select>:
-        <label class="sr-only" for="{{id}}m">{{#str}}minutes{{/str}}</label>
-        <select id="{{id}}m" name="{{name}}[m]" class="custom-select">
-            {{#minutes}}
-                <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
-            {{/minutes}}
-        </select>
-    </div>
-</div>
-
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    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"
+    }
 }}
-<div class="form-item row" id="{{id}}">
-    <div class="form-label col-sm-3 text-sm-right">
+<div class="form-item clearfix" id="{{id}}">
+    <div class="form-label">
         <label {{#labelfor}}for="{{labelfor}}"{{/labelfor}}>
             {{{title}}}
             {{#override}}
                 <div class="form-warning">{{warning}}</div>
             {{/warning}}
         </label>
-        <span class="form-shortname d-block small text-muted">{{{name}}}</span>
+        <span class="form-shortname">{{{name}}}</span>
     </div>
-    <div class="form-setting col-sm-9">
+    <div class="form-setting">
         {{#error}}
             <div><span class="error">{{error}}</span></div>
         {{/error}}
         {{{element}}}
         {{#default}}
-            <div class="form-defaultinfo text-muted {{#forceltr}}text-ltr{{/forceltr}}">{{{default}}}</div>
+            <div class="form-defaultinfo {{#forceltr}}text-ltr{{/forceltr}}">{{{default}}}</div>
         {{/default}}
-        <div class="form-description mt-3">{{{description}}}</div>
     </div>
+    <div class="form-description">{{{description}}}</div>
 </div>
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    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
+    }
 }}
 <div class="form-colourpicker defaultsnext">
     <div class="admin_colourpicker clearfix">
@@ -23,7 +41,7 @@
             {{>core/pix_icon}}
         {{/icon}}
     </div>
-    <input type="text" name="{{name}}" id="{{id}}" value="{{value}}" size="12" class="form-control text-ltr">
+    <input type="text" name="{{name}}" id="{{id}}" value="{{value}}" size="12" class="text-ltr">
     {{#haspreviewconfig}}
         <input type="button" id="{{id}}_preview" value={{#quote}}{{#str}}preview{{/str}}{{/quote}} class="admin_colourpicker_preview">
     {{/haspreviewconfig}}
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    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 } ]
+    }
 }}
-<div class="form-select defaultsnext">
-    <select id="{{id}}" name="{{name}}" class="custom-select">
+<div class="form-duration defaultsnext">
+    <input type="text" size="5" id="{{id}}v" name="{{name}}[v]" value="{{value}}" class="text-ltr">
+    <label class="accesshide" for="{{id}}u">{{#str}}durationunits, admin{{/str}}</label>
+    <select id="{{id}}u" name="{{name}}[u]">
         {{#options}}
             <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
         {{/options}}
diff --git a/theme/bootstrapbase/templates/core_admin/setting_configfile.mustache b/theme/bootstrapbase/templates/core_admin/setting_configfile.mustache
new file mode 100644 (file)
index 0000000..f249fe6
--- /dev/null
@@ -0,0 +1,52 @@
+{{!
+    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 <http://www.gnu.org/licenses/>.
+}}
+{{!
+    @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
+    }
+}}
+<div class="form-file defaultsnext">
+    <input type="text" name="{{name}}" id="{{id}}" size="{{size}}" value="{{value}}" class="text-ltr" {{#readonly}}readonly{{/readonly}}>
+    {{#showvalidity}}
+        {{#valid}}
+            <span class="pathok">&#x2714;</span>
+        {{/valid}}
+        {{^valid}}
+            <span class="patherror">&#x2718;</span>
+        {{/valid}}
+    {{/showvalidity}}
+</div>
+
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    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 } ]
+    }
 }}
 <div class="form-select">
     <input type="hidden" name="{{name}}[xxxxx]" value="1">
-    <select id="{{id}}" name="{{name}}[]" size="{{size}}" class="form-control" multiple>
+    <select id="{{id}}" name="{{name}}[]" size="{{size}}" multiple>
         {{#options}}
             <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
         {{/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 (file)
index 0000000..9fa61c5
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+}}
+{{!
+    @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 }
+                ]
+            }
+        ]
+    }
+}}
+<div class="form-select">
+    <input type="hidden" name="{{name}}[xxxxx]" value="1">
+    <select id="{{id}}" name="{{name}}[]" size="{{size}}" multiple>
+        {{#options}}
+            <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
+        {{/options}}
+        {{#optgroups}}
+            <optgroup label="{{label}}">
+                {{#options}}
+                    <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
+                {{/options}}
+            </optgroup>
+        {{/optgroups}}
+    </select>
+</div>
+
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    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 }
+        ]
+    }
 }}
 <div class="form-select defaultsnext">
-    <select id="{{id}}" name="{{name}}" class="custom-select">
+    <select id="{{id}}" name="{{name}}">
         {{#options}}
             <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
         {{/options}}
-        {{#optgroups}}
-            <optgroup label="{{label}}">
-                {{#options}}
-                    <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
-                {{/options}}
-            </optgroup>
-        {{/optgroups}}
     </select>
 </div>
 
-
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 (file)
index 0000000..ea5da12
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+}}
+{{!
+    @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 }
+                ]
+            }
+        ]
+    }
+}}
+<div class="form-select defaultsnext">
+    <select id="{{id}}" name="{{name}}">
+        {{#options}}
+            <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
+        {{/options}}
+        {{#optgroups}}
+            <optgroup label="{{label}}">
+                {{#options}}
+                    <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
+                {{/options}}
+            </optgroup>
+        {{/optgroups}}
+    </select>
+</div>
+
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    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" } ]
+    }
 }}
 <div class="form-text defaultsnext">
-    <input type="text" name="{{name}}" value="{{value}}" size="{{size}}" id="{{id}}" class="form-control {{#forceltr}}text-ltr{{/forceltr}}">
+    <input type="text" name="{{name}}" value="{{value}}" size="{{size}}" id="{{id}}" class="{{#forceltr}}text-ltr{{/forceltr}}"{{#attributes}} {{name}}="{{value}}"{{/attributes}}>
 </div>
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    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"
+    }
 }}
 <div class="form-textarea">
-    <textarea rows="{{rows}}" cols="{{cols}}" id="{{id}}" name="{{name}}" spellcheck="true" class="form-control {{#forceltr}}text-ltr{{/forceltr}}">{{value}}</textarea>
+    <textarea rows="{{rows}}" cols="{{cols}}" id="{{id}}" name="{{name}}" spellcheck="true" class="{{#forceltr}}text-ltr{{/forceltr}}">{{value}}</textarea>
 </div>
diff --git a/theme/bootstrapbase/templates/core_admin/setting_configtime.mustache b/theme/bootstrapbase/templates/core_admin/setting_configtime.mustache
new file mode 100644 (file)
index 0000000..b86b691
--- /dev/null
@@ -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 <http://www.gnu.org/licenses/>.
+}}
+{{!
+    @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 }
+        ]
+    }
+}}
+<div class="form-time defaultsnext text-ltr">
+    <label class="accesshide" for="{{id}}h">{{#str}}hours{{/str}}</label>
+    <select id="{{id}}h" name="{{name}}[h]">
+        {{#hours}}
+            <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
+        {{/hours}}
+    </select>:
+    <label class="accesshide" for="{{id}}m">{{#str}}minutes{{/str}}</label>
+    <select id="{{id}}m" name="{{name}}[m]">
+        {{#minutes}}
+            <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
+        {{/minutes}}
+    </select>
+</div>
+
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    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 }
+                ]
+            }
+        ]
+    }
 }}
 <div class="form-group">
     {{#selects}}
-        <select id="{{id}}{{key}}" name="{{name}}[]" class="custom-select">
+        <select id="{{id}}{{key}}" name="{{name}}[]" class="form-select">
             {{#options}}
                 <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
             {{/options}}
 {{!
     Setting description.
 }}
-<div class="form-item row">
-    <div class="form-label col-sm-3 text-sm-right">
+<div class="form-item form-horizontal clearfix">
+    <div class="form-label">
         <label>
             {{{title}}}
         </label>
+        <span class="form-shortname ">{{{name}}}</span>
     </div>
-    <div class="form-setting col-sm-9">
-        <div class="form-description">{{{description}}}</div>
-    </div>
-</div>
+    <div class="controls felement fstatic">{{{description}}}</div>
+</div>
\ No newline at end of file
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    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" }
+        ]
+    }
 }}
-<table class="table table-striped">
+<table class="generaltable">
     <thead>
         <tr>
             <th>{{#str}}devicedetectregexexpression, admin{{/str}}</th>
         {{#expressions}}
             <tr>
                 <td class="c{{index}}">
-                    <input type="text" name="{{name}}[expression{{index}}]" class="form-control" value="{{expression}}">
+                    <input type="text" name="{{name}}[expression{{index}}]" class="form-text text-ltr" value="{{expression}}">
                 </td>
                 <td class="c{{index}}">
-                    <input type="text" name="{{name}}[value{{index}}]" class="form-control" value="{{value}}">
+                    <input type="text" name="{{name}}[value{{index}}]" class="form-text text-ltr" value="{{value}}">
                 </td>
             </tr>
         {{/expressions}}
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    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": ":)" }
+            ]}
+        ]
+    }
 }}
 <div class="form-group">
     <table id="emoticonsetting" class="admintable generaltable">
@@ -33,7 +48,7 @@
                 <tr>
                     {{#fields}}
                         <td class="c{{index}}">
-                            <input type="text" name="{{name}}[{{field}}]" class="form-text form-control text-ltr" value="{{value}}">
+                            <input type="text" name="{{name}}[{{field}}]" class="form-text text-ltr" value="{{value}}">
                         </td>
                     {{/fields}}
                     <td>
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    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
+    }
 }}
 <div class="form-group">
-    <select id="{{id}}" name="{{name}}[value]" class="form-select custom-select">
+    <select id="{{id}}" name="{{name}}[value]" class="form-select">
         {{#options}}
             <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
         {{/options}}
     along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
 }}
 {{!
-    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
+    }
 }}
 <form action="{{actionurl}}" method="post" id="adminsettings">
-    <div class="settingsform">
+    <div class="settingsform clearfix">
         {{#params}}
             <input type="hidden" name="{{name}}" value="{{value}}">
             <input type="hidden" name="action" value="save-settings">
         {{/title}}
         {{{settings}}}
         {{#showsave}}
-            <div class="row">
-                <div class="offset-sm-3 col-sm-3">
-                    <button type="submit" class="btn btn-primary">{{#str}}savechanges, admin{{/str}}</button>
-                </div>
+            <div class="form-buttons">
+                <input type="submit" class="form-submit" value={{#quote}}{{#str}}savechanges, admin{{/str}}{{/quote}}>
             </div>
         {{/showsave}}
     </div>
                 </fieldset>
             {{/results}}
             {{#showsave}}
-                <div class="row">
-                    <div class="offset-sm-3 col-sm-3">
-                        <button type="submit" class="btn btn-primary">{{#str}}savechanges, admin{{/str}}</button>
-                    </div>
+                <div class="form-buttons">
+                    <input type="submit" class="form-submit" value={{#quote}}{{#str}}savechanges, admin{{/str}}{{/quote}}>
                 </div>
             {{/showsave}}
         {{/hasresults}}