Skip to content

Commit

Permalink
display the tools in a seperate row, add folder icon in front of cour…
Browse files Browse the repository at this point in the history
…secategoryname, add calender icon in front of duration, add langstring (category hidden) to the plugin instead of using core lang string
  • Loading branch information
Andreas Schenkel authored and Andreas Schenkel committed Jan 20, 2024
1 parent c7af5ed commit 467ece6
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 57 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,32 @@
## Changelog ##


[[v1.5.1]] 20240120
Reviewed version of pull request with some adaptions.
1. make seperator in heading configurable by css eg change margin between rolelocalname and seperator
2. default is not needed in langstring because there is a new heading for the section with the default settings
3. display the tools in a seperate row
4. add folder icon in front of coursecategoryname
5. add calender icon in front of duration
6. add langstring (category hidden) to the plugin instead of using core lang string

[[v1.5.0]] 20240120
add pullrequest from eLearning-TUDarmstadt

1. A top level category can be shown for the courses in table
- this is disabled by default, configurable and can be used with/ instead of/ without duration time ranges depending on users' preference
- moodle/category:viewhiddencategories permission is respected: category names are only displayed when they are visible or when the user is allowed to see them in course context, otherwise get_string('categoryhidden') is returned

2. Set background color of non-standard roles to #eee (equal to guest color) instead of white for better contrast
- the solution is not very clean and uses CSS wildcards, so we could modify or remove this part as needed

3. Added : between role name and amount of courses for readability, for example "Manager : 1 Course"

4. Simplified some expressions in code

5. Set required Moodle version to 4.0


[[v1.4.2]] 20240106
- changes in css and template
- add sr-only text for icon eye
Expand Down
4 changes: 2 additions & 2 deletions block_overviewmyrolesincourses.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,10 +276,10 @@ private function create_category(stdClass $course): string {
if ($topcategory->visible == 1 || has_capability('moodle/category:viewhiddencategories', $coursecontext)) {
return $topcategory->name;
} else {
return get_string('categoryhidden');
return get_string('categoryhidden', 'block_overviewmyrolesincourses');
}
} else {
return get_string('categoryhidden');
return get_string('categoryhidden', 'block_overviewmyrolesincourses');
}
}

