forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-57585 block_myoverview: add styling for timeline view in boost
Part of MDL-55611 epic.
- Loading branch information
1 parent
4cc0d2d
commit 0eb8556
Showing
13 changed files
with
306 additions
and
50 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
blocks/myoverview/templates/course-event-list-item.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
{{! | ||
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-event-list-item | ||
This template renders an event list item for the myoverview block | ||
in the courses view. | ||
Example context (json): | ||
{ | ||
"enddate": "Nov 4th, 10am", | ||
"name": "Assignment due 1", | ||
"url": "https://www.google.com", | ||
"action": { | ||
"name": "Submit assignment", | ||
"url": "https://www.google.com", | ||
"itemcount": 1 | ||
}, | ||
"icon": { | ||
"key": "icon", | ||
"component": "mod_assign", | ||
"alttext": "Assignment icon" | ||
} | ||
} | ||
}} | ||
<li class="list-group-item event-list-item" data-region="event-list-item"> | ||
<div class="row"> | ||
<div class="col-xs-12 col-lg-7"> | ||
<div class="d-inline-block icon-large event-icon"> | ||
{{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}} | ||
</div> | ||
<div class="d-inline-block event-name-container"> | ||
<a class="event-name text-truncate" href="{{{url}}}">{{name}}</a> | ||
<p class="text-muted text-truncate m-b-0"> | ||
{{#userdate}} {{timesort}}, {{#str}} strftimerecent {{/str}} {{/userdate}} | ||
</p> | ||
</div> | ||
</div> | ||
<div class="hidden-md-down col-lg-5 text-truncate"> | ||
{{#action.actionable}} | ||
<a class="m-r-1" href="{{{action.url}}}">{{action.name}}</a> | ||
{{#action.itemcount}} | ||
<span class="tag tag-pill tag-default">{{.}}</span> | ||
{{/action.itemcount}} | ||
{{/action.actionable}} | ||
{{^action.actionable}} | ||
<div class="text-muted">{{action.name}}</div> | ||
{{/action.actionable}} | ||
</div> | ||
</div> | ||
</li> |
61 changes: 61 additions & 0 deletions
61
blocks/myoverview/templates/course-event-list-items.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{{! | ||
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-event-list-items | ||
This template renders a group of event list items for the myoverview block | ||
sort by courses view. | ||
Example context (json): | ||
{ | ||
"events": [ | ||
{ | ||
"enddate": "Nov 4th, 10am", | ||
"name": "Assignment due 1", | ||
"url": "https://www.google.com", | ||
"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", | ||
"action": { | ||
"name": "Submit assignment", | ||
"url": "https://www.google.com", | ||
"itemcount": 1 | ||
}, | ||
"icon": { | ||
"key": "icon", | ||
"component": "mod_assign", | ||
"alttext": "Assignment icon" | ||
} | ||
} | ||
] | ||
} | ||
}} | ||
{{#events}} | ||
{{> block_myoverview/course-event-list-item }} | ||
{{/events}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{{! | ||
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-event-list | ||
This template renders a list of events for the myoverview block | ||
sort by courses view. | ||
Example context (json): | ||
{ | ||
} | ||
}} | ||
<div data-region="event-list-container" | ||
data-limit="{{$limit}}20{{/limit}}" | ||
data-course-id="{{$courseid}}{{/courseid}}" | ||
data-last-id="{{$lastid}}{{/lastid}}" | ||
id="event-list-container-{{$courseid}}{{/courseid}}"> | ||
|
||
<div data-region="event-list-content"> | ||
{{< block_myoverview/event-list-group }} | ||
{{$title}}{{#str}} today {{/str}}{{/title}} | ||
{{$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}} | ||
{{$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}} | ||
{{$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}} | ||
{{$startday}}30{{/startday}} | ||
{{$endday}}0{{/endday}} | ||
{{$eventlistitems}} | ||
{{> block_myoverview/course-event-list-items }} | ||
{{/eventlistitems}} | ||
{{/ block_myoverview/event-list-group }} | ||
|
||
<div class="text-xs-center text-center m-y-2"> | ||
<button type="button" class="btn btn-secondary" data-action="view-more"> | ||
{{#str}} viewmore {{/str}} | ||
<span class="hidden" data-region="loading-icon-container"> | ||
{{> core/loading }} | ||
</span> | ||
</button> | ||
</div> | ||
</div> | ||
<div class="hidden" data-region="empty-message"> | ||
<p class="text-muted">{{#str}} noevents, block_myoverview {{/str}}</p> | ||
</div> | ||
</div> | ||
{{#js}} | ||
require(['jquery', 'block_myoverview/event_list'], function($, EventList) { | ||
var root = $("#event-list-container-{{$courseid}}{{/courseid}}"); | ||
EventList.registerEventListeners(root); | ||
}); | ||
{{/js}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.