MDL-56462 boost: Fix assign grading options form
authorDamyon Wiese <damyon@moodle.com>
Fri, 28 Oct 2016 04:24:50 +0000 (12:24 +0800)
committerDamyon Wiese <damyon@moodle.com>
Fri, 28 Oct 2016 04:24:50 +0000 (12:24 +0800)
Classes attribute was not being honoured by all form element templates.
Formchangechecker was only looking for the ignoredirty class on the element,
in boost it is on the container.
Assign had specific styles to hide the submit buttons that were not matching in boost.

lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker-debug.js
lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker-min.js
lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker.js
lib/yui/src/formchangechecker/js/formchangechecker.js
mod/assign/styles.css
theme/boost/templates/core_form/element-advcheckbox-inline.mustache
theme/boost/templates/core_form/element-advcheckbox.mustache
theme/boost/templates/core_form/element-checkbox-inline.mustache
theme/boost/templates/core_form/element-checkbox.mustache
theme/boost/templates/core_form/element-radio-inline.mustache
theme/boost/templates/core_form/element-radio.mustache

index 7d9caa3..b584c62 100644 (file)
Binary files a/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker-debug.js and b/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker-debug.js differ
index 6e2c93e..81f74b4 100644 (file)
Binary files a/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker-min.js and b/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker-min.js differ
index 7d9caa3..b584c62 100644 (file)
Binary files a/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker.js and b/lib/yui/build/moodle-core-formchangechecker/moodle-core-formchangechecker.js differ
index c88507c..f4545f4 100644 (file)
@@ -69,7 +69,7 @@ Y.extend(FORMCHANGECHECKER, Y.Base, {
          */
         store_initial_value: function(e) {
             var thisevent;
-            if (e.target.hasClass('ignoredirty')) {
+            if (e.target.hasClass('ignoredirty') || e.target.ancestor('.ignoredirty')) {
                 // Don't warn on elements with the ignoredirty class
                 return;
             }
@@ -118,7 +118,7 @@ M.core_formchangechecker.stateinformation = [];
  * Set the form changed state to true
  */
 M.core_formchangechecker.set_form_changed = function(e) {
-    if (e && e.target && e.target.hasClass('ignoredirty')) {
+    if (e && e.target && (e.target.hasClass('ignoredirty') || e.target.ancestor('.ignoredirty'))) {
         // Don't warn on elements with the ignoredirty class
         return;
     }
index d4e7c48..4d753ba 100644 (file)
@@ -43,7 +43,7 @@
     font-weight: 900;
 }
 
-.path-mod-assign.jsenabled .gradingoptionsform .fsubmit {
+.path-mod-assign.jsenabled .gradingoptionsform [type=submit] {
     display: none;
 }
 
index 3b11eb2..d38eab8 100644 (file)
@@ -1,4 +1,4 @@
-<label class="form-check-inline {{#error}}has-danger{{/error}}">
+<label class="form-check-inline {{#error}}has-danger{{/error}} fitem {{#advanced}}advanced{{/advanced}} {{{element.extraclasses}}}">
 {{^element.hardfrozen}}
     {{^element.frozen}}
         <input type="hidden" name="{{element.name}}" value="{{element.deselectedvalue}}">
index 4098526..d94e26f 100644 (file)
@@ -1,4 +1,4 @@
-<div class="form-group row {{#error}}has-danger{{/error}}">
+<div class="form-group row {{#error}}has-danger{{/error}} fitem {{#advanced}}advanced{{/advanced}} {{{element.extraclasses}}}">
     <div class="col-md-9 push-md-3 checkbox">
         <label>
         {{^element.hardfrozen}}
index 8249a9b..6266c04 100644 (file)
@@ -1,8 +1,5 @@
-<label class="form-check-inline {{#error}}has-danger{{/error}}">
+<label class="form-check-inline {{#error}}has-danger{{/error}} fitem {{#advanced}}advanced{{/advanced}} {{{element.extraclasses}}}">
 {{^element.hardfrozen}}
-    {{^element.frozen}}
-        <input type="hidden" name="{{element.name}}" value="">
-    {{/element.frozen}}
     {{#element.frozen}}
         <input type="hidden" name="{{element.name}}" value="{{element.frozenvalue}}">
     {{/element.frozen}}
index e0d0850..cd3f5b8 100644 (file)
@@ -1,10 +1,7 @@
-<div class="form-group row {{#error}}has-danger{{/error}}">
+<div class="form-group row {{#error}}has-danger{{/error}} fitem {{#advanced}}advanced{{/advanced}} {{{element.extraclasses}}}">
     <div class="col-md-9 push-md-3 checkbox">
         <label>
         {{^element.hardfrozen}}
-            {{^element.frozen}}
-                <input type="hidden" name="{{element.name}}" value="">
-            {{/element.frozen}}
             {{#element.frozen}}
                 <input type="hidden" name="{{element.name}}" value="{{element.frozenvalue}}">
             {{/element.frozen}}
index a05945e..509c6d7 100644 (file)
@@ -11,7 +11,7 @@
    }
 
 }}
-<label class="form-check-inline {{#error}}has-danger{{/error}}">
+<label class="form-check-inline {{#error}}has-danger{{/error}} fitem {{#advanced}}advanced{{/advanced}} {{{element.extraclasses}}}">
 {{^element.frozen}}
 <input type="radio" name="{{element.name}}"
     id="{{element.id}}" value="{{element.value}}" size="{{element.size}}"
index c16be99..7a64ad5 100644 (file)
@@ -11,7 +11,7 @@
     }
 
 }}
-<div class="form-group row {{#error}}has-danger{{/error}}">
+<div class="form-group row {{#error}}has-danger{{/error}} fitem {{#advanced}}advanced{{/advanced}} {{{element.extraclasses}}}">
     <div class="col-md-9 push-md-3 checkbox">
         <label>
         {{^element.frozen}}