MDL-55417 forms: Improve some of the new templates for form elements

Also - un-deprecate selectwithlink (Fred convinced me).

Part of MDL-55071
This commit is contained in:
Damyon Wiese
2016-09-23 10:53:30 +01:00
committed by Dan Poltawski
parent 97a00c9b8e
commit 7e2cd5b84e
7 changed files with 68 additions and 18 deletions
@@ -48,4 +48,3 @@
<span>{{noSelectionString}}</span>
{{/items}}
</div>
</div>
@@ -16,8 +16,8 @@
require(['core/yui'], function(Y) {
Y.use('moodle-form-passwordunmask', function() {
M.form.passwordunmask({ formid: {{#quote}}{{element.id}}{{/quote}},
checkboxlabel: '{{#str}}unmaskpassword, form{{/str}}',
checkboxlabel: {{#quote}}{{#str}}unmaskpassword, form{{/str}}{{/quote}},
checkboxname: {{#quote}}{{element.name}}{{/quote}} });
});
});
{{/js}}
{{/js}}
@@ -0,0 +1,17 @@
{{< core_form/element-template }}
{{$element}}
<select class="custom-select {{#error}}form-control-danger{{/error}}" name="{{element.name}}"
id="{{element.id}}"
{{#element.multiple}}multiple{{/element.multiple}}
{{#element.frozen}}readonly disabled{{/element.frozen}}
{{#error}}
autofocus aria-describedby="id_error_{{element.name}}"
{{/error}}
{{element.attributes}} >
{{#element.options}}
<option value="{{value}}" {{#selected}}selected{{/selected}}>{{text}}</option>
{{/element.options}}
</select>
<a class="m-x-1" href="{{{element.link}}}">{{element.linklabel}}</a>
{{/element}}
{{/ core_form/element-template }}