Skip to content

Commit

Permalink
MDL-59936 calendar: use icons in event summary modal
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwyllie authored and andrewnicols committed Oct 30, 2017
1 parent 368832d commit 4febb36
Show file tree
Hide file tree
Showing 8 changed files with 155 additions and 20 deletions.
73 changes: 53 additions & 20 deletions calendar/templates/event_summary_body.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,57 @@
}} data-action-event="{{isactionevent}}"{{!
}} data-edit-url="{{editurl}}"{{!
}}>
<h4>{{#str}} when, core_calendar {{/str}}</h4>
{{#userdate}} {{timestart}}, {{#str}} strftimerecentfull {{/str}} {{/userdate}}
<br>
{{#description}}
<h4>{{#str}} description {{/str}}</h4>
{{{description}}}
{{/description}}
<h4>{{#str}} eventtype, core_calendar {{/str}}</h4>
{{eventtype}}
{{#iscategoryevent}}
<div>{{{category.nestedname}}}</div>
{{/iscategoryevent}}
{{#iscourseevent}}
<div><a href="{{url}}">{{course.fullname}}</a></div>
{{/iscourseevent}}
{{> core_calendar/event_subscription}}
{{#groupname}}
<div><a href="{{url}}">{{{course.fullname}}}</a></div>
<div>{{{groupname}}}</div>
{{/groupname}}
<div class="container-fluid">
<div class="row">
<div class="col-xs-1">{{#pix}} i/calendareventtime, core, {{#str}} when, core_calendar {{/str}} {{/pix}}</div>
<div class="col-xs-11">{{#userdate}} {{timestart}}, {{#str}} strftimerecentfull {{/str}} {{/userdate}}</div>
</div>
<div class="row m-t-1">
<div class="col-xs-1">{{#pix}} i/calendar, core, {{#str}} eventtype, core_calendar {{/str}} {{/pix}}</div>
<div class="col-xs-11">{{eventtype}}</div>
</div>
{{#description}}
<div class="row m-t-1">
<div class="col-xs-1">{{#pix}} i/calendareventdescription, core, {{#str}} description {{/str}} {{/pix}}</div>
<div class="col-xs-11">{{{.}}}</div>
</div>
{{/description}}
{{#iscategoryevent}}
<div class="row m-t-1">
<div class="col-xs-1">{{#pix}} i/categoryevent, core, {{#str}} category {{/str}} {{/pix}}</div>
<div class="col-xs-11">{{{category.nestedname}}}</div>
</div>
{{/iscategoryevent}}
{{#iscourseevent}}
<div class="row m-t-1">
<div class="col-xs-1">{{#pix}} i/courseevent, core, {{#str}} course {{/str}} {{/pix}}</div>
<div class="col-xs-11"><a href="{{url}}">{{{course.fullname}}}</a></div>
</div>
{{/iscourseevent}}
{{#groupname}}
<div class="row m-t-1">
<div class="col-xs-1">{{#pix}} i/courseevent, core, {{#str}} course {{/str}} {{/pix}}</div>
<div class="col-xs-11"><a href="{{url}}">{{{course.fullname}}}</a></div>
</div>
<div class="row m-t-1">
<div class="col-xs-1">{{#pix}} i/groupevent, core, {{#str}} group {{/str}} {{/pix}}</div>
<div class="col-xs-11">{{{groupname}}}</div>
</div>
{{/groupname}}
{{#subscription}}
{{#displayeventsource}}
<div class="row m-t-1">
<div class="col-xs-1">{{#pix}} i/rss, core, {{#str}} eventsource, core_calendar {{/str}} {{/pix}}</div>
<div class="col-xs-11">
{{#url}}
<a href="{{url}}">{{#str}}subscriptionsource, core_calendar, {{name}}{{/str}}</a>
{{/url}}
{{^url}}
<p>{{#str}}subscriptionsource, core_calendar, {{name}}{{/str}}</p>
{{/url}}
</div>
</div>
{{/displayeventsource}}
{{/subscription}}
</div>
</div>
1 change: 1 addition & 0 deletions lang/en/calendar.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
$string['eventsall'] = 'All events';
$string['eventsdeleted'] = 'Events deleted';
$string['eventsimported'] = 'Events imported: {$a}';
$string['eventsource'] = 'Event source';
$string['eventsupdated'] = 'Events updated: {$a}';
$string['eventsfor'] = '{$a} events';
$string['eventskey'] = 'Events key';
Expand Down
2 changes: 2 additions & 0 deletions lib/classes/output/icon_system_fontawesome.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ public function get_core_icon_map() {
'core:i/badge' => 'fa-shield',
'core:i/calc' => 'fa-calculator',
'core:i/calendar' => 'fa-calendar',
'core:i/calendareventdescription' => 'fa-align-left',
'core:i/calendareventtime' => 'fa-clock-o',
'core:i/caution' => 'fa-exclamation text-warning',
'core:i/checked' => 'fa-check',
'core:i/checkpermissions' => 'fa-unlock-alt',
Expand Down
Binary file added pix/i/calendareventdescription.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions pix/i/calendareventdescription.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added pix/i/calendareventtime.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions pix/i/calendareventtime.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
{{!
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 core_calendar/event_summary_body
This template renders the body of calendar events summary modal.
Example context (json):
{
"timestart": 1490320388,
"description": "An random event description",
"eventtype": "User",
"source": "Ical imported",
"groupname": "Group 1"
}
}}
<div{{!
}} data-region="summary-modal-container"{{!
}} data-event-id="{{id}}"{{!
}} data-event-title="{{name}}"{{!
}} data-event-count="{{eventcount}}"{{!
}} data-event-="{{repeatid}}"{{!
}} data-action-event="{{isactionevent}}"{{!
}} data-edit-url="{{editurl}}"{{!
}}>
<div class="container-fluid">
<div class="row-fluid">
<div class="span1">{{#pix}} i/calendareventtime, core, {{#str}} when, core_calendar {{/str}} {{/pix}}</div>
<div class="span11">{{#userdate}} {{timestart}}, {{#str}} strftimerecentfull {{/str}} {{/userdate}}</div>
</div>
<div class="row-fluid m-t-1">
<div class="span1">{{#pix}} i/calendar, core, {{#str}} eventtype, core_calendar {{/str}} {{/pix}}</div>
<div class="span11">{{eventtype}}</div>
</div>
{{#description}}
<div class="row-fluid m-t-1">
<div class="span1">{{#pix}} i/calendareventdescription, core, {{#str}} description {{/str}} {{/pix}}</div>
<div class="span11">{{{.}}}</div>
</div>
{{/description}}
{{#iscategoryevent}}
<div class="row-fluid m-t-1">
<div class="span1">{{#pix}} i/categoryevent, core, {{#str}} category {{/str}} {{/pix}}</div>
<div class="span11">{{{category.nestedname}}}</div>
</div>
{{/iscategoryevent}}
{{#iscourseevent}}
<div class="row-fluid m-t-1">
<div class="span1">{{#pix}} i/courseevent, core, {{#str}} course {{/str}} {{/pix}}</div>
<div class="span11"><a href="{{url}}">{{{course.fullname}}}</a></div>
</div>
{{/iscourseevent}}
{{#groupname}}
<div class="row-fluid m-t-1">
<div class="span1">{{#pix}} i/courseevent, core, {{#str}} course {{/str}} {{/pix}}</div>
<div class="span11"><a href="{{url}}">{{{course.fullname}}}</a></div>
</div>
<div class="row-fluid m-t-1">
<div class="span1">{{#pix}} i/groupevent, core, {{#str}} group {{/str}} {{/pix}}</div>
<div class="span11">{{{groupname}}}</div>
</div>
{{/groupname}}
{{#subscription}}
{{#displayeventsource}}
<div class="row-fluid m-t-1">
<div class="span1">{{#pix}} i/rss, core, {{#str}} eventsource, core_calendar {{/str}} {{/pix}}</div>
<div class="span11">
{{#url}}
<a href="{{url}}">{{#str}}subscriptionsource, core_calendar, {{name}}{{/str}}</a>
{{/url}}
{{^url}}
<p>{{#str}}subscriptionsource, core_calendar, {{name}}{{/str}}</p>
{{/url}}
</div>
</div>
{{/displayeventsource}}
{{/subscription}}
</div>
</div>

0 comments on commit 4febb36

Please sign in to comment.