MDL-37624 calendar: Added location support

This commit is contained in:
Michael Hawkins
2018-06-29 10:46:54 +08:00
parent f61ee4e857
commit ef4e04ee26
39 changed files with 290 additions and 27 deletions
@@ -253,6 +253,11 @@
.side {
width: 22px;
}
.location {
clear: both;
word-break: break-all;
overflow-wrap: break-word;
}
.description {
background-color: @white;
clear: both;
@@ -416,4 +421,8 @@
margin: 0;
}
}
.location-content {
overflow-wrap: break-word;
}
}
+8
View File
@@ -5790,6 +5790,11 @@ img.iconsmall {
.path-calendar .maincalendar .eventlist .event .side {
width: 22px;
}
.path-calendar .maincalendar .eventlist .event .location {
clear: both;
word-break: break-all;
overflow-wrap: break-word;
}
.path-calendar .maincalendar .eventlist .event .description {
background-color: #fff;
clear: both;
@@ -5915,6 +5920,9 @@ img.iconsmall {
.summary-modal-container .description-content > p {
margin: 0;
}
.summary-modal-container .location-content {
overflow-wrap: break-word;
}
/* course.less */
/* COURSE CONTENT */
/* stylelint-disable unit-blacklist */
@@ -0,0 +1,77 @@
{{!
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 calendar/event_item
Calendar event item.
The purpose of this template is to render the event item.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div{{!
}} data-type="event"{{!
}} data-course-id="{{course.id}}"{{!
}} data-event-id="{{id}}"{{!
}} class="event"{{!
}} data-eventtype-{{calendareventtype}}="1"{{!
}} data-event-title="{{name}}"{{!
}} data-event-count="{{eventcount}}"{{!
}}>
<div class="card">
<div class="box card-header clearfix p-y-1">
<div class="commands pull-xs-right">
{{#canedit}}
{{#candelete}}
<a href="{{deleteurl}}" data-action="delete">
{{#pix}}t/delete, core, {{#str}}delete{{/str}}{{/pix}}
</a>
{{/candelete}}
<a href="{{editurl}}" data-action="edit">
{{#pix}}t/edit, core, {{#str}}edit{{/str}}{{/pix}}
</a>
{{/canedit}}
</div>
{{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}}
<h3 class="name d-inline-block">{{name}}</h3>
<span class="date pull-xs-right m-r-1">{{{formattedtime}}}</span>
<div class="location">{{#location}}{{{location}}}{{/location}}</div>
</div>
<div class="description card-block calendar_event_{{eventtype}}">
<p>{{{description}}}</p>
{{#iscourseevent}}
<div><a href="{{url}}">{{course.fullname}}</a></div>
{{/iscourseevent}}
{{> core_calendar/event_subscription}}
{{#isactionevent}}
<a href="{{url}}">{{#str}} gotoactivity, core_calendar {{/str}}</a>
{{/isactionevent}}
{{#groupname}}
<div><a href="{{url}}">{{{course.fullname}}}</a></div>
<div>{{{groupname}}}</div>
{{/groupname}}
</div>
</div>
</div>
@@ -23,6 +23,7 @@
{
"timestart": 1490320388,
"description": "An random event description",
"location": "13th floor, building 42",
"eventtype": "User",
"source": "Ical imported",
"groupname": "Group 1"
@@ -53,6 +54,12 @@
<div class="description-content span11">{{{.}}}</div>
</div>
{{/description}}
{{#location}}
<div class="row-fluid m-t-1">
<div class="span1">{{#pix}} i/location, core, {{#str}} location {{/str}} {{/pix}}</div>
<div class="location-content span11">{{{.}}}</div>
</div>
{{/location}}
{{#isactionevent}}
<div class="row-fluid m-t-1">
<div class="span1">{{#pix}} i/courseevent, core, {{#str}} course {{/str}} {{/pix}}</div>