diff --git a/block_overviewmyrolesincourses.php b/block_overviewmyrolesincourses.php index 4ac967c..b0e7624 100644 --- a/block_overviewmyrolesincourses.php +++ b/block_overviewmyrolesincourses.php @@ -76,11 +76,17 @@ public function get_content() { // 4. To mark favourite courses get the ids $favouritecourseids = self::get_favourite_course_ids($USER->id); // 5. Check for every role if the role is supported and then in which courses the user has this role. + $coreroles = ['manager', 'coursecreator', 'editingteacher', 'teacher', 'student']; foreach ($rolefixnames as $rolefixname) { $data = new stdClass(); if (in_array($rolefixname->id, $configuredsupportedroles)) { // 5. If role is supported then add look in the enrolled courses if the user is enrolled with this role. $data->roleshortname = $rolefixname->shortname; + if (in_array($rolefixname->shortname, $coreroles)) { + $data->iscorerole = true; + } else { + $data->iscorerole = false; + } $data->rolelocalname = $rolefixname->localname; $data->foldonstart = $foldonstart; $data->mylist = $this->get_courses_enroled_with_roleid( diff --git a/styles.css b/styles.css index a7eabe6..67e6acb 100644 --- a/styles.css +++ b/styles.css @@ -19,7 +19,7 @@ background-color: #ddd; } -div[class*="overviewmyrolesincourses-bg-"]:not([class*="manager"]):not([class*="editingteacher"]):not([class*="teacher"]):not([class*="student"]) { +.overviewmyrolesincourses .isnotcorerole { background-color: #eee; } @@ -29,6 +29,7 @@ div[class*="overviewmyrolesincourses-bg-"]:not([class*="manager"]):not([class*=" padding-left: 5px; padding-right: 5px; } + .overviewmyrolesincourses-coursefinished.dimmed { border-left: solid 5px rgb(166, 119, 119); margin-bottom: 0; @@ -42,6 +43,7 @@ div[class*="overviewmyrolesincourses-bg-"]:not([class*="manager"]):not([class*=" padding-left: 5px; padding-right: 5px; } + .overviewmyrolesincourses-courseinprogress.dimmed { border-left: solid 5px rgb(111, 169, 134); margin-bottom: 0; @@ -55,12 +57,14 @@ div[class*="overviewmyrolesincourses-bg-"]:not([class*="manager"]):not([class*=" padding-left: 5px; padding-right: 5px; } + .overviewmyrolesincourses-coursefuture.dimmed { border-left: solid 5px rgb(158, 190, 238); margin-bottom: 0; padding-left: 5px; padding-right: 5px; } + .overviewmyrolesincourses-foldonstart { display: none; } @@ -68,9 +72,11 @@ div[class*="overviewmyrolesincourses-bg-"]:not([class*="manager"]):not([class*=" .overviewmyrolesincourses .row.duration { margin-left: 0; } + .overviewmyrolesincourses .row.duration .col-8 { padding-left: 0; } + .overviewmyrolesincourses .row.duration .col-4 { padding-right: 10px; } @@ -89,6 +95,3 @@ div[class*="overviewmyrolesincourses-bg-"]:not([class*="manager"]):not([class*=" padding-left: 3px; padding-right: 5px; } - - - diff --git a/templates/overviewmyrolesincourses.mustache b/templates/overviewmyrolesincourses.mustache index fe7a110..f4235be 100644 --- a/templates/overviewmyrolesincourses.mustache +++ b/templates/overviewmyrolesincourses.mustache @@ -90,7 +90,7 @@ element.classList.toggle("overviewmyrolesincourses-foldonstart"); } -