From 4e5f8579ab9b87a681630af99c80817726d131af Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Wed, 8 Mar 2023 17:18:54 +0100 Subject: [PATCH 1/5] better allignment of icons --- block_overviewmyrolesincourses.php | 43 ++++++++++++--------- styles.css | 28 +++++++++++--- templates/overviewmyrolesincourses.mustache | 32 ++++++++------- 3 files changed, 65 insertions(+), 38 deletions(-) diff --git a/block_overviewmyrolesincourses.php b/block_overviewmyrolesincourses.php index 2b4ec6c..f9c6d55 100644 --- a/block_overviewmyrolesincourses.php +++ b/block_overviewmyrolesincourses.php @@ -85,6 +85,7 @@ public function get_content() { $data->foldonstart = $foldonstart; $data->mylist = $this->get_courses_enroled_with_roleid($USER->id, $enroledcourses, $rolefixname->id, $favouritecourseids); + $data->counter = count($data->mylist); // To get example-json for mustache uncomment following line of code. // This can be uses to get a json-example $objectasjson = json_encode($data); // Now render the content for this role and concatenate it with the previous rendered content. @@ -255,35 +256,41 @@ private function create_duration(stdClass $course): stdClass { public function create_agenda(): string { $agenda = ""; if ($this->config->showpast) { - $agenda .= '
' . - '
' . - get_string('past', 'block_overviewmyrolesincourses') . - '
' . + $agenda .= '
' . + '
' . + '
' . + get_string('past', 'block_overviewmyrolesincourses') . + '
' . - '
' . - get_string('butnotvisible', 'block_overviewmyrolesincourses') . + '
' . + get_string('butnotvisible', 'block_overviewmyrolesincourses') . + '
' . '
' . '
'; } if ($this->config->showinprogress) { - $agenda .= '
' . - '
' . - get_string('inprogress', 'block_overviewmyrolesincourses') . - '
' . - '
' . - get_string('butnotvisible', 'block_overviewmyrolesincourses') . + $agenda .= '
' . + '
' . + '
' . + get_string('inprogress', 'block_overviewmyrolesincourses') . + '
' . + '
' . + get_string('butnotvisible', 'block_overviewmyrolesincourses') . + '
' . '
' . '
'; } if ($this->config->showfuture) { - $agenda .= '
' . - '
' . - get_string('future', 'block_overviewmyrolesincourses') . - '
' . - '
' . - get_string('butnotvisible', 'block_overviewmyrolesincourses') . + $agenda .= '
' . + '
' . + '
' . + get_string('future', 'block_overviewmyrolesincourses') . + '
' . + '
' . + get_string('butnotvisible', 'block_overviewmyrolesincourses') . + '
' . '
' . '
'; } diff --git a/styles.css b/styles.css index 518e452..c50d2b2 100644 --- a/styles.css +++ b/styles.css @@ -18,34 +18,34 @@ background-color: #eee; } -.overviewmyrolesincourses-coursefinished { +.col.overviewmyrolesincourses-coursefinished { border-left: solid 5px rgb(155, 13, 13); margin-bottom: 5px; padding-left: 5px; } -.overviewmyrolesincourses-coursefinished.dimmed { +.col.overviewmyrolesincourses-coursefinished.dimmed { border-left: solid 5px rgb(166, 119, 119); margin-bottom: 5px; padding-left: 5px; } -.overviewmyrolesincourses-courseinprogress { +.col.overviewmyrolesincourses-courseinprogress { border-left: solid 5px rgb(53, 244, 127); margin-bottom: 5px; padding-left: 5px; } -.overviewmyrolesincourses-courseinprogress.dimmed { +.col.overviewmyrolesincourses-courseinprogress.dimmed { border-left: solid 5px rgb(111, 169, 134); margin-bottom: 5px; padding-left: 5px; } -.overviewmyrolesincourses-coursefuture { +.col.overviewmyrolesincourses-coursefuture { border-left: solid 5px rgb(58, 132, 241); margin-bottom: 5px; padding-left: 5px; } -.overviewmyrolesincourses-coursefuture.dimmed { +.col.overviewmyrolesincourses-coursefuture.dimmed { border-left: solid 5px rgb(158, 190, 238); margin-bottom: 5px; padding-left: 5px; @@ -53,3 +53,19 @@ .overviewmyrolesincourses-foldonstart { display: none; } + +.row.duration { + margin-left: 0px; +} +.row.duration .col-8 { + padding-left: 0; +} +.row.duration .col-4 { + padding-right: 10px; +} + + +.overviewmyrolesincourses-tools { + text-align: right; +} + diff --git a/templates/overviewmyrolesincourses.mustache b/templates/overviewmyrolesincourses.mustache index c6b60a6..504a1a1 100644 --- a/templates/overviewmyrolesincourses.mustache +++ b/templates/overviewmyrolesincourses.mustache @@ -82,17 +82,26 @@ }
- {{rolelocalname}} + {{rolelocalname}} {{counter}}
+ class="{{#foldonstart}}overviewmyrolesincourses-foldonstart{{/foldonstart}}"> {{#mylist}} -
-
-
- - {{coursefullname}} - +
+
+ +
+
+ {{duration}} +
+
+ {{#favourite}} + ⭐ + {{/favourite}} {{^dimmed}}{{/dimmed}} {{#dimmed}}{{/dimmed}} {{#showdeleteicon}} @@ -100,14 +109,9 @@ {{/showdeleteicon}} - {{#favourite}} - ⭐ - {{/favourite}} -
-
- {{duration}}
+
{{/mylist}}
From 79912285ccf1f73a78105df2dfa26e21c2bfa907 Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Wed, 8 Mar 2023 17:28:40 +0100 Subject: [PATCH 2/5] fix wrong margin-bottom --- styles.css | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/styles.css b/styles.css index c50d2b2..4c2d12e 100644 --- a/styles.css +++ b/styles.css @@ -20,34 +20,34 @@ .col.overviewmyrolesincourses-coursefinished { border-left: solid 5px rgb(155, 13, 13); - margin-bottom: 5px; + margin-bottom: 0; padding-left: 5px; } .col.overviewmyrolesincourses-coursefinished.dimmed { border-left: solid 5px rgb(166, 119, 119); - margin-bottom: 5px; + margin-bottom: 0; padding-left: 5px; } .col.overviewmyrolesincourses-courseinprogress { border-left: solid 5px rgb(53, 244, 127); - margin-bottom: 5px; + margin-bottom: 0; padding-left: 5px; } .col.overviewmyrolesincourses-courseinprogress.dimmed { border-left: solid 5px rgb(111, 169, 134); - margin-bottom: 5px; + margin-bottom: 0; padding-left: 5px; } .col.overviewmyrolesincourses-coursefuture { border-left: solid 5px rgb(58, 132, 241); - margin-bottom: 5px; + margin-bottom: 0; padding-left: 5px; } .col.overviewmyrolesincourses-coursefuture.dimmed { border-left: solid 5px rgb(158, 190, 238); - margin-bottom: 5px; + margin-bottom: 0; padding-left: 5px; } .overviewmyrolesincourses-foldonstart { From 2b3f6637cc63e1788298610a60214760c92df168 Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Sat, 11 Mar 2023 17:47:56 +0100 Subject: [PATCH 3/5] add the word for course oder courses in the heading --- block_overviewmyrolesincourses.php | 4 ++++ templates/overviewmyrolesincourses.mustache | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/block_overviewmyrolesincourses.php b/block_overviewmyrolesincourses.php index f9c6d55..f4f6338 100644 --- a/block_overviewmyrolesincourses.php +++ b/block_overviewmyrolesincourses.php @@ -90,6 +90,10 @@ public function get_content() { // This can be uses to get a json-example $objectasjson = json_encode($data); // Now render the content for this role and concatenate it with the previous rendered content. if (count($data->mylist) > 0) { + $data->courses = get_string('course'); + if (count($data->mylist) > 1) { + $data->courses = get_string('courses'); + } $text .= $OUTPUT->render_from_template('block_overviewmyrolesincourses/overviewmyrolesincourses', $data); } } diff --git a/templates/overviewmyrolesincourses.mustache b/templates/overviewmyrolesincourses.mustache index 504a1a1..d5a73c9 100644 --- a/templates/overviewmyrolesincourses.mustache +++ b/templates/overviewmyrolesincourses.mustache @@ -82,7 +82,7 @@ }
- {{rolelocalname}} {{counter}} + {{rolelocalname}} {{counter}} {{courses}}
From 3a13aff665d2a3d1482d33d382d1d602ecd24c8d Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Sat, 11 Mar 2023 17:48:22 +0100 Subject: [PATCH 4/5] arrange icons to the right --- styles.css | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/styles.css b/styles.css index 4c2d12e..b742577 100644 --- a/styles.css +++ b/styles.css @@ -65,7 +65,14 @@ } + + + + .overviewmyrolesincourses-tools { text-align: right; } +.summary .no-overflow p { + margin-bottom: 0.5rem; +} From 9a1f734a9e705f92b48b4609ad0d174b295f6411 Mon Sep 17 00:00:00 2001 From: Andreas Schenkel Date: Sat, 11 Mar 2023 17:49:12 +0100 Subject: [PATCH 5/5] add changelogtext and bump version --- CHANGELOG.md | 6 ++++++ version.php | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2cd968..6ba3661 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,10 @@ ## Changelog ## +[[v1.4.1]] 20230311 + +- new feature: show how many courses a user is enroled with a role +- fix spacing problems with the agenda +- new position for the icons that indicates if a course is hidden + [[v1.4.0]] 20221211 - new feature: fold or unfold courselist on start diff --git a/version.php b/version.php index 5d43e6d..8142d6a 100644 --- a/version.php +++ b/version.php @@ -25,7 +25,7 @@ defined('MOODLE_INTERNAL') || die; $plugin->maturity = MATURITY_STABLE; -$plugin->version = 2022121100; +$plugin->version = 2023031100; $plugin->component = 'block_overviewmyrolesincourses'; $plugin->requires = 2017111300; -$plugin->release = 'v1.4.0'; +$plugin->release = 'v1.4.1';