Skip to content

Commit 54922dd

Browse files
committed
MDL-84981 core_grades: Improve penalty status icon accessibility and styling
1 parent 4a43bd6 commit 54922dd

File tree

4 files changed

+28
-7
lines changed

4 files changed

+28
-7
lines changed

grade/templates/penalty_status.mustache

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,23 @@
2626
}}
2727

2828
{{#isexempt}}
29-
<span class="gradepenalty-status" data-bs-toggle="tooltip" title="{{exemptioninfo}}">
30-
{{#pix}}{{exemptionicon.name}}, {{exemptionicon.component}}, {{exemptioninfo}}{{/pix}}
31-
</span>
29+
<span class="gradepenaltystatus" data-bs-toggle="tooltip" title="{{exemptioninfo}}"><!-- Prevent whitespace
30+
-->{{#pix}}{{exemptionicon.name}}, {{exemptionicon.component}}, {{exemptioninfo}}{{/pix}}</span>
3231
{{/isexempt}}
3332
{{^isexempt}}
3433
{{#penaltyapplied}}
35-
<span class="gradepenalty-status" data-bs-toggle="tooltip" title="{{penaltyinfo}}">
36-
{{#pix}}{{penaltyicon.name}}, {{penaltyicon.component}}, {{penaltyinfo}}{{/pix}}
37-
</span>
34+
<span class="gradepenaltystatus" data-bs-toggle="tooltip" title="{{penaltyinfo}}"><!-- Prevent whitespace
35+
-->{{#pix}}{{penaltyicon.name}}, {{penaltyicon.component}}, {{penaltyinfo}}{{/pix}}</span>
3836
{{/penaltyapplied}}
3937
{{/isexempt}}
4038

4139
{{#js}}
4240
require(['theme_boost/bootstrap/tooltip'], function(Tooltip) {
4341
// Re-init the tooltip to ensure those dynamically added through AJAX are initialized
44-
document.querySelectorAll('.penalty-status[data-bs-toggle="tooltip"]').forEach(tooltipElement => {
42+
document.querySelectorAll('.gradepenaltystatus[data-bs-toggle="tooltip"]').forEach(tooltipElement => {
4543
Tooltip.getInstance(tooltipElement)?.dispose();
4644
new Tooltip(tooltipElement);
45+
tooltipElement.querySelector('i[title]').removeAttribute('title');
4746
});
4847
});
4948
{{/js}}

theme/boost/scss/moodle/grade.scss

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,3 +758,11 @@
758758
.gradestatus .icon {
759759
margin-right: 1rem;
760760
}
761+
762+
.gradepenaltystatus {
763+
padding: 6px;
764+
765+
.icon {
766+
margin: 0;
767+
}
768+
}

theme/boost/style/moodle.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38039,6 +38039,13 @@ p.arrow_button {
3803938039
margin-right: 1rem;
3804038040
}
3804138041

38042+
.gradepenaltystatus {
38043+
padding: 6px;
38044+
}
38045+
.gradepenaltystatus .icon {
38046+
margin: 0;
38047+
}
38048+
3804238049
.columns-autoflow-1to1to1 {
3804338050
column-count: 3;
3804438051
}

theme/classic/style/moodle.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38039,6 +38039,13 @@ p.arrow_button {
3803938039
margin-right: 1rem;
3804038040
}
3804138041

38042+
.gradepenaltystatus {
38043+
padding: 6px;
38044+
}
38045+
.gradepenaltystatus .icon {
38046+
margin: 0;
38047+
}
38048+
3804238049
.columns-autoflow-1to1to1 {
3804338050
column-count: 3;
3804438051
}

0 commit comments

Comments
 (0)