From 6d3872d06fd795312c652cace838dda959324b1c Mon Sep 17 00:00:00 2001 From: Shamim Rezaie Date: Wed, 19 Oct 2022 20:39:52 +1100 Subject: [PATCH] MDL-75423 gradereport_singleview: Move action col to the right --- grade/report/singleview/classes/local/screen/grade.php | 8 ++++---- grade/report/singleview/classes/local/screen/user.php | 8 ++++---- theme/boost/scss/moodle/tables.scss | 3 ++- theme/boost/style/moodle.css | 3 ++- theme/classic/style/moodle.css | 3 ++- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/grade/report/singleview/classes/local/screen/grade.php b/grade/report/singleview/classes/local/screen/grade.php index 427c58603ea..db774a0d71c 100644 --- a/grade/report/singleview/classes/local/screen/grade.php +++ b/grade/report/singleview/classes/local/screen/grade.php @@ -172,8 +172,8 @@ class grade extends tablelike implements selectable_items, filterable_items { */ public function original_headers() { return [ - '', // For filter icon. get_string('fullnameuser', 'core'), + '', // For filter icon. get_string('grade', 'grades'), get_string('range', 'grades'), get_string('feedback', 'grades'), @@ -222,9 +222,9 @@ class grade extends tablelike implements selectable_items, filterable_items { $formatteddefinition = $this->format_definition($grade); $line = [ + html_writer::link($url, $userpic . $fullname), $OUTPUT->action_icon($this->format_link('user', $item->id), new pix_icon('t/editstring', ''), null, ['title' => $iconstring, 'aria-label' => $iconstring]), - html_writer::link($url, $userpic . $fullname), $formatteddefinition['finalgrade'], $this->item_range(), $formatteddefinition['feedback'], @@ -232,8 +232,8 @@ class grade extends tablelike implements selectable_items, filterable_items { $formatteddefinition['exclude'], ]; $lineclasses = [ - 'action', 'user', + 'action', 'grade', 'range', ]; @@ -241,7 +241,7 @@ class grade extends tablelike implements selectable_items, filterable_items { $i = 0; foreach ($line as $key => $value) { $cell = new \html_table_cell($value); - if ($isheader = $i == 1) { + if ($isheader = $i == 0) { $cell->header = $isheader; $cell->scope = "row"; } diff --git a/grade/report/singleview/classes/local/screen/user.php b/grade/report/singleview/classes/local/screen/user.php index 9a4d651b824..1cabbbbf108 100644 --- a/grade/report/singleview/classes/local/screen/user.php +++ b/grade/report/singleview/classes/local/screen/user.php @@ -135,8 +135,8 @@ class user extends tablelike implements selectable_items { */ public function original_headers(): array { return [ - '', // For filter icon. get_string('assessmentname', 'gradereport_singleview'), + '', // For filter icon. get_string('gradecategory', 'grades'), get_string('grade', 'grades'), get_string('range', 'grades'), @@ -189,9 +189,9 @@ class user extends tablelike implements selectable_items { $formatteddefinition = $this->format_definition($grade); $line = [ + $this->format_icon($item) . $lockicon . $itemlabel, $OUTPUT->action_icon($this->format_link('grade', $item->id), new pix_icon('t/editstring', ''), null, ['title' => $iconstring, 'aria-label' => $iconstring]), - $this->format_icon($item) . $lockicon . $itemlabel, $this->category($item), $formatteddefinition['finalgrade'], new range($item), @@ -200,8 +200,8 @@ class user extends tablelike implements selectable_items { $formatteddefinition['exclude'], ]; $lineclasses = [ - 'action', 'gradeitem', + 'action', 'category', 'grade', 'range', @@ -211,7 +211,7 @@ class user extends tablelike implements selectable_items { $i = 0; foreach ($line as $key => $value) { $cell = new \html_table_cell($value); - if ($isheader = $i == 1) { + if ($isheader = $i == 0) { $cell->header = $isheader; $cell->scope = "row"; } diff --git a/theme/boost/scss/moodle/tables.scss b/theme/boost/scss/moodle/tables.scss index b7e08bb8cab..bbfbc952018 100644 --- a/theme/boost/scss/moodle/tables.scss +++ b/theme/boost/scss/moodle/tables.scss @@ -11,7 +11,8 @@ border-top: $table-border-width solid $table-border-color; } - thead th { + thead th, + thead td { vertical-align: bottom; border-bottom: (2 * $table-border-width) solid $table-border-color; } diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index 705f7ddd5f7..1e1bd167ea8 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -19166,7 +19166,8 @@ img.userpicture { padding: 0.75rem; vertical-align: top; border-top: 1px solid #dee2e6; } - .generaltable thead th { + .generaltable thead th, + .generaltable thead td { vertical-align: bottom; border-bottom: 2px solid #dee2e6; } .generaltable tbody + tbody { diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index 094d2283dee..0b5b30d126a 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -19166,7 +19166,8 @@ img.userpicture { padding: 0.75rem; vertical-align: top; border-top: 1px solid #dee2e6; } - .generaltable thead th { + .generaltable thead th, + .generaltable thead td { vertical-align: bottom; border-bottom: 2px solid #dee2e6; } .generaltable tbody + tbody {