MDL-59936 calendar: use icons in event summary modal

This commit is contained in:
Ryan Wyllie 2017-10-24 06:57:12 +00:00 committed by Andrew Nicols
parent 368832d51c
commit 4febb36efe
8 changed files with 155 additions and 20 deletions

View File

@ -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>

View File

@ -108,6 +108,7 @@ $string['eventrepeat'] = 'Repeats';
$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';

View File

@ -195,6 +195,8 @@ class icon_system_fontawesome extends icon_system_font {
'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',

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 B

View File

@ -0,0 +1,3 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 -1 16 16" preserveAspectRatio="xMinYMid meet" overflow="visible"><path d="M0 12h16v2H0v-2zm10-3H0v2h10V9zM0 8h16V6H0v2zm10-5H0v2h10V3zm6-1V0H0v2h16z" fill="#999"/></svg>

After

Width:  |  Height:  |  Size: 400 B

BIN
pix/i/calendareventtime.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 273 B

View File

@ -0,0 +1,3 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
<!ENTITY ns_flows "http://ns.adobe.com/Flows/1.0/">
]><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" preserveAspectRatio="xMinYMid meet" overflow="visible"><path d="M11.9 13.4c.3-.2.5-.4.8-.7 1.3-1.3 2-2.9 2-4.8s-.7-3.4-2-4.8c-1.3-1.3-2.9-2-4.8-2s-3.4.7-4.8 2c-1.3 1.3-2 2.9-2 4.8s.7 3.4 2 4.8c.3.3.5.5.8.7l-.8 1.8c-.1.2 0 .5.2.7.2.1.5 0 .7-.2l.9-1.7c.9.5 2 .7 3.1.7s2.2-.2 3.1-.7l.8 1.7c.1.2.4.4.7.2.2-.1.4-.4.2-.7l-.9-1.8zm-3.9.3c-1.6 0-2.9-.5-4-1.7-1.1-1.1-1.7-2.4-1.7-4S2.8 5.1 4 4c1.1-1.1 2.4-1.7 4-1.7s2.9.5 4 1.7c1.1 1.1 1.7 2.4 1.7 4s-.5 2.9-1.7 4c-1.1 1.2-2.4 1.7-4 1.7zm0-6l2.6 2.1-.7.8-2.8-2.2c-.1-.1-.2-.2-.2-.4V4.6H8v3.1zm3.2-6.2L12 0c1.8.9 3.1 2.2 4 4l-1.5.8c-.7-1.5-1.8-2.6-3.3-3.3zM1.5 4.8L0 4C.9 2.2 2.2.9 4 0l.8 1.5c-1.5.7-2.6 1.8-3.3 3.3z" fill="#999"/></svg>

After

Width:  |  Height:  |  Size: 917 B

View File

@ -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>