MDL-55584 theme_noname: Patching for better feel in grades
authorFrederic Massart <fred@moodle.com>
Tue, 16 Aug 2016 09:42:31 +0000 (17:42 +0800)
committerDan Poltawski <dan@moodle.com>
Fri, 23 Sep 2016 09:53:56 +0000 (10:53 +0100)
Part of MDL-55071

14 files changed:
theme/noname/classes/output/gradereport_history_renderer.php [new file with mode: 0644]
theme/noname/scss/moodle/core.scss
theme/noname/scss/moodle/grade.scss
theme/noname/templates/core/dataformat_selector.mustache [new file with mode: 0644]
theme/noname/templates/core/single_select.mustache
theme/noname/templates/core_form/element-template.mustache
theme/noname/templates/core_grades/edit_tree.mustache [new file with mode: 0644]
theme/noname/templates/core_grades/weight_field.mustache [new file with mode: 0644]
theme/noname/templates/core_grades/weight_override_field.mustache [new file with mode: 0644]
theme/noname/templates/gradereport_history/user_button.mustache [new file with mode: 0644]
theme/noname/templates/gradereport_singleview/bulk_insert.mustache [new file with mode: 0644]
theme/noname/templates/gradereport_singleview/button.mustache [new file with mode: 0644]
theme/noname/templates/gradereport_singleview/dropdown_attribute.mustache [new file with mode: 0644]
theme/noname/templates/gradereport_singleview/text_attribute.mustache [new file with mode: 0644]