Expand Down
1 change: 1 addition & 0 deletions lang/en/block_overviewmyrolesincourses.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
$string['agendanothidden'] = 'Not hidden courses';
$string['agendahidden'] = 'Hidden courses';
$string['butnotvisible'] = 'but not visible';
$string['categoryhidden'] = '(category hidden)';
$string['courseisnothidden'] = 'Course is not hidden';
$string['courseishidden'] = 'Course is hidden';
$string['defaultfoldonstart'] = 'Fold on start';
Expand Down
38 changes: 22 additions & 16 deletions styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,37 +23,43 @@ div[class*="overviewmyrolesincourses-bg-"]:not([class*="manager"]):not([class*="
background-color: #eee;
}

.col.overviewmyrolesincourses-coursefinished {
.overviewmyrolesincourses-coursefinished {
border-left: solid 5px rgb(155, 13, 13);
margin-bottom: 0;
padding-left: 5px;
padding-right: 5px;
}
.col.overviewmyrolesincourses-coursefinished.dimmed {
.overviewmyrolesincourses-coursefinished.dimmed {
border-left: solid 5px rgb(166, 119, 119);
margin-bottom: 0;
padding-left: 5px;
padding-right: 5px;
}

.col.overviewmyrolesincourses-courseinprogress {
.overviewmyrolesincourses-courseinprogress {
border-left: solid 5px rgb(53, 244, 127);
margin-bottom: 0;
padding-left: 5px;
padding-right: 5px;
}
.col.overviewmyrolesincourses-courseinprogress.dimmed {
.overviewmyrolesincourses-courseinprogress.dimmed {
border-left: solid 5px rgb(111, 169, 134);
margin-bottom: 0;
padding-left: 5px;
padding-right: 5px;
}

.col.overviewmyrolesincourses-coursefuture {
.overviewmyrolesincourses-coursefuture {
border-left: solid 5px rgb(58, 132, 241);
margin-bottom: 0;
padding-left: 5px;
padding-right: 5px;
}
.col.overviewmyrolesincourses-coursefuture.dimmed {
.overviewmyrolesincourses-coursefuture.dimmed {
border-left: solid 5px rgb(158, 190, 238);
margin-bottom: 0;
padding-left: 5px;
padding-right: 5px;
}
.overviewmyrolesincourses-foldonstart {
display: none;
Expand All @@ -69,20 +75,20 @@ div[class*="overviewmyrolesincourses-bg-"]:not([class*="manager"]):not([class*="
padding-right: 10px;
}

.row.category {
margin-left: 0;
}
.row.category .col-8 {
padding-left: 0;
}
.row.category .col-4 {
padding-right: 10px;
}

.overviewmyrolesincourses-tools {
text-align: right;
}

.overviewmyrolesincourses .summary .no-overflow p {
margin-bottom: 0.5rem;
}

.container .overviewmyrolesincourses-coursefinished,
.container .overviewmyrolesincourses-courseinprogress,
.container .overviewmyrolesincourses-coursefuture {
padding-left: 3px;
padding-right: 5px;
}



65 changes: 28 additions & 37 deletions templates/overviewmyrolesincourses.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -100,56 +100,47 @@
class="{{#foldonstart}}overviewmyrolesincourses-foldonstart{{/foldonstart}}">
{{#mylist}}
<div class="border">
<div class="col {{cssselectordurationstatusofcourse}} {{dimmed}}">
<div class="{{cssselectordurationstatusofcourse}} {{dimmed}}">
<div class="{{dimmed}}">
<a href="{{url}}" class="{{dimmed}}" title="{{coursefullname}}">
<i class="icon fa fa-graduation-cap fa-fw"></i>{{coursefullname}}
</a>
</div>

{{#usetimeranges}}
<div class="row duration">
<div class="{{dimmed}} col-8">
{{duration}}
</div>
<div class="col-4 overviewmyrolesincourses-tools">
{{#favourite}}
{{/favourite}}
{{^dimmed}}<span><i class="fa fa-eye" aria-hidden="true"></i></span>
<span class="sr-only">{{# str }} courseisnothidden, block_overviewmyrolesincourses {{/str}}</span>
{{/dimmed}}
{{#dimmed}}<span><i class="fa fa-eye-slash" aria-hidden="true"></i></span>
<span class="sr-only">{{# str }} courseishidden, block_overviewmyrolesincourses {{/str}}</span>
{{/dimmed}}
{{#showdeleteicon}}
<a href="{{urldelete}}">
<i class="fa fa-trash" aria-hidden="true"></i>
</a>
{{/showdeleteicon}}
<div class="duration">
<div class="{{dimmed}}">
<i class="fa fa-calendar" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="Zeitraum"></i> {{duration}}
</div>
</div>
{{/usetimeranges}}

{{#usecategories}}
<div class="row category">
<div class="{{dimmed}} col-8">
{{category}}
</div>
{{^usetimeranges}}
<div class="col-4 overviewmyrolesincourses-tools">
{{#favourite}}
{{/favourite}}
{{^dimmed}}<span><i class="fa fa-eye" aria-hidden="true"></i></span>{{/dimmed}}
{{#dimmed}}<span><i class="fa fa-eye-slash" aria-hidden="true"></i></span>{{/dimmed}}
{{#showdeleteicon}}
<a href="{{urldelete}}">
<i class="fa fa-trash" aria-hidden="true"></i>
</a>
{{/showdeleteicon}}
<div class="category">
<div class="{{dimmed}}">
<i class="fa fa-folder-o"></i> {{category}}
</div>
{{/usetimeranges}}
</div>
{{/usecategories}}

<div class="{{dimmed}} overviewmyrolesincourses-tools">
{{#favourite}}
{{/favourite}}
{{^dimmed}}<span><i class="fa fa-eye" aria-hidden="true"></i></span>
<span class="sr-only">{{# str }} courseisnothidden, block_overviewmyrolesincourses {{/str}}</span>
{{/dimmed}}
{{#dimmed}}<span><i class="fa fa-eye-slash" aria-hidden="true"></i></span>
<span class="sr-only">{{# str }} courseishidden, block_overviewmyrolesincourses {{/str}}</span>
{{/dimmed}}
{{#showdeleteicon}}
<a href="{{urldelete}}">
<i class="fa fa-trash" aria-hidden="true"></i>
</a>
{{/showdeleteicon}}
</div>


</div>
</div>
{{/mylist}}
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die;

$plugin->maturity = MATURITY_STABLE;
$plugin->version = 2023121900;
$plugin->version = 2024012000;
$plugin->component = 'block_overviewmyrolesincourses';
$plugin->requires = 2022041900; // Requires Moodle version 4.0 or higher.
$plugin->release = 'v1.4.1';
$plugin->release = 'v1.5.1';

0 comments on commit 467ece6

Please sign in to comment.