From c1d6e95b526d058603f205d284e4fdf03f9087ea Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Tue, 16 Aug 2016 17:42:31 +0800 Subject: [PATCH] MDL-55584 theme_noname: Patching for better feel in grades Part of MDL-55071 --- .../output/gradereport_history_renderer.php | 44 ++++++++++++++++++ theme/noname/scss/moodle/core.scss | 10 ----- theme/noname/scss/moodle/grade.scss | 8 +++- .../core/dataformat_selector.mustache | 43 ++++++++++++++++++ .../templates/core/single_select.mustache | 2 +- .../core_form/element-template.mustache | 2 +- .../templates/core_grades/edit_tree.mustache | 45 +++++++++++++++++++ .../core_grades/weight_field.mustache | 23 ++++++++++ .../weight_override_field.mustache | 31 +++++++++++++ .../gradereport_history/user_button.mustache | 21 +++++++++ .../bulk_insert.mustache | 34 ++++++++++++++ .../gradereport_singleview/button.mustache | 20 +++++++++ .../dropdown_attribute.mustache | 25 +++++++++++ .../text_attribute.mustache | 22 +++++++++ 14 files changed, 317 insertions(+), 13 deletions(-) create mode 100644 theme/noname/classes/output/gradereport_history_renderer.php create mode 100644 theme/noname/templates/core/dataformat_selector.mustache create mode 100644 theme/noname/templates/core_grades/edit_tree.mustache create mode 100644 theme/noname/templates/core_grades/weight_field.mustache create mode 100644 theme/noname/templates/core_grades/weight_override_field.mustache create mode 100644 theme/noname/templates/gradereport_history/user_button.mustache create mode 100644 theme/noname/templates/gradereport_singleview/bulk_insert.mustache create mode 100644 theme/noname/templates/gradereport_singleview/button.mustache create mode 100644 theme/noname/templates/gradereport_singleview/dropdown_attribute.mustache create mode 100644 theme/noname/templates/gradereport_singleview/text_attribute.mustache diff --git a/theme/noname/classes/output/gradereport_history_renderer.php b/theme/noname/classes/output/gradereport_history_renderer.php new file mode 100644 index 00000000000..5fa2d144192 --- /dev/null +++ b/theme/noname/classes/output/gradereport_history_renderer.php @@ -0,0 +1,44 @@ +. + +/** + * 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); + } + +} diff --git a/theme/noname/scss/moodle/core.scss b/theme/noname/scss/moodle/core.scss index b31792792f4..b502158f6bd 100644 --- a/theme/noname/scss/moodle/core.scss +++ b/theme/noname/scss/moodle/core.scss @@ -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 { diff --git a/theme/noname/scss/moodle/grade.scss b/theme/noname/scss/moodle/grade.scss index 7f646034824..409d6b45731 100644 --- a/theme/noname/scss/moodle/grade.scss +++ b/theme/noname/scss/moodle/grade.scss @@ -310,7 +310,7 @@ tr:nth-of-type(even) .cell, .floater .cell, .avg { - background-color: $table-bg-accent; + background-color: $gray-lightest; } table .clickable { cursor: pointer; @@ -333,3 +333,9 @@ } } +/** + * 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 index 00000000000..35462a26558 --- /dev/null +++ b/theme/noname/templates/core/dataformat_selector.mustache @@ -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 . +}} +{{! + @template core/dataformat_selector + + Context variables required for this template: + * label + * base + * name + * params + * options + * sesskey + * submit +}} +
+
+ + + + {{submit}} + {{#params}} + + {{/params}} +
+
diff --git a/theme/noname/templates/core/single_select.mustache b/theme/noname/templates/core/single_select.mustache index 6a876da1d55..878884af090 100644 --- a/theme/noname/templates/core/single_select.mustache +++ b/theme/noname/templates/core/single_select.mustache @@ -1,4 +1,4 @@ -
+
{{#params}} diff --git a/theme/noname/templates/core_form/element-template.mustache b/theme/noname/templates/core_form/element-template.mustache index a03a59638ab..d6e9652afc0 100644 --- a/theme/noname/templates/core_form/element-template.mustache +++ b/theme/noname/templates/core_form/element-template.mustache @@ -2,7 +2,7 @@ -
+
{{$ element }} {{/ 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 index 00000000000..34f76628e34 --- /dev/null +++ b/theme/noname/templates/core_grades/edit_tree.mustache @@ -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 . +}} +{{! + Edit tree. +}} + + +
+ + {{#notification}} + {{>core/notification_info}} + {{/notification}} + {{{table}}} +
+ {{#showsave}} + + {{/showsave}} + {{#showbulkmove}} +
+ + + +
+ {{/showbulkmove}} +
+
+ diff --git a/theme/noname/templates/core_grades/weight_field.mustache b/theme/noname/templates/core_grades/weight_field.mustache new file mode 100644 index 00000000000..3ee641b849b --- /dev/null +++ b/theme/noname/templates/core_grades/weight_field.mustache @@ -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 . +}} +{{! + Weight field. +}} + + 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 index 00000000000..0ed8292aa34 --- /dev/null +++ b/theme/noname/templates/core_grades/weight_override_field.mustache @@ -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 . +}} +{{! + Weight field. +}} +
+ + + + + + +
diff --git a/theme/noname/templates/gradereport_history/user_button.mustache b/theme/noname/templates/gradereport_history/user_button.mustache new file mode 100644 index 00000000000..90e8b70e474 --- /dev/null +++ b/theme/noname/templates/gradereport_history/user_button.mustache @@ -0,0 +1,21 @@ +
+
+ {{#params}} + + {{/params}} + +
+
+{{#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 index 00000000000..abe592ac131 --- /dev/null +++ b/theme/noname/templates/gradereport_singleview/bulk_insert.mustache @@ -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 . +}} +{{! + Bulk insert attribute. +}} +
+ + +
+
+ {{label}} + + + + {{{valuefield}}} +
diff --git a/theme/noname/templates/gradereport_singleview/button.mustache b/theme/noname/templates/gradereport_singleview/button.mustache new file mode 100644 index 00000000000..43fdbcf1adf --- /dev/null +++ b/theme/noname/templates/gradereport_singleview/button.mustache @@ -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 . +}} +{{! + Button. +}} + diff --git a/theme/noname/templates/gradereport_singleview/dropdown_attribute.mustache b/theme/noname/templates/gradereport_singleview/dropdown_attribute.mustache new file mode 100644 index 00000000000..9f3be1a882d --- /dev/null +++ b/theme/noname/templates/gradereport_singleview/dropdown_attribute.mustache @@ -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 . +}} +{{! + Dropdown attribute. +}} + + diff --git a/theme/noname/templates/gradereport_singleview/text_attribute.mustache b/theme/noname/templates/gradereport_singleview/text_attribute.mustache new file mode 100644 index 00000000000..ffd06e967fd --- /dev/null +++ b/theme/noname/templates/gradereport_singleview/text_attribute.mustache @@ -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 . +}} +{{! + Text attribute. +}} + + +