first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,78 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/course-action-menu
This template renders action menu for each course.
Example context (json):
{
"isfavourite": true
}
}}
<div class="ml-auto dropdown">
<button class="btn btn-link btn-icon icon-size-3 coursemenubtn"
type="button"
data-toggle="dropdown"
aria-haspopup="true"
aria-expanded="false">
<i class="icon fa fa-ellipsis-v fa-fw m-0" title="{{#str}} aria:courseactions, block_myoverview {{/str}} {{{fullname}}}" aria-hidden="true"></i>
<span class="sr-only">{{#str}} aria:courseactions, block_myoverview {{/str}} {{{fullname}}}</span>
</button>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item {{#isfavourite}}hidden{{/isfavourite}}" href="#"
data-action="add-favourite"
data-course-id="{{id}}"
aria-controls="favorite-icon-{{ id }}-{{ uniqid }}"
>
{{#str}} addtofavourites, block_myoverview {{/str}}
<div class="sr-only">
{{#str}} aria:addtofavourites, block_myoverview {{/str}} {{{fullname}}}
</div>
</a>
<a class="dropdown-item {{^isfavourite}}hidden{{/isfavourite}}" href="#"
data-action="remove-favourite"
data-course-id="{{id}}"
aria-controls="favorite-icon-{{ id }}-{{ uniqid }}"
>
{{#str}} removefromfavourites, block_myoverview {{/str}}
<div class="sr-only">
{{#str}} aria:removefromfavourites, block_myoverview {{/str}} {{{fullname}}}
</div>
</a>
<a class="dropdown-item {{^hidden}}hidden{{/hidden}}" href="#"
data-action="show-course"
data-course-id="{{id}}"
aria-controls="favorite-icon-{{ id }}-{{ uniqid }}"
>
{{#str}} show, block_myoverview {{/str}}
<div class="sr-only">
{{#str}} aria:showcourse, block_myoverview, {{fullname}} {{/str}}
</div>
</a>
<a class="dropdown-item {{#hidden}}hidden{{/hidden}}" href="#"
data-action="hide-course"
data-course-id="{{id}}"
aria-controls="favorite-icon-{{ id }}-{{ uniqid }}"
>
{{#str}} hidecourse, block_myoverview {{/str}}
<div class="sr-only">
{{#str}} aria:hidecourse, block_myoverview, {{fullname}} {{/str}}
</div>
</a>
</div>
</div>
@@ -0,0 +1,47 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/courses-view
This template renders the courses view for the myoverview block.
Example context (json):
{
"nocoursesimg": "https://moodlesite/theme/image.php/boost/block_myoverview/1535727318/courses",
"newcourseurl": "https://moodlesite/course/edit.php",
"grouping": "all",
"sort": "fullname",
"view": "card"
}
}}
<div id="courses-view-{{uniqid}}"
data-region="courses-view"
data-display="{{view}}"
data-grouping="{{grouping}}"
data-customfieldname="{{customfieldname}}"
data-customfieldvalue="{{customfieldvalue}}"
data-sort="{{sort}}"
data-prev-display="{{view}}"
data-paging="{{paging}}"
data-nocoursesimg="{{nocoursesimg}}"
data-totalcoursecount="{{totalcoursecount}}"
data-displaycategories="{{displaycategories}}"
data-newcourseurl="{{newcourseurl}}">
<div data-region="course-view-content">
{{> block_myoverview/placeholders }}
</div>
</div>
+60
View File
@@ -0,0 +1,60 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/main
This template renders the main content area for the myoverview block.
Example context (json):
{}
}}
<div id="block-myoverview-{{uniqid}}" class="block-myoverview block-cards" data-region="myoverview" role="navigation">
<hr class="mt-0"/>
<div role="search" data-region="filter" class="d-flex align-items-center my-2" aria-label="{{#str}} aria:controls, block_myoverview {{/str}}">
<div class="row no-gutters">
{{> block_myoverview/nav-grouping-selector }}
{{> block_myoverview/nav-search-widget }}
{{> block_myoverview/nav-sort-selector }}
{{#displaydropdown}}
{{> block_myoverview/nav-display-selector }}
{{/displaydropdown}}
</div>
</div>
<div class="container-fluid p-0">
{{> block_myoverview/courses-view }}
</div>
</div>
{{#js}}
require(
[
'jquery',
'block_myoverview/main',
],
function(
$,
Main
) {
var root = $('#block-myoverview-{{uniqid}}');
Main.init(root);
});
{{/js}}
@@ -0,0 +1,47 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/nav-display-selector
This template renders display dropdown.
Example context (json):
{
"cards": true,
"list": false,
"summary": false
}
}}
<div class="dropdown mb-1">
<button id="displaydropdown" type="button" class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"
aria-label="{{#str}} aria:displaydropdown, block_myoverview {{/str}}">
<span data-active-item-text>
{{#card}}{{#str}} card, block_myoverview {{/str}}{{/card}}
{{#list}}{{#str}} list, block_myoverview {{/str}}{{/list}}
{{#summary}}{{#str}} summary, block_myoverview {{/str}}{{/summary}}
</span>
</button>
<ul class="dropdown-menu" role="menu" data-show-active-item data-skip-active-class="true" aria-labelledby="displaydropdown">
{{#layouts}}
<li>
<a class="dropdown-item" href="#" data-display-option="display" data-value="{{id}}" data-pref="{{id}}" aria-label="{{arialabel}}" aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#active}}aria-current="true"{{/active}}>
{{name}}
</a>
</li>
{{/layouts}}
</ul>
</div>
@@ -0,0 +1,150 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/nav-grouping-selector
This template renders grouping dropdown.
Example context (json):
{
"allincludinghidden": false,
"all": true,
"inprogress": false,
"future": false,
"past": false,
"favourites": false,
"hidden": false,
"displaygroupingallincludinghidden": false,
"displaygroupingall": true,
"displaygroupinginprogress": true,
"displaygroupingfuture": true,
"displaygroupingpast": true,
"displaygroupingfavourites": true,
"displaygroupinghidden": true,
"displaygroupingselector": true
}
}}
{{#displaygroupingselector}}
<div class="dropdown mb-1 mr-1">
<button id="groupingdropdown" type="button" class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="{{#str}} aria:groupingdropdown, block_myoverview {{/str}}">
<span data-active-item-text>
{{#allincludinghidden}}{{#str}} allincludinghidden, block_myoverview {{/str}}{{/allincludinghidden}}
{{#all}}{{#str}} all, block_myoverview {{/str}}{{/all}}
{{#inprogress}}{{#str}} inprogress, block_myoverview {{/str}}{{/inprogress}}
{{#future}}{{#str}} future, block_myoverview {{/str}}{{/future}}
{{#past}}{{#str}} past, block_myoverview {{/str}}{{/past}}
{{#favourites}}{{#str}} favourites, block_myoverview {{/str}}{{/favourites}}
{{#hidden}}{{#str}} hiddencourses, block_myoverview {{/str}}{{/hidden}}
{{selectedcustomfield}}
</span>
</button>
<ul class="dropdown-menu" role="menu" data-show-active-item data-skip-active-class="true" data-active-item-text aria-labelledby="groupingdropdown">
{{#displaygroupingallincludinghidden}}
<li>
<a class="dropdown-item" href="#" data-filter="grouping" data-value="allincludinghidden" data-pref="allincludinghidden" aria-label="{{#str}} aria:allcoursesincludinghidden, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#allincludinghidden}}aria-current="true"{{/allincludinghidden}}>
{{#str}} allincludinghidden, block_myoverview {{/str}}
</a>
</li>
{{/displaygroupingallincludinghidden}}
{{#displaygroupingall}}
<li class="dropdown-divider" role="presentation">
<span class="filler">&nbsp;</span>
</li>
<li>
<a class="dropdown-item" href="#" data-filter="grouping" data-value="all" data-pref="all" aria-label="{{#str}} aria:allcourses, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#all}}aria-current="true"{{/all}}>
{{#str}} all, block_myoverview {{/str}}
</a>
</li>
{{/displaygroupingall}}
{{#displaygroupinginprogress}}
<li class="dropdown-divider" role="presentation">
<span class="filler">&nbsp;</span>
</li>
<li>
<a class="dropdown-item" href="#" data-filter="grouping" data-value="inprogress" data-pref="inprogress" aria-label="{{#str}} aria:inprogress, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#inprogress}}aria-current="true"{{/inprogress}}>
{{#str}} inprogress, block_myoverview {{/str}}
</a>
</li>
{{/displaygroupinginprogress}}
{{#displaygroupingfuture}}
{{^displaygroupinginprogress}}
<li class="dropdown-divider" role="presentation">
<span class="filler">&nbsp;</span>
</li>
{{/displaygroupinginprogress}}
<li>
<a class="dropdown-item" href="#" data-filter="grouping" data-value="future" data-pref="future" aria-label="{{#str}} aria:future, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#future}}aria-current="true"{{/future}}>
{{#str}} future, block_myoverview {{/str}}
</a>
</li>
{{/displaygroupingfuture}}
{{#displaygroupingpast}}
{{^displaygroupinginprogress}}
{{^displaygroupingfuture}}
<li class="dropdown-divider" role="presentation">
<span class="filler">&nbsp;</span>
</li>
{{/displaygroupingfuture}}
{{/displaygroupinginprogress}}
<li>
<a class="dropdown-item" href="#" data-filter="grouping" data-value="past" data-pref="past" aria-label="{{#str}} aria:past, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#past}}aria-current="true"{{/past}}>
{{#str}} past, block_myoverview {{/str}}
</a>
</li>
{{/displaygroupingpast}}
{{#displaygroupingcustomfield}}
<li class="dropdown-divider" role="presentation">
<span class="filler">&nbsp;</span>
</li>
{{#customfieldvalues}}
<li>
<a class="dropdown-item" href="#" data-filter="grouping"
data-value="customfield" data-pref="customfield" data-customfieldvalue="{{value}}"
aria-label="{{#str}}aria:customfield, block_myoverview, {{name}}{{/str}}"
aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#active}}aria-current="true"{{/active}}>
{{name}}
</a>
</li>
{{/customfieldvalues}}
{{/displaygroupingcustomfield}}
{{#displaygroupingfavourites}}
<li class="dropdown-divider" role="presentation">
<span class="filler">&nbsp;</span>
</li>
<li>
<a class="dropdown-item" href="#" data-filter="grouping" data-value="favourites" data-pref="favourites" aria-label="{{#str}} aria:favourites, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#favourites}}aria-current="true"{{/favourites}}>
{{#str}} favourites, block_myoverview {{/str}}
</a>
{{/displaygroupingfavourites}}
{{#displaygroupinghidden}}
<li class="dropdown-divider" role="presentation">
<span class="filler">&nbsp;</span>
</li>
<li>
<a class="dropdown-item" href="#" data-filter="grouping" data-value="hidden" data-pref="hidden" aria-label="{{#str}} aria:hiddencourses, block_myoverview {{/str}}" aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#hidden}}aria-current="true"{{/hidden}}>
{{#str}} hiddencourses, block_myoverview {{/str}}
</a>
</li>
{{/displaygroupinghidden}}
</ul>
</div>
{{/displaygroupingselector}}
{{^displaygroupingselector}}
<div class="mb-1 mr-auto">
<span class="filler">&nbsp;</span>
</div>
{{/displaygroupingselector}}
@@ -0,0 +1,34 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/nav-search-widget
This template renders the search input within the filters area.
Example context (json):
{}
}}
<div class="mb-1 mr-1 flex-grow-1">
{{< core/search_input_auto }}
{{$label}}{{#str}}
searchcourses, block_myoverview
{{/str}}{{/label}}
{{$placeholder}}{{#str}}
search, core
{{/str}}{{/placeholder}}
{{/ core/search_input_auto }}
</div>
@@ -0,0 +1,58 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/nav-sort-selector
This template renders sorting dropdown.
Example context (json):
{
"title": false,
"lastaccessed": true
}
}}
<div class="mb-1 mr-1 d-flex flex-wrap align-items-center">
<div class="dropdown">
<button id="sortingdropdown" type="button" class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" aria-label="{{#str}} aria:sortingdropdown, block_myoverview {{/str}}">
<span data-active-item-text>
{{#title}}{{#str}} sortbytitle, block_myoverview {{/str}}{{/title}}
{{#lastaccessed}}{{#str}} sortbylastaccessed, block_myoverview {{/str}}{{/lastaccessed}}
{{#shortname}}{{#str}} sortbyshortname, block_myoverview {{/str}}{{/shortname}}
</span>
</button>
<ul class="dropdown-menu" role="menu" data-show-active-item data-skip-active-class="true" aria-labelledby="sortingdropdown">
<li>
<a class="dropdown-item" href="#" data-filter="sort" data-pref="title" data-value="fullname" aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#title}}aria-current="true"{{/title}}>
{{#str}} sortbytitle, block_myoverview {{/str}}
</a>
</li>
{{#showsortbyshortname}}
<li>
<a class="dropdown-item" href="#" data-filter="sort" data-pref="shortname" data-value="shortname" aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#shortname}}aria-current="true"{{/shortname}}>
{{#str}} sortbyshortname, block_myoverview {{/str}}
</a>
</li>
{{/showsortbyshortname}}
<li>
<a class="dropdown-item" href="#" data-filter="sort" data-pref="lastaccessed" data-value="ul.timeaccess desc" aria-controls="courses-view-{{uniqid}}" role="menuitem" {{#lastaccessed}}aria-current="true"{{/lastaccessed}}>
{{#str}} sortbylastaccessed, block_myoverview {{/str}}
</a>
</li>
</ul>
</div>
</div>
@@ -0,0 +1,34 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/placeholder-course-list-item
This template renders the loading placeholder for the list & summary course items.
Example context (json):
{}
}}
<li class="list-group-item course-listitem border-left-0 border-right-0 border-top-0 px-2 rounded-0">
<div class="row">
<div class="col-md-2 d-flex align-items-center">
<div class="bg-pulse-grey card-img w-100" style="height: 1rem; width: 1rem;"></div>
</div>
<div class="col-md-10 d-flex flex-column">
<div class="bg-pulse-grey w-50" style="height: 1rem; margin: 0.5rem 0"></div>
</div>
</div>
</li>
@@ -0,0 +1,49 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/placeholders
This template renders the loading placeholders for the myoverview block.
Example context (json):
{}
}}
<div data-region="loading-placeholder-content" aria-hidden="true">
{{#card}}
<div class="card-grid row row-cols-1 row-cols-sm-2 row-cols-md-3 mx-0 flex-nowrap overflow-hidden" style="height: 13rem">
<div class="col d-flex px-1">{{> core_course/placeholder-course }}</div>
<div class="col d-flex px-1">{{> core_course/placeholder-course }}</div>
<div class="col d-flex px-1">{{> core_course/placeholder-course }}</div>
</div>
{{/card}}
{{#list}}
<ul class="list-group">
{{> block_myoverview/placeholder-course-list-item }}
{{> block_myoverview/placeholder-course-list-item }}
{{> block_myoverview/placeholder-course-list-item }}
{{> block_myoverview/placeholder-course-list-item }}
</ul>
{{/list}}
{{#summary}}
<ul class="list-group">
{{> block_myoverview/placeholder-course-list-item }}
{{> block_myoverview/placeholder-course-list-item }}
{{> block_myoverview/placeholder-course-list-item }}
{{> block_myoverview/placeholder-course-list-item }}
</ul>
{{/summary}}
</div>
@@ -0,0 +1,30 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/progress-bar
This template renders a simple progress bar.
Example context (json):
{
"progress": 50
}
}}
<div class="progress-text">
<span class="sr-only">{{#str}}aria:courseprogress, block_myoverview{{/str}}</span>
{{#str}}completepercent, block_myoverview, <span>{{progress}}</span>{{/str}}
</div>
@@ -0,0 +1,75 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/view-cards
This template renders the cards view for the myoverview block.
Example context (json):
{
"courses": [
{
"name": "Assignment due 1",
"viewurl": "https://moodlesite/course/view.php?id=2",
"courseimage": "https://moodlesite/pluginfile/123/course/overviewfiles/123.jpg",
"fullname": "Course 3 for \"Statistical and Computational Tools\" ",
"hasprogress": true,
"progress": 10,
"coursecategory": "Category 1",
"visible": true
}
]
}
}}
{{< core_course/coursecards }}
{{$menu}}
<div class="card-footer menu border-0 bg-white ml-auto">
{{> block_myoverview/course-action-menu }}
</div>
{{/menu}}
{{$progress}}
{{#hasprogress}}
<div class="card-footer border-0 bg-white w-100">
{{> block_myoverview/progress-bar}}
</div>
{{/hasprogress}}
{{/progress}}
{{$coursename}}
<span class="multiline" title="{{fullname}}">
<span class="sr-only">{{{fullname}}}</span>
<span aria-hidden="true">
{{#shortentext}}55, {{{fullname}}} {{/shortentext}}
</span>
</span>
{{/coursename}}
{{$coursecategory}}
{{#showcoursecategory}}
<span class="sr-only">
{{#str}}aria:coursecategory, core_course{{/str}}
</span>
<span class="categoryname text-truncate">
{{{coursecategory}}}
</span>
{{/showcoursecategory}}
{{/coursecategory}}
{{$divider}}
{{#showcoursecategory}}
<div class="pl-1 pr-1">|</div>
{{/showcoursecategory}}
{{/divider}}
{{/ core_course/coursecards }}
@@ -0,0 +1,98 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/view-list
This template renders the list view for the myoverview block.
Example context (json):
{
"courses": [
{
"name": "Assignment due 1",
"viewurl": "https://moodlesite/course/view.php?id=2",
"courseimage": "https://moodlesite/pluginfile/123/course/overviewfiles/123.jpg",
"fullname": "course 3",
"hasprogress": true,
"progress": 10,
"coursecategory": "Category 1",
"visible": true
}
]
}
}}
<ul class="list-group">
{{#courses}}
<li class="list-group-item course-listitem border-left-0 border-right-0 border-top-0 px-2 rounded-0"
data-region="course-content"
data-course-id="{{{id}}}">
<div class="row">
<div class="col-md-2 d-flex align-items-center mb-sm-3 mb-md-0">
<a href="{{viewurl}}" tabindex="-1" class="mw-100 w-100">
<div class="rounded list-image mw-100" style='background-image: url("{{{courseimage}}}");'>
<span class="sr-only">{{fullname}}</span>
</div>
</a>
</div>
<div class="col-md-9 d-flex flex-column">
{{#showshortname}}
<div class="text-muted muted d-flex flex-wrap">
{{#showcoursecategory}}
<div class="pl-1 pr-1">|</div>
{{/showcoursecategory}}
<span class="sr-only">
{{#str}}aria:courseshortname, core_course{{/str}}
</span>
<div>{{{shortname}}}</div>
</div>
{{/showshortname}}
<a href="{{viewurl}}" class="aalink coursename">
{{> core_course/favouriteicon }}
<span class="sr-only">
{{#str}}aria:coursename, core_course{{/str}}
</span>
{{{fullname}}}
</a>
{{#showcoursecategory}}
<div class="text-muted muted d-flex flex-wrap">
<span class="sr-only">
{{#str}}aria:coursecategory, core_course{{/str}}
</span>
<span class="categoryname">
{{{coursecategory}}}
</span>
</div>
{{/showcoursecategory}}
{{^visible}}
<div class="d-flex flex-wrap">
<span class="badge bg-info text-white">{{#str}} hiddenfromstudents {{/str}}</span>
</div>
{{/visible}}
{{#hasprogress}}
<div class="text-muted muted d-flex flex-wrap mt-auto">
{{> block_myoverview/progress-bar}}
</div>
{{/hasprogress}}
</div>
<div class="col-md-1 p-0 d-flex menu">
{{> block_myoverview/course-action-menu }}
</div>
</div>
</li>
{{/courses}}
</ul>
@@ -0,0 +1,104 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/view-summary
This template renders the list view for the myoverview block.
Example context (json):
{
"courses": [
{
"name": "Assignment due 1",
"viewurl": "https://moodlesite/course/view.php?id=2",
"courseimage": "https://moodlesite/pluginfile/123/course/overviewfiles/123.jpg",
"fullname": "course 3",
"summary": "This course is about assignments",
"hasprogress": true,
"progress": 10,
"coursecategory": "Category 1",
"visible": true
}
]
}
}}
<div role="list">
{{#courses}}
<div class="course-summaryitem list-group-item course-listitem border-left-0 border-right-0 border-top-0 px-2 rounded-0" role="listitem"
data-region="course-content"
data-course-id="{{{id}}}">
<div class="row">
<div class="col-md-2 d-flex align-items-center mb-sm-3 mb-md-0">
<a href="{{viewurl}}" tabindex="-1" class="mw-100 w-100">
<div class="summary-image rounded mw-100" style='background-image: url("{{{courseimage}}}");'>
<span class="sr-only">{{fullname}}</span>
</div>
</a>
</div>
<div class="col-md-9 d-flex flex-column">
{{#showshortname}}
<div class="text-muted muted d-flex flex-wrap">
{{#showcoursecategory}}
<div class="pl-1 pr-1">|</div>
{{/showcoursecategory}}
<span class="sr-only">
{{#str}}aria:courseshortname, core_course{{/str}}
</span>
<div>{{{shortname}}}</div>
</div>
{{/showshortname}}
<a href="{{viewurl}}" class="aalink coursename">
{{> core_course/favouriteicon }}
<span class="sr-only">
{{#str}}aria:coursename, core_course{{/str}}
</span>
{{{fullname}}}
</a>
{{$coursecategory}}
<span class="sr-only">
{{#str}}aria:coursecategory, core_course{{/str}}
</span>
{{#showcoursecategory}}
<span class="categoryname">
{{#coursecategory}}
{{{coursecategory}}}
{{/coursecategory}}
</span>
{{/showcoursecategory}}
{{/coursecategory}}
{{^visible}}
<div class="d-flex flex-wrap">
<span class="badge bg-info text-white">{{#str}} hiddenfromstudents {{/str}}</span>
</div>
{{/visible}}
<div class="summary">
<span class="sr-only">{{#str}}aria:coursesummary, block_myoverview{{/str}}</span>
{{{summary}}}
</div>
{{#hasprogress}}
<div class="text-muted muted d-flex flex-wrap mt-auto">
{{> block_myoverview/progress-bar}}
</div>
{{/hasprogress}}
</div>
<div class="col-md-1 p-0 d-flex menu">
{{> block_myoverview/course-action-menu }}
</div>
</div>
</div>
{{/courses}}
</div>
@@ -0,0 +1,66 @@
{{!
This file is part of Moodle - http://moodle.org/
Moodle is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Moodle is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Moodle. If not, see <http://www.gnu.org/licenses/>.
}}
{{!
@template block_myoverview/zero-state
This template renders the main content area when there is no course to show.
Example context (json):
{
"nocoursesimg": "https://moodle.org/img/nocourses.svg",
"title": "No courses",
"text": "Moodle community",
"intro": "Come back later",
"buttons": [
{
"id": "buttons1",
"method": "get",
"url": "#",
"primary": true,
"label": "Button1"
},
{
"id": "buttons2",
"method": "get",
"url": "#",
"primary": false,
"label": "Button2"
}
]
}
}}
<div class="block-myoverview block-cards" data-region="myoverview" role="navigation">
<hr class="mt-0"/>
<div class="container-fluid p-0">
<div class="text-xs-center text-center mt-3" data-region="empty-message">
<img class="empty-placeholder-image-lg mt-1"
src="{{nocoursesimg}}"
alt=""
>
<h5 class="h5 mt-3 mb-0">{{{ title }}}</h5>
<p class="mt-3 mb-0">{{{ intro }}}</p>
<div class="mt-5 mb-0 whitebutton" id="action_bar">
{{#buttons}}
{{>core/single_button}}
{{/buttons}}
</div>
</div>
</div>
</div>