diff --git a/theme/noname/classes/output/gradereport_history_renderer.php b/theme/noname/classes/output/gradereport_history_renderer.php
new file mode 100644 (file)
index 0000000..5fa2d14
--- /dev/null
@@ -0,0 +1,44 @@
+<?php
+// 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/>.
+
+/**
+ * Overriden gradereport_history renderer.
+ *
+ * @package    theme_noname
+ * @copyright  2016 Frédéric Massart - FMCorz.net
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+namespace theme_noname\output;
+defined('MOODLE_INTERNAL') || die();
+
+use gradereport_history\output\user_button;
+
+/**
+ * Overriden gradereport_history renderer.
+ *
+ * @package    theme_noname
+ * @copyright  2016 Frédéric Massart - FMCorz.net
+ * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+class gradereport_history_renderer extends \gradereport_history\output\renderer {
+
+    public function render_user_button(user_button $button) {
+        $data = $button->export_for_template($this);
+        return $this->render_from_template('gradereport_history/user_button', $data);
+    }
+
+}
index b317927..b502158 100644 (file)
@@ -378,16 +378,6 @@ a.skip:active {
 .groupselector label {
     display: inline-block;
 }
-// Data format selector
-.dataformatselector {
-    margin: 1em 0;
-}
-.dataformatselector label {
-    display: inline-block;
-    margin: 0 5px 10px 0;
-    line-height: 30px;
-    vertical-align: top;
-}
 
 // Login
 .login-page {
index 7f64603..409d6b4 100644 (file)
         tr:nth-of-type(even) .cell,
         .floater .cell,
         .avg {
-            background-color: $table-bg-accent;
+            background-color: $gray-lightest;
         }
         table .clickable {
             cursor: pointer;
     }
 }
 
+/**
+ * Single view.
+ */
+.path-grade-report-singleview input[name^="finalgrade"] {
+    width: 80px;
+}
diff --git a/theme/noname/templates/core/dataformat_selector.mustache b/theme/noname/templates/core/dataformat_selector.mustache
new file mode 100644 (file)
index 0000000..35462a2
--- /dev/null
@@ -0,0 +1,43 @@
+{{!
+    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/dataformat_selector
+
+    Context variables required for this template:
+    * label
+    * base
+    * name
+    * params
+    * options
+    * sesskey
+    * submit
+}}
+<form method="get" action="{{base}}" class="dataformatselector m-a-1">
+    <div class="form-inline text-xs-right">
+        <input type="hidden" name="sesskey" value="{{sesskey}}">
+        <label for="downloadtype_{{name}}" class="m-r-1">{{label}}</label>
+        <select name="{{name}}" id="downloadtype_{{name}}" class="form-control">
+            {{#options}}
+                <option value="{{value}}">{{label}}</option>
+            {{/options}}
+        </select>
+        <buttom type="submit" class="btn btn-secondary">{{submit}}</button>
+        {{#params}}
+            <input type="hidden" name="{{name}}" value="{{value}}">
+        {{/params}}
+    </div>
+</form>
index 6a876da..878884a 100644 (file)
@@ -1,4 +1,4 @@
-<div class="{{classes}}">
+<div class="{{classes}} d-inline-block">
     <form method="{{method}}" action="{{action}}" class="form-inline">
         {{#params}}
             <input type="hidden" name="{{name}}" value="{{value}}">
index a03a596..d6e9652 100644 (file)
@@ -2,7 +2,7 @@
     <label class="col-md-3 col-form-label {{#element.hiddenlabel}}sr-only{{/element.hiddenlabel}}" for="{{element.id}}">
         {{{label}}} {{{helpbutton}}}
     </label>
-    <div class="col-md-9 form-inline">
+    <div class="col-md-9 form-inline felement">
         {{$ element }}
             <!-- Element goes here -->
         {{/ element }}
diff --git a/theme/noname/templates/core_grades/edit_tree.mustache b/theme/noname/templates/core_grades/edit_tree.mustache
new file mode 100644 (file)
index 0000000..34f7662
--- /dev/null
@@ -0,0 +1,45 @@
+{{!
+    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/>.
+}}
+{{!
+    Edit tree.
+}}
+
+<form id="gradetreeform" method="post" action="{{actionurl}}">
+    <div>
+        <input type="hidden" name="sesskey" value="{{sesskey}}">
+        {{#notification}}
+            {{>core/notification_info}}
+        {{/notification}}
+        {{{table}}}
+        <div id="gradetreesubmit">
+            {{#showsave}}
+                <input class="advanced btn btn-primary" type="submit" value={{#quote}}{{#str}}savechanges{{/str}}{{/quote}}>
+            {{/showsave}}
+            {{#showbulkmove}}
+                <div class="form-inline m-t-1">
+                    <input type="hidden" name="bulkmove" value="0" id="bulkmoveinput">
+                    <label for="menumoveafter">{{#str}}moveselectedto, grades{{/str}}</label>
+                    <select name="moveafter" id="menumoveafter" class="ignoredirty singleselect select form-control">
+                        {{#bulkmoveoptions}}
+                            <option value="{{value}}">{{name}}</option>
+                        {{/bulkmoveoptions}}
+                    </select>
+                </div>
+            {{/showbulkmove}}
+        </div>
+    </div>
+</form>
diff --git a/theme/noname/templates/core_grades/weight_field.mustache b/theme/noname/templates/core_grades/weight_field.mustache
new file mode 100644 (file)
index 0000000..3ee641b
--- /dev/null
@@ -0,0 +1,23 @@
+{{!
+    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/>.
+}}
+{{!
+    Weight field.
+}}
+<label class="accesshide" for="weight_{{id}}">
+    {{#str}}extracreditvalue, grades, {{itemname}}{{/str}}
+</label>
+<input type="text" name="weight_{{id}}" id="weight_{{id}}" value="{{value}}" size="4" class="form-control">
diff --git a/theme/noname/templates/core_grades/weight_override_field.mustache b/theme/noname/templates/core_grades/weight_override_field.mustache
new file mode 100644 (file)
index 0000000..0ed8292
--- /dev/null
@@ -0,0 +1,31 @@
+{{!
+    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/>.
+}}
+{{!
+    Weight field.
+}}
+<div class="form-inline">
+    <label class="accesshide" for="weightoverride_{{id}}">
+        {{#str}}overrideweightofa, grades, {{itemname}}{{/str}}
+    </label>
+    <input type="hidden" name="weightoverride_{{id}}" value="0">
+    <input type="checkbox" name="weightoverride_{{id}}" id="weightoverride_{{id}}" value="1" class="weightoverride" {{#checked}}checked{{/checked}}>
+
+    <label class="accesshide" for="weight_{{id}}">
+        {{#str}}weightofa, grades, {{itemname}}{{/str}}
+    </label>
+    <input type="text" name="weight_{{id}}" id="weight_{{id}}" value="{{value}}" size="4" {{#disabled}}disabled{{/disabled}} class="form-control">
+</div>
diff --git a/theme/noname/templates/gradereport_history/user_button.mustache b/theme/noname/templates/gradereport_history/user_button.mustache
new file mode 100644 (file)
index 0000000..90e8b70
--- /dev/null
@@ -0,0 +1,21 @@
+<div class="{{classes}}">
+    <div method="{{method}}" action="{{url}}" id="{{formid}}">
+        {{#params}}
+            <input type="hidden" name="{{name}}" value="{{value}}">
+        {{/params}}
+        <input type="button" class="btn btn-secondary selectortrigger"
+            id="{{id}}"
+            title={{#quote}}{{tooltip}}{{/quote}}
+            value={{#quote}}{{label}}{{/quote}}
+            {{#disabled}}disabled{{/disabled}}>
+    </div>
+</div>
+{{#hasactions}}
+    {{#js}}
+        require(['core/yui'], function(Y) {
+            {{#actions}}
+                Y.on('{{event}}', {{{jsfunction}}}, '#{{id}}', null{{#jsfunctionargs}}, {{{jsfunctionargs}}}{{/jsfunctionargs}});
+            {{/actions}}
+        });
+    {{/js}}
+{{/hasactions}}
diff --git a/theme/noname/templates/gradereport_singleview/bulk_insert.mustache b/theme/noname/templates/gradereport_singleview/bulk_insert.mustache
new file mode 100644 (file)
index 0000000..abe592a
--- /dev/null
@@ -0,0 +1,34 @@
+{{!
+    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/>.
+}}
+{{!
+    Bulk insert attribute.
+}}
+<div class="enable">
+    <input type="checkbox" name="{{applyname}}" value="1" id="{{applyname}}">
+    <label for="{{applyname}}">{{applylabel}}</label>
+</div>
+<fieldset class="form-inline">
+    <legend class="accesshide">{{label}}</legend>
+    <label for="{{menuname}}">{{menulabel}}</label>
+    <select name="{{menuname}}" id="{{menuname}}" class="form-control">
+        {{#menuoptions}}
+            <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
+        {{/menuoptions}}
+    </select>
+    <label for="{{valuename}}">{{valuelabel}}</label>
+    {{{valuefield}}}
+</fieldset>
diff --git a/theme/noname/templates/gradereport_singleview/button.mustache b/theme/noname/templates/gradereport_singleview/button.mustache
new file mode 100644 (file)
index 0000000..43fdbcf
--- /dev/null
@@ -0,0 +1,20 @@
+{{!
+    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/>.
+}}
+{{!
+    Button.
+}}
+<input type="{{type}}" value={{#quote}}{{value}}{{/quote}} class="btn btn-secondary">
diff --git a/theme/noname/templates/gradereport_singleview/dropdown_attribute.mustache b/theme/noname/templates/gradereport_singleview/dropdown_attribute.mustache
new file mode 100644 (file)
index 0000000..9f3be1a
--- /dev/null
@@ -0,0 +1,25 @@
+{{!
+    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/>.
+}}
+{{!
+    Dropdown attribute.
+}}
+<select id="{{name}}" name="{{name}}" class="custom-select" tabindex="1" {{#disabled}}disabled{{/disabled}}>
+    {{#options}}
+        <option value="{{value}}" {{#selected}}selected{{/selected}}>{{name}}</option>
+    {{/options}}
+</select>
+<input type="hidden" name="old{{name}}" value="{{value}}">
diff --git a/theme/noname/templates/gradereport_singleview/text_attribute.mustache b/theme/noname/templates/gradereport_singleview/text_attribute.mustache
new file mode 100644 (file)
index 0000000..ffd06e9
--- /dev/null
@@ -0,0 +1,22 @@
+{{!
+    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/>.
+}}
+{{!
+    Text attribute.
+}}
+<label for="{{name}}" class="accesshide">{{label}}</label>
+<input id="{{name}}" name="{{name}}" type="text" value="{{value}}" class="form-control" {{#tabindex}}tabindex="{{.}}"{{/tabindex}} {{#disabled}}disabled{{/disabled}}>
+<input type="hidden" name="old{{name}}" value="{{value}}">