diff --git a/theme/bootstrapbase/less/moodle/blocks.less b/theme/bootstrapbase/less/moodle/blocks.less index 7e987a350d3..caf8d62b06e 100644 --- a/theme/bootstrapbase/less/moodle/blocks.less +++ b/theme/bootstrapbase/less/moodle/blocks.less @@ -332,7 +332,19 @@ } .block_myoverview { + background-color: transparent; + .event-list-item { + border-bottom: 1px solid @tableBorder; + padding-bottom: 10px; + margin-bottom: 10px; + + &:last-of-type { + border-bottom: none; + padding-bottom: 0; + margin-bottom: 0; + } + .event-icon { vertical-align: middle; @@ -368,4 +380,13 @@ height: 220px; overflow-y: hidden; } + + h4 { + font-weight: normal; + } + + .well { + background-color: @white; + box-shadow: none; + } } diff --git a/theme/bootstrapbase/style/moodle.css b/theme/bootstrapbase/style/moodle.css index 307e0cfdd0e..b768807005c 100644 --- a/theme/bootstrapbase/style/moodle.css +++ b/theme/bootstrapbase/style/moodle.css @@ -16365,6 +16365,19 @@ body { height: 35px; width: 35px; } +.block_myoverview { + background-color: transparent; +} +.block_myoverview .event-list-item { + border-bottom: 1px solid #ddd; + padding-bottom: 10px; + margin-bottom: 10px; +} +.block_myoverview .event-list-item:last-of-type { + border-bottom: none; + padding-bottom: 0; + margin-bottom: 0; +} .block_myoverview .event-list-item .event-icon { vertical-align: middle; } @@ -16393,6 +16406,13 @@ body { height: 220px; overflow-y: hidden; } +.block_myoverview h4 { + font-weight: normal; +} +.block_myoverview .well { + background-color: #fff; + box-shadow: none; +} /** * 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/course-event-list-item.mustache b/theme/bootstrapbase/templates/block_myoverview/course-event-list-item.mustache index 011b20d9982..dddcf240c13 100644 --- a/theme/bootstrapbase/templates/block_myoverview/course-event-list-item.mustache +++ b/theme/bootstrapbase/templates/block_myoverview/course-event-list-item.mustache @@ -22,13 +22,15 @@ Example context (json): { - "enddate": "Nov 4th, 10am", "name": "Assignment due 1", "url": "https://www.google.com", + "timesort": 1490320388, "action": { "name": "Submit assignment", "url": "https://www.google.com", - "itemcount": 1 + "itemcount": 1, + "showitemcount": true, + "actionable": true }, "icon": { "key": "icon", @@ -37,24 +39,26 @@ } } }} -
  • -
    -
    +
  • +
    +
    {{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}}
    {{name}} -
    - {{#userdate}} {{timesort}}, {{#str}} strftimerecent {{/str}} {{/userdate}} +
    + {{#userdate}} {{timesort}}, {{#str}} strftimerecent {{/str}} {{/userdate}}
    -
    +
    {{#action.actionable}} {{action.name}} {{#action.itemcount}} - {{.}} + {{#action.showitemcount}} + {{.}} + {{/action.showitemcount}} {{/action.itemcount}} {{/action.actionable}} {{^action.actionable}} @@ -62,4 +66,30 @@ {{/action.actionable}}
    +
    +
    +
    + {{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}} +
    +
    + {{name}} +
    + {{#userdate}} {{timesort}}, {{#str}} strftimerecent {{/str}} {{/userdate}} +
    +
    +
    +
    +
    +
    +
    + {{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}} +
    +
    + {{name}} +
    + {{#userdate}} {{timesort}}, {{#str}} strftimerecent {{/str}} {{/userdate}} +
    +
    +
    +
  • diff --git a/theme/bootstrapbase/templates/block_myoverview/course-event-list.mustache b/theme/bootstrapbase/templates/block_myoverview/course-event-list.mustache new file mode 100644 index 00000000000..555966effef --- /dev/null +++ b/theme/bootstrapbase/templates/block_myoverview/course-event-list.mustache @@ -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 . +}} +{{! + @template block_myoverview/course-event-list + + This template renders a list of events for the myoverview block + sort by courses view. + + Example context (json): + { + } +}} +
    + +
    + {{< block_myoverview/event-list-group }} + {{$title}}{{#str}} recentlyoverdue, block_myoverview {{/str}}{{/title}} + {{$extratitleclasses}}text-danger{{/extratitleclasses}} + {{$startday}}-14{{/startday}} + {{$endday}}0{{/endday}} + {{$eventlistitems}} + {{> block_myoverview/course-event-list-items }} + {{/eventlistitems}} + {{/ block_myoverview/event-list-group }} + {{< block_myoverview/event-list-group }} + {{$title}}{{#str}} today {{/str}}{{/title}} + {{$extratitleclasses}}{{/extratitleclasses}} + {{$startday}}0{{/startday}} + {{$endday}}1{{/endday}} + {{$eventlistitems}} + {{> block_myoverview/course-event-list-items }} + {{/eventlistitems}} + {{/ block_myoverview/event-list-group }} + {{< block_myoverview/event-list-group }} + {{$title}}{{#str}} next7days, block_myoverview {{/str}}{{/title}} + {{$extratitleclasses}}{{/extratitleclasses}} + {{$startday}}1{{/startday}} + {{$endday}}7{{/endday}} + {{$eventlistitems}} + {{> block_myoverview/course-event-list-items }} + {{/eventlistitems}} + {{/ block_myoverview/event-list-group }} + {{< block_myoverview/event-list-group }} + {{$title}}{{#str}} next30days, block_myoverview {{/str}}{{/title}} + {{$extratitleclasses}}{{/extratitleclasses}} + {{$startday}}7{{/startday}} + {{$endday}}30{{/endday}} + {{$eventlistitems}} + {{> block_myoverview/course-event-list-items }} + {{/eventlistitems}} + {{/ block_myoverview/event-list-group }} + {{< block_myoverview/event-list-group }} + {{$title}}{{#str}} future, block_myoverview {{/str}}{{/title}} + {{$extratitleclasses}}{{/extratitleclasses}} + {{$startday}}30{{/startday}} + {{$endday}}{{/endday}} + {{$eventlistitems}} + {{> block_myoverview/course-event-list-items }} + {{/eventlistitems}} + {{/ block_myoverview/event-list-group }} + +
    + +
    +
    + +
    +{{#js}} +require(['jquery', 'block_myoverview/event_list'], function($, EventList) { + var root = $("#event-list-container-{{$courseid}}{{/courseid}}"); + EventList.registerEventListeners(root); +}); +{{/js}} diff --git a/theme/bootstrapbase/templates/block_myoverview/course-item.mustache b/theme/bootstrapbase/templates/block_myoverview/course-item.mustache index c136af2c039..9a8289f4919 100644 --- a/theme/bootstrapbase/templates/block_myoverview/course-item.mustache +++ b/theme/bootstrapbase/templates/block_myoverview/course-item.mustache @@ -23,25 +23,23 @@ { "shortname": "course 3", "viewurl": "https://www.google.com", - "startdate": "Nov 1th, 10am", - "enddate": "Nov 4th, 10am", + "startdate": 1490320388, + "enddate": 1490320388, "summary": "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout." } }} -
  • +
  • -
    -
    -
    - {{> block_myoverview/course-summary }} -
    -
    - {{< block_myoverview/course-event-list }} - {{$limit}}10{{/limit}} - {{$offset}}0{{/offset}} - {{$courseid}}{{id}}{{/courseid}} - {{/ block_myoverview/course-event-list }} -
    +
    +
    + {{> block_myoverview/course-summary }} +
    +
    + {{< block_myoverview/course-event-list }} + {{$limit}}10{{/limit}} + {{$offset}}0{{/offset}} + {{$courseid}}{{id}}{{/courseid}} + {{/ block_myoverview/course-event-list }}
    diff --git a/theme/bootstrapbase/templates/block_myoverview/course-paging-content-item.mustache b/theme/bootstrapbase/templates/block_myoverview/course-paging-content-item.mustache new file mode 100644 index 00000000000..c536b4c5142 --- /dev/null +++ b/theme/bootstrapbase/templates/block_myoverview/course-paging-content-item.mustache @@ -0,0 +1,50 @@ +{{! + 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 . +}} +{{! + @template block_myoverview/course-paging-content-item + + This template renders each course block. + + Example context (json): + { + "page": 1, + "active": true, + "courses": [ + { + "fullnamedisplay": "course 1", + "viewurl": "https://www.google.com", + "startdate": 1490252232, + "enddate": 1490252232, + "summary": "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout." + }, + { + "fullnamedisplay": "course 2", + "viewurl": "https://www.google.com", + "startdate": 1490252232, + "enddate": 1490252232, + "summary": "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout." + } + ] + } +}} +{{< block_myoverview/paging-content-item }} + {{$content}} + {{#courses}} + {{> block_myoverview/courses-view-course-item }} + {{/courses}} + {{/content}} +{{/ block_myoverview/paging-content-item }} diff --git a/theme/bootstrapbase/templates/block_myoverview/course-summary.mustache b/theme/bootstrapbase/templates/block_myoverview/course-summary.mustache new file mode 100644 index 00000000000..e0220cc70f3 --- /dev/null +++ b/theme/bootstrapbase/templates/block_myoverview/course-summary.mustache @@ -0,0 +1,57 @@ +{{! + 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 . +}} +{{! + @template block_myoverview/course-summary + + This template renders the course summary (view by courses) for the myoverview block. + + Example context (json): + { + "fullnamedisplay": "course 3", + "viewurl": "https://www.google.com", + "startdate": 1490320388, + "enddate": 1490320388, + "summary": "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout." + } +}} +
    +
    + {{> block_myoverview/progress-chart}} +

    {{fullnamedisplay}}

    +
    +
    +
    +
    +
    + {{> block_myoverview/progress-chart}} +
    +
    + +
    +
    +

    + {{#userdate}}{{startdate}}, {{#str}}strftimedate, langconfig{{/str}}{{/userdate}} + {{#enddate}} + - {{#userdate}}{{enddate}}, {{#str}}strftimedate, langconfig{{/str}}{{/userdate}} + {{/enddate}} +

    +

    + {{#shortentext}} 140, {{{summary}}}{{/shortentext}} +

    +
    diff --git a/theme/bootstrapbase/templates/block_myoverview/courses-view-course-item.mustache b/theme/bootstrapbase/templates/block_myoverview/courses-view-course-item.mustache new file mode 100644 index 00000000000..753fa6327f1 --- /dev/null +++ b/theme/bootstrapbase/templates/block_myoverview/courses-view-course-item.mustache @@ -0,0 +1,53 @@ +{{! + 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 . +}} +{{! + @template block_myoverview/course-view-course-item + + This template renders the course summary (view by courses) for the myoverview block. + + Example context (json): + { + "shortname": "course 3", + "viewurl": "https://www.google.com", + "startdate": "Nov 1th, 10am", + "enddate": "Nov 4th, 10am", + "summary": "It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout." + } +}} +
    +
    +
    +
    +
    + {{> block_myoverview/progress-chart}} +
    +
    + +
    +

    + {{#userdate}}{{startdate}}, {{#str}}strftimedate, langconfig{{/str}}{{/userdate}} + {{#enddate}} + - {{#userdate}}{{enddate}}, {{#str}}strftimedate, langconfig{{/str}}{{/userdate}} + {{/enddate}} +

    +

    + {{#shortentext}} 140, {{{summary}}}{{/shortentext}} +

    +
    +
    diff --git a/theme/bootstrapbase/templates/block_myoverview/courses-view.mustache b/theme/bootstrapbase/templates/block_myoverview/courses-view.mustache new file mode 100644 index 00000000000..b8a9dee10f5 --- /dev/null +++ b/theme/bootstrapbase/templates/block_myoverview/courses-view.mustache @@ -0,0 +1,114 @@ +{{! + 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 . +}} +{{! + @template block_myoverview/courses-view + + This template renders the courses view for the myoverview block. + + Example context (json): + {} +}} +
    + {{#hascourses}} + +
    +
    + {{#inprogress}} + {{< block_myoverview/courses-view-by-status }} + {{$id}}courses-view-in-progress{{/id}} + {{$status}}1{{/status}} + {{$pagingbarid}}pb-for-in-progress{{/pagingbarid}} + {{$pagingcontentid}}pc-for-in-progress{{/pagingcontentid}} + {{/ block_myoverview/courses-view-by-status }} + {{/inprogress}} + {{^inprogress}} +
    + {{#str}} nocoursesinprogress, block_myoverview {{/str}} +

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

    +
    + {{/inprogress}} +
    +
    + {{#future}} + {{< block_myoverview/courses-view-by-status }} + {{$id}}courses-view-future{{/id}} + {{$status}}2{{/status}} + {{$pagingbarid}}pb-for-future{{/pagingbarid}} + {{$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}} + {{< block_myoverview/courses-view-by-status }} + {{$id}}courses-view-past{{/id}} + {{$status}}0{{/status}} + {{$pagingbarid}}pb-for-past{{/pagingbarid}} + {{$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) { + var root = $('#courses-view-{{uniqid}}'); + customEvents.define(root, [customEvents.events.activate]); + root.on(customEvents.events.activate, '[data-toggle="btns"] > .btn', function() { + root.find('.btn.active').removeClass('active'); + }); +}); +{{/js}} diff --git a/theme/bootstrapbase/templates/block_myoverview/event-list-group.mustache b/theme/bootstrapbase/templates/block_myoverview/event-list-group.mustache new file mode 100644 index 00000000000..2fd6bfbae87 --- /dev/null +++ b/theme/bootstrapbase/templates/block_myoverview/event-list-group.mustache @@ -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 . +}} +{{! + @template block_myoverview/event-list-group + + This template renders a list of events for the myoverview block. + + Example context (json): + { + "events": [ + { + "enddate": "Nov 4th, 10am", + "name": "Assignment due 1", + "url": "https://www.google.com", + "course": { + "fullname": "Course 1" + }, + "action": { + "name": "Submit assignment", + "url": "https://www.google.com", + "itemcount": 1 + }, + "icon": { + "key": "icon", + "component": "mod_assign", + "alttext": "Assignment icon" + } + }, + { + "enddate": "Nov 4th, 10am", + "name": "Assignment due 2", + "url": "https://www.google.com", + "course": { + "fullname": "Course 1" + }, + "action": { + "name": "Submit assignment", + "url": "https://www.google.com", + "itemcount": 1 + }, + "icon": { + "key": "icon", + "component": "mod_assign", + "alttext": "Assignment icon" + } + } + ] + } +}} + diff --git a/theme/bootstrapbase/templates/block_myoverview/event-list-item.mustache b/theme/bootstrapbase/templates/block_myoverview/event-list-item.mustache index 5c02670e117..931ca5bba77 100644 --- a/theme/bootstrapbase/templates/block_myoverview/event-list-item.mustache +++ b/theme/bootstrapbase/templates/block_myoverview/event-list-item.mustache @@ -21,16 +21,18 @@ Example context (json): { - "enddate": "Nov 4th, 10am", "name": "Assignment due 1", "url": "https://www.google.com", + "timesort": 1490320388, "course": { "fullnamedisplay": "Course 1" }, "action": { "name": "Submit assignment", "url": "https://www.google.com", - "itemcount": 1 + "itemcount": 1, + "showitemcount": true, + "actionable": true }, "icon": { "key": "icon", @@ -39,18 +41,18 @@ } } }} -
  • -
    +
  • +
    {{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}}
    {{name}} -
    {{course.fullnamedisplay}}
    +
    {{course.fullnamedisplay}}
    -
    +
    {{#userdate}} {{timesort}}, {{#str}} strftimerecent {{/str}} {{/userdate}} @@ -59,7 +61,9 @@ {{#action.actionable}} {{action.name}} {{#action.itemcount}} - {{.}} + {{#action.showitemcount}} + {{.}} + {{/action.showitemcount}} {{/action.itemcount}} {{/action.actionable}} {{^action.actionable}} @@ -68,13 +72,33 @@
    -
    +
    +
    +
    +
    + {{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}} +
    +
    + {{name}} +
    {{course.fullnamedisplay}}
    +
    +
    +
    + {{#userdate}} {{timesort}}, {{#str}} strftimerecent {{/str}} {{/userdate}} +
    +
    +
    +
    +
    + {{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}} +
    +
    + {{name}} +
    {{course.fullnamedisplay}}
    +
    {{#userdate}} {{timesort}}, {{#str}} strftimerecent {{/str}} {{/userdate}}
    -
    - {{#userdate}} {{timesort}}, {{#str}} strftimerecent {{/str}} {{/userdate}} -
  • diff --git a/theme/bootstrapbase/templates/block_myoverview/timeline-view.mustache b/theme/bootstrapbase/templates/block_myoverview/timeline-view.mustache index 7c11a3daf6b..9ccdb7d4325 100644 --- a/theme/bootstrapbase/templates/block_myoverview/timeline-view.mustache +++ b/theme/bootstrapbase/templates/block_myoverview/timeline-view.mustache @@ -24,7 +24,7 @@ }}