From b0f3314cb1670b9f83cab986c3dda1f27a102e19 Mon Sep 17 00:00:00 2001 From: Paul Holden Date: Wed, 10 Dec 2025 20:04:02 +0000 Subject: [PATCH] MDL-76437 gradingform_rubric: consistent styles for add buttons. Remove duplication/redundancy for same elements from the theme. --- grade/grading/form/rubric/renderer.php | 7 ++++--- grade/grading/form/rubric/styles.css | 16 +++------------- theme/boost/scss/moodle/grade.scss | 26 -------------------------- theme/boost/style/moodle.css | 22 ---------------------- theme/classic/style/moodle.css | 22 ---------------------- 5 files changed, 7 insertions(+), 86 deletions(-) diff --git a/grade/grading/form/rubric/renderer.php b/grade/grading/form/rubric/renderer.php index e63d7e8fd01..f8d05fdc858 100644 --- a/grade/grading/form/rubric/renderer.php +++ b/grade/grading/form/rubric/renderer.php @@ -419,14 +419,15 @@ class gradingform_rubric_renderer extends plugin_renderer_base { $rubrictemplate .= $rubrictable; if ($mode == gradingform_rubric_controller::DISPLAY_EDIT_FULL) { $value = get_string('addcriterion', 'gradingform_rubric'); - $criteriainputparams = array( + $criteriainputparams = [ 'type' => 'submit', 'name' => '{NAME}[criteria][addcriterion]', 'id' => '{NAME}-criteria-addcriterion', + 'class' => 'btn btn-secondary', 'value' => $value - ); + ]; $input = html_writer::empty_tag('input', $criteriainputparams); - $rubrictemplate .= html_writer::tag('div', $input, array('class' => 'addcriterion btn btn-secondary')); + $rubrictemplate .= html_writer::tag('div', $input, ['class' => 'addcriterion my-2']); } $rubrictemplate .= $this->rubric_edit_options($mode, $options); $rubrictemplate .= html_writer::end_tag('div'); diff --git a/grade/grading/form/rubric/styles.css b/grade/grading/form/rubric/styles.css index 65e4e08357d..729f9772a72 100644 --- a/grade/grading/form/rubric/styles.css +++ b/grade/grading/form/rubric/styles.css @@ -194,25 +194,15 @@ .gradingform_rubric.editor .addcriterion input, .gradingform_rubric.editor .addlevel input { background: #fff url([[pix:t/add]]) 4px 6px / 16px 16px no-repeat; + height: 30px; + line-height: 1rem; + padding-left: 24px; display: block; color: #555; font-weight: bold; text-decoration: none; } -.gradingform_rubric.editor .addcriterion input { - height: 30px; - line-height: 29px; - margin-bottom: 14px; - padding-left: 20px; - padding-right: 10px; -} - -.gradingform_rubric.editor .addlevel input { - padding-left: 24px; - padding-right: 8px; -} - .gradingform_rubric .options .optionsheading { font-weight: bold; font-size: 1.1em; diff --git a/theme/boost/scss/moodle/grade.scss b/theme/boost/scss/moodle/grade.scss index 7e667ef6e05..c9d4393df6c 100644 --- a/theme/boost/scss/moodle/grade.scss +++ b/theme/boost/scss/moodle/grade.scss @@ -215,32 +215,6 @@ } } } - - .addlevel { - vertical-align: top; - padding-top: 6px; - - input { - height: 30px; - line-height: 1rem; - } - } - } - - .addcriterion { - margin-left: 5px; - padding: 0; - - input { - margin: 0; - color: inherit; - text-shadow: inherit; - border: 0 none; - line-height: inherit; - background: transparent url([[pix:t/add]]) no-repeat 7px 8px; - padding-left: 26px; - } - margin-bottom: 1em; } .options { diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index 07170473124..f1bc213ad81 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -37697,28 +37697,6 @@ p.arrow_button { .gradingform_rubric .criterion .scorevalue input.hiddenelement, .gradingform_rubric .criterion .scorevalue input.pseudotablink { width: 0; } -.gradingform_rubric .criterion .addlevel { - vertical-align: top; - padding-top: 6px; -} -.gradingform_rubric .criterion .addlevel input { - height: 30px; - line-height: 1rem; -} -.gradingform_rubric .addcriterion { - margin-left: 5px; - padding: 0; - margin-bottom: 1em; -} -.gradingform_rubric .addcriterion input { - margin: 0; - color: inherit; - text-shadow: inherit; - border: 0 none; - line-height: inherit; - background: transparent url([[pix:t/add]]) no-repeat 7px 8px; - padding-left: 26px; -} .gradingform_rubric .options { clear: both; } diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index 07848e854c1..2833f973ccc 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -37697,28 +37697,6 @@ p.arrow_button { .gradingform_rubric .criterion .scorevalue input.hiddenelement, .gradingform_rubric .criterion .scorevalue input.pseudotablink { width: 0; } -.gradingform_rubric .criterion .addlevel { - vertical-align: top; - padding-top: 6px; -} -.gradingform_rubric .criterion .addlevel input { - height: 30px; - line-height: 1rem; -} -.gradingform_rubric .addcriterion { - margin-left: 5px; - padding: 0; - margin-bottom: 1em; -} -.gradingform_rubric .addcriterion input { - margin: 0; - color: inherit; - text-shadow: inherit; - border: 0 none; - line-height: inherit; - background: transparent url([[pix:t/add]]) no-repeat 7px 8px; - padding-left: 26px; -} .gradingform_rubric .options { clear: both; }