MDL-55417 forms: Render form elements with a template
authorDamyon Wiese <damyon@moodle.com>
Thu, 4 Aug 2016 14:29:32 +0000 (22:29 +0800)
committerDan Poltawski <dan@moodle.com>
Fri, 23 Sep 2016 09:53:30 +0000 (10:53 +0100)
commit91bda4cd45e91f356036b1fd73bc8efcfb089166
tree44e932565b7cbd4a7f6a21a977e0a13e10bd3794
parentef18a21f93d0d439fcc94e9b0805f81671b16ade
MDL-55417 forms: Render form elements with a template

This change allows form elements to be overridden with a mustache template.
The template can even listen for form validation errors and supply the JS to
change the look of the form element when there is/isn't a validation error.

Initial support is for all core form elements including:

text, select, selectyesno and checkboxes, groups, dateselector, datetimeselector,
autocomplete, modvisible, advcheckbox, button, duration, filemanager, filepicker, editor, static, grading,
warning, textarea, password, url, submit, questioncategory, recaptcha.

Part of MDL-55071
69 files changed:
grade/edit/outcome/edit_form.php
grade/edit/tree/outcomeitem_form.php
lib/amd/build/event.min.js
lib/amd/src/event.js
lib/form/advcheckbox.php
lib/form/autocomplete.php
lib/form/button.php
lib/form/checkbox.php
lib/form/editor.php
lib/form/filemanager.php
lib/form/filepicker.php
lib/form/grading.php
lib/form/group.php
lib/form/modgrade.php
lib/form/password.php
lib/form/recaptcha.php
lib/form/select.php
lib/form/selectgroups.php
lib/form/selectwithlink.php
lib/form/static.php
lib/form/submit.php
lib/form/submitlink.php
lib/form/templates/editor_textarea.mustache [new file with mode: 0644]
lib/form/text.php
lib/form/textarea.php
lib/form/url.php
lib/formslib.php
lib/outputrenderers.php
theme/noname/scss/moodle/core.scss
theme/noname/scss/moodle/course.scss
theme/noname/scss/moodle/forms.scss
theme/noname/templates/core/form_autocomplete_input.mustache [new file with mode: 0644]
theme/noname/templates/core/form_autocomplete_selection.mustache [new file with mode: 0644]
theme/noname/templates/core_form/editor_textarea.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-advcheckbox-inline.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-advcheckbox.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-autocomplete.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-button-inline.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-button.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-checkbox-inline.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-checkbox.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-date_selector.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-date_time_selector.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-duration.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-editor.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-filemanager.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-filepicker.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-grading.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-group.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-modgrade.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-modvisible.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-password.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-questioncategory-inline.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-questioncategory.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-recaptcha.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-select-inline.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-select.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-selectgroups-inline.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-selectgroups.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-selectyesno-inline.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-selectyesno.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-static.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-submit-inline.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-submit.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-text-inline.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-text.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-textarea.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-url.mustache [new file with mode: 0644]
theme/noname/templates/core_form/element-warning.mustache [new file with mode: 0644]