Skip to content
Permalink
Browse files

MDL-58428 theme: Move templates from admin

  • Loading branch information...
Chocolate-lightning authored and sarjona committed Feb 22, 2019
1 parent b13a453 commit 56cc669c3992213626b9765be91fc5cc76bc6378
Showing with 631 additions and 615 deletions.
  1. +9 −34 admin/templates/setting.mustache
  2. +4 −21 admin/templates/setting_configcolourpicker.mustache
  3. +12 −25 admin/templates/setting_configduration.mustache
  4. +14 −32 admin/templates/setting_configfile.mustache
  5. +4 −20 admin/templates/setting_configmultiselect.mustache
  6. +8 −43 admin/templates/setting_configmultiselect_optgroup.mustache
  7. +4 −20 admin/templates/setting_configselect.mustache
  8. +5 −37 admin/templates/setting_configselect_optgroup.mustache
  9. +4 −23 admin/templates/setting_configtext.mustache
  10. +4 −22 admin/templates/setting_configtextarea.mustache
  11. +18 −37 admin/templates/setting_configtime.mustache
  12. +4 −23 admin/templates/setting_courselist_frontpage.mustache
  13. +6 −5 admin/templates/setting_description.mustache
  14. +6 −17 admin/templates/setting_devicedetectregex.mustache
  15. +4 −18 admin/templates/setting_emoticons.mustache
  16. +4 −23 admin/templates/setting_gradecat_combo.mustache
  17. +8 −24 admin/templates/settings.mustache
  18. +4 −2 admin/templates/settings_search_results.mustache
  19. +0 −31 theme/boost/templates/core_admin/setting_configduration.mustache
  20. +0 −33 theme/boost/templates/core_admin/setting_configfile.mustache
  21. +0 −35 theme/boost/templates/core_admin/setting_configmultiselect_optgroup.mustache
  22. +0 −36 theme/boost/templates/core_admin/setting_configtime.mustache
  23. +33 −7 theme/{boost → bootstrapbase}/templates/core_admin/setting.mustache
  24. +20 −2 theme/{boost → bootstrapbase}/templates/core_admin/setting_configcolourpicker.mustache
  25. +21 −3 ...tting_configselect.mustache → bootstrapbase/templates/core_admin/setting_configduration.mustache}
  26. +52 −0 theme/bootstrapbase/templates/core_admin/setting_configfile.mustache
  27. +19 −2 theme/{boost → bootstrapbase}/templates/core_admin/setting_configmultiselect.mustache
  28. +71 −0 theme/bootstrapbase/templates/core_admin/setting_configmultiselect_optgroup.mustache
  29. +19 −10 ...onfigselect_optgroup.mustache → bootstrapbase/templates/core_admin/setting_configselect.mustache}
  30. +68 −0 theme/bootstrapbase/templates/core_admin/setting_configselect_optgroup.mustache
  31. +22 −2 theme/{boost → bootstrapbase}/templates/core_admin/setting_configtext.mustache
  32. +21 −2 theme/{boost → bootstrapbase}/templates/core_admin/setting_configtextarea.mustache
  33. +56 −0 theme/bootstrapbase/templates/core_admin/setting_configtime.mustache
  34. +22 −2 theme/{boost → bootstrapbase}/templates/core_admin/setting_courselist_frontpage.mustache
  35. +5 −6 theme/{boost → bootstrapbase}/templates/core_admin/setting_description.mustache
  36. +16 −4 theme/{boost → bootstrapbase}/templates/core_admin/setting_devicedetectregex.mustache
  37. +17 −2 theme/{boost → bootstrapbase}/templates/core_admin/setting_emoticons.mustache
  38. +22 −2 theme/{boost → bootstrapbase}/templates/core_admin/setting_gradecat_combo.mustache
  39. +23 −6 theme/{boost → bootstrapbase}/templates/core_admin/settings.mustache
  40. +2 −4 theme/{boost → bootstrapbase}/templates/core_admin/settings_search_results.mustache
@@ -13,34 +13,6 @@

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
@@ -71,8 +43,11 @@
"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}}
@@ -82,16 +57,16 @@
<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>
@@ -13,26 +13,6 @@

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
@@ -55,13 +35,16 @@
"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}}
@@ -13,24 +13,6 @@

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
@@ -51,13 +33,18 @@
"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>

@@ -13,29 +13,6 @@

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
@@ -61,15 +38,20 @@
"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>

@@ -13,25 +13,6 @@

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
@@ -53,9 +34,12 @@
{ "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}}
@@ -13,44 +13,6 @@

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
@@ -91,13 +53,16 @@
]
}
}}
{{!
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>
@@ -13,25 +13,6 @@

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
@@ -53,8 +34,11 @@
]
}
}}
{{!
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}}

0 comments on commit 56cc669

Please sign in to comment.
You can’t perform that action at this time.