diff --git a/blocks/myoverview/classes/output/courses_view.php b/blocks/myoverview/classes/output/courses_view.php index 6b146b18a62..90d871477a6 100644 --- a/blocks/myoverview/classes/output/courses_view.php +++ b/blocks/myoverview/classes/output/courses_view.php @@ -66,7 +66,9 @@ class courses_view implements renderable, templatable { $today = time(); // Build courses view data structure. - $coursesview = []; + $coursesview = [ + 'hascourses' => !empty($this->courses) + ]; // How many courses we have per status? $coursesbystatus = ['past' => 0, 'inprogress' => 0, 'future' => 0]; diff --git a/blocks/myoverview/classes/output/main.php b/blocks/myoverview/classes/output/main.php index 00a640e157b..193540fb496 100644 --- a/blocks/myoverview/classes/output/main.php +++ b/blocks/myoverview/classes/output/main.php @@ -59,10 +59,16 @@ class main implements renderable, templatable { $coursesummary = new course_summary($courses, $coursesprogress); $coursesview = new courses_view($courses, $coursesprogress); + $nocoursesurl = $output->pix_url('courses', 'block_myoverview')->out(); + $noeventsurl = $output->pix_url('activities', 'block_myoverview')->out(); return [ 'courses' => $coursesummary->export_for_template($output), 'coursesview' => $coursesview->export_for_template($output), + 'urls' => [ + 'nocourses' => $nocoursesurl, + 'noevents' => $noeventsurl + ] ]; } } diff --git a/blocks/myoverview/lang/en/block_myoverview.php b/blocks/myoverview/lang/en/block_myoverview.php index fd8c83fbc48..02b0832b354 100644 --- a/blocks/myoverview/lang/en/block_myoverview.php +++ b/blocks/myoverview/lang/en/block_myoverview.php @@ -26,12 +26,17 @@ $string['future'] = 'Future'; $string['inprogress'] = 'In progress'; $string['myoverview:addinstance'] = 'Add a new my overview block'; $string['myoverview:myaddinstance'] = 'Add a new my overview block to Dashboard'; +$string['nocourses'] = 'No courses'; +$string['nocoursesinprogress'] = 'No in progress courses'; +$string['nocoursesfuture'] = 'No future courses'; +$string['nocoursespast'] = 'No past courses'; $string['noevents'] = 'No upcoming activities due'; $string['next30days'] = 'Next 30 days'; $string['next7days'] = 'Next 7 days'; $string['past'] = 'Past'; $string['pluginname'] = 'My overview'; +$string['recentlyoverdue'] = 'Recently overdue'; $string['sortbycourses'] = 'Sort by courses'; $string['sortbydates'] = 'Sort by dates'; $string['timeline'] = 'Timeline'; -$string['recentlyoverdue'] = 'Recently overdue'; +$string['viewcourse'] = 'View course'; diff --git a/blocks/myoverview/pix/activities.svg b/blocks/myoverview/pix/activities.svg new file mode 100755 index 00000000000..3b5af3f0d00 --- /dev/null +++ b/blocks/myoverview/pix/activities.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blocks/myoverview/pix/courses.svg b/blocks/myoverview/pix/courses.svg new file mode 100755 index 00000000000..674b6192e76 --- /dev/null +++ b/blocks/myoverview/pix/courses.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/blocks/myoverview/templates/course-event-list.mustache b/blocks/myoverview/templates/course-event-list.mustache index 6fea4da8f0c..77cf57cbf9f 100644 --- a/blocks/myoverview/templates/course-event-list.mustache +++ b/blocks/myoverview/templates/course-event-list.mustache @@ -86,8 +86,14 @@ - {{#js}} diff --git a/blocks/myoverview/templates/courses-view.mustache b/blocks/myoverview/templates/courses-view.mustache index 45639890d32..baeb696a067 100644 --- a/blocks/myoverview/templates/courses-view.mustache +++ b/blocks/myoverview/templates/courses-view.mustache @@ -23,6 +23,7 @@ {} }}
+ {{#hascourses}}
{{#future}} @@ -56,6 +65,14 @@ {{$pagingcontentid}}pc-for-in-progress{{/pagingcontentid}} {{/ block_myoverview/courses-view-by-status }} {{/future}} + {{^future}} +
+ {{#str}} nocoursesfuture, block_myoverview {{/str}} +

{{#str}} nocoursesfuture, block_myoverview {{/str}}

+
+ {{/future}}
{{#past}} @@ -66,8 +83,25 @@ {{$pagingcontentid}}pc-for-in-progress{{/pagingcontentid}} {{/ block_myoverview/courses-view-by-status }} {{/past}} + {{^past}} +
+ {{#str}} nocoursespast, block_myoverview {{/str}} +

{{#str}} nocoursespast, block_myoverview {{/str}}

+
+ {{/past}}
+ {{/hascourses}} + {{^hascourses}} +
+ {{#str}} nocourses, block_myoverview {{/str}} +

{{#str}} nocourses, block_myoverview {{/str}}

+
+ {{/hascourses}}
{{#js}} require(['jquery', 'core/custom_interaction_events'], function($, customEvents) { diff --git a/blocks/myoverview/templates/event-list.mustache b/blocks/myoverview/templates/event-list.mustache index 898acd97a11..83f62347ac4 100644 --- a/blocks/myoverview/templates/event-list.mustache +++ b/blocks/myoverview/templates/event-list.mustache @@ -70,8 +70,11 @@ - {{#js}} diff --git a/blocks/myoverview/templates/paging-bar-item.mustache b/blocks/myoverview/templates/paging-bar-item.mustache index d4eeb89f610..955ff02d991 100644 --- a/blocks/myoverview/templates/paging-bar-item.mustache +++ b/blocks/myoverview/templates/paging-bar-item.mustache @@ -17,10 +17,14 @@ {{! @template block_myoverview/paging-bar-item - This template renders the each course block containing a summary and calendar events. + This template renders a single item in the paging bar. Example context (json): { + "url": "#", + "number": 1, + "page": "1", + "active": true } }}
  • {{#courses}} {{> block_myoverview/course-item }} {{/courses}} + {{^courses}} +
    + {{#str}} nocoursesinprogress, block_myoverview {{/str}} +

    {{#str}} nocoursesinprogress, block_myoverview {{/str}}

    +
    + {{/courses}} {{#js}} require(['jquery', 'block_myoverview/event_list_by_course'], function($, EventListByCourse) { var root = $("#timeline-view-courses-{{uniqid}}"); EventListByCourse.init(root); }); -{{/js}} \ No newline at end of file +{{/js}} diff --git a/theme/boost/scss/moodle/blocks.scss b/theme/boost/scss/moodle/blocks.scss index dfc85d30683..c988f38c251 100644 --- a/theme/boost/scss/moodle/blocks.scss +++ b/theme/boost/scss/moodle/blocks.scss @@ -177,4 +177,14 @@ $doughnut-fill-colour: $brand-warning; } } } + + .empty-placeholder-image-sm { + height: 70px; + width: 85px; + } + + .empty-placeholder-image-lg { + height: 125px; + width: 145px; + } } diff --git a/theme/bootstrapbase/less/moodle/blocks.less b/theme/bootstrapbase/less/moodle/blocks.less index fdb2840096c..9ecf8f4115a 100644 --- a/theme/bootstrapbase/less/moodle/blocks.less +++ b/theme/bootstrapbase/less/moodle/blocks.less @@ -352,4 +352,14 @@ } } } + + .empty-placeholder-image-sm { + height: 70px; + width: 85px; + } + + .empty-placeholder-image-lg { + height: 125px; + width: 145px; + } } diff --git a/theme/bootstrapbase/style/moodle.css b/theme/bootstrapbase/style/moodle.css index e5abbe5d921..66189fbb28c 100644 --- a/theme/bootstrapbase/style/moodle.css +++ b/theme/bootstrapbase/style/moodle.css @@ -16336,6 +16336,14 @@ body { .block_myoverview .event-list-item .event-name-container .event-name { display: block; } +.block_myoverview .empty-placeholder-image-sm { + height: 70px; + width: 85px; +} +.block_myoverview .empty-placeholder-image-lg { + height: 125px; + width: 145px; +} /** * Moodle forms HTML isn't changeable via renderers (yet?) so this * .less file imports styles from the bootstrap @variables file and diff --git a/theme/bootstrapbase/templates/block_myoverview/paging-bar.mustache b/theme/bootstrapbase/templates/block_myoverview/paging-bar.mustache index e023dd13a21..96d44d1f071 100644 --- a/theme/bootstrapbase/templates/block_myoverview/paging-bar.mustache +++ b/theme/bootstrapbase/templates/block_myoverview/paging-bar.mustache @@ -17,10 +17,36 @@ {{! @template block_myoverview/paging-bar - This template renders the each course block containing a summary and calendar events. + This template renders the bootstrap style paging bar. Example context (json): { + "pagingbar": { + "pagecount": 2, + "previous": {}, + "next": {}, + "first": { + "url": "#", + "page": "first" + }, + "last": { + "url": "#", + "page": "last" + }, + "pages": [ + { + "url": "#", + "number": 1, + "page": "1", + "active": true + }, + { + "url": "#", + "number": 2, + "page": "2" + } + ] + } } }} {{#pagingbar}}