-
Bug
-
Resolution: Fixed
-
Minor
-
2.8.9, 2.9.3, 3.0, 3.7.5, 3.8.2, 3.8.3, 3.9
-
MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
MOODLE_38_STABLE
-
MDL-52138-master-take4 -
With the clean theme. When you go to the gradebook (i.e. /grade/report/grader/index.php) and the floating headers appear, then the backgrounds are all the same instead of matching the rows that they represent.
Whilst attempting to solve this I also discovered that when gradebook editing is on (there is a 'edit' parameter) in the URL, that the 'odd' and 'even' rows flip over with no classes being added to the body tag etc. so that CSS can adapt.
The solution is to have a class reacting to the code:
$editparam = optional_param('edit', false, PARAM_BOOL); // Are we editing?
|
...
|
if ($editparam) {
|
$sectionclasses .= ' editing';
|
}
|
echo '<section id="region-main" class="' . $sectionclasses . '">';
|
with the LESS:
.path-grade-report-grader .gradeparent {
|
tr:nth-of-type(odd) .cell {
|
color: @themeTextColour;
|
background-color: @themeColour;
|
a, a:hover {
|
color: inherit;
|
}
|
}
|
tr:nth-of-type(even) .cell {
|
background-color: @bodyBackground;
|
}
|
}
|
|
.path-grade-report-grader .gradeparent .floater {
|
&.heading .cell.header {
|
a {
|
color: @linkColor;
|
&:hover, &:focus {
|
color: @linkColorHover;
|
}
|
}
|
}
|
.cell:nth-of-type(odd), &.lastrow .cell.header {
|
color: @themeTextColour;
|
background-color: @themeColour;
|
a, a:hover, a:focus {
|
color: inherit;
|
}
|
}
|
.cell:nth-of-type(even), &.heading .cell.header {
|
background-color: @bodyBackground;
|
}
|
}
|
|
// When editing things flip, sort of!
|
.path-grade-report-grader #region-main.editing .gradeparent .floater {
|
.cell:nth-of-type(even), .cell.header.controls {
|
color: @themeTextColour;
|
background-color: @themeColour;
|
a, a:hover, a:focus {
|
color: inherit;
|
}
|
}
|
.cell:nth-of-type(odd), &.heading .cell.header, &.lastrow .cell.header {
|
color: inherit;
|
background-color: @bodyBackground;
|
a {
|
color: @linkColor;
|
&:hover, &:focus {
|
color: @linkColorHover;
|
}
|
}
|
}
|
}
|
Where this from one of my private themes, to convert to 'bootstrapbase', '@themeColour' is the same as the navbar background and '@themeTextColour' the navbar text. The rest are standard bootstrap variables.