Skip to content

Commit

Permalink
MDL-68404 gradingform_rubric: Style "Add level" button.
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaboesch committed Apr 28, 2020
1 parent f570a79 commit e944a8f
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 36 deletions.
2 changes: 1 addition & 1 deletion grade/grading/form/rubric/renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function criterion_template($mode, $options, $elementname = '{NAME}', $cr
if ($mode == gradingform_rubric_controller::DISPLAY_EDIT_FULL) {
$value = get_string('criterionaddlevel', 'gradingform_rubric');
$button = html_writer::empty_tag('input', array('type' => 'submit', 'name' => '{NAME}[criteria][{CRITERION-id}][levels][addlevel]',
'id' => '{NAME}-criteria-{CRITERION-id}-levels-addlevel', 'value' => $value));
'id' => '{NAME}-criteria-{CRITERION-id}-levels-addlevel', 'value' => $value, 'class' => 'btn btn-secondary'));
$criteriontemplate .= html_writer::tag('td', $button, array('class' => 'addlevel'));
}
$displayremark = ($options['enableremarks'] && ($mode != gradingform_rubric_controller::DISPLAY_VIEW || $options['showremarksstudent']));
Expand Down
9 changes: 2 additions & 7 deletions grade/grading/form/rubric/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,14 @@

.gradingform_rubric.editor .addcriterion input,
.gradingform_rubric.editor .addlevel input {
background: transparent url([[pix:t/add]]) no-repeat top left;
background: #fff url([[pix:t/add]]) no-repeat 7px 8px;
display: block;
color: #555;
font-weight: bold;
text-decoration: none;
}

.gradingform_rubric.editor .addcriterion input {
background-position: 5px 8px;
height: 30px;
line-height: 29px;
margin-bottom: 14px;
Expand All @@ -236,11 +235,7 @@
}

.gradingform_rubric.editor .addlevel input {
background-position: 5px 5px;
height: 25px;
line-height: 24px;
margin-bottom: 45px;
padding-left: 18px;
padding-left: 24px;
padding-right: 8px;
}

Expand Down
17 changes: 3 additions & 14 deletions theme/boost/scss/moodle/grade.scss
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,6 @@
}
}

.gradingform_rubric.editor {
.addlevel,
.addcriterion {
input {
// Fallback for IE8: we use Bootstrap 2's button styles normally, but
// IE8 ignores background-image: linear-gradient rules.
background: #fff none no-repeat top left;
}
}
}

#rubric-rubric {
&.gradingform_rubric {
#rubric-criteria {
Expand Down Expand Up @@ -185,12 +174,12 @@
}

.addlevel {
vertical-align: middle;
vertical-align: top;
padding-top: 6px;

input {
background-position: 0 0;
height: 30px;
margin-right: 5px;
line-height: 1rem;
}
}
}
Expand Down
10 changes: 3 additions & 7 deletions theme/boost/style/moodle.css
Original file line number Diff line number Diff line change
Expand Up @@ -17398,10 +17398,6 @@ p.arrow_button {
#page-grade-grading-form-rubric-edit .gradingform_rubric_editform .status {
font-size: 70%; }

.gradingform_rubric.editor .addlevel input,
.gradingform_rubric.editor .addcriterion input {
background: #fff none no-repeat top left; }

#rubric-rubric.gradingform_rubric #rubric-criteria {
margin-bottom: 1em; }
#rubric-rubric.gradingform_rubric #rubric-criteria .criterion .description {
Expand Down Expand Up @@ -17445,11 +17441,11 @@ p.arrow_button {
#rubric-rubric.gradingform_rubric #rubric-criteria .criterion .scorevalue input.hiddenelement, #rubric-rubric.gradingform_rubric #rubric-criteria .criterion .scorevalue input.pseudotablink {
width: 0; }
#rubric-rubric.gradingform_rubric #rubric-criteria .criterion .addlevel {
vertical-align: middle; }
vertical-align: top;
padding-top: 6px; }
#rubric-rubric.gradingform_rubric #rubric-criteria .criterion .addlevel input {
background-position: 0 0;
height: 30px;
margin-right: 5px; }
line-height: 1rem; }

#rubric-rubric.gradingform_rubric .addcriterion {
margin-left: 5px;
Expand Down
10 changes: 3 additions & 7 deletions theme/classic/style/moodle.css
Original file line number Diff line number Diff line change
Expand Up @@ -17630,10 +17630,6 @@ p.arrow_button {
#page-grade-grading-form-rubric-edit .gradingform_rubric_editform .status {
font-size: 70%; }

.gradingform_rubric.editor .addlevel input,
.gradingform_rubric.editor .addcriterion input {
background: #fff none no-repeat top left; }

#rubric-rubric.gradingform_rubric #rubric-criteria {
margin-bottom: 1em; }
#rubric-rubric.gradingform_rubric #rubric-criteria .criterion .description {
Expand Down Expand Up @@ -17677,11 +17673,11 @@ p.arrow_button {
#rubric-rubric.gradingform_rubric #rubric-criteria .criterion .scorevalue input.hiddenelement, #rubric-rubric.gradingform_rubric #rubric-criteria .criterion .scorevalue input.pseudotablink {
width: 0; }
#rubric-rubric.gradingform_rubric #rubric-criteria .criterion .addlevel {
vertical-align: middle; }
vertical-align: top;
padding-top: 6px; }
#rubric-rubric.gradingform_rubric #rubric-criteria .criterion .addlevel input {
background-position: 0 0;
height: 30px;
margin-right: 5px; }
line-height: 1rem; }

#rubric-rubric.gradingform_rubric .addcriterion {
margin-left: 5px;
Expand Down

0 comments on commit e944a8f

Please sign in to comment.