first commit

This commit is contained in:
CHIEFSOFT\ameye
2024-09-30 18:11:26 -04:00
commit e592ca6823
27270 changed files with 5002257 additions and 0 deletions
@@ -0,0 +1,43 @@
{{!
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/add_event_button
Button to launch the "Add new event" dialogue.
The purpose of this template is to render the button used to generate the new event dialogue.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
"defaulteventcontext": "2"
}
}}
{{#defaulteventcontext}}
<button{{!
}} class="btn btn-primary float-sm-right float-right"{{!
}} data-context-id="{{defaulteventcontext}}"{{!
}} data-action="new-event-button"{{!
}}>
{{#str}}newevent, core_calendar{{/str}}
</button>
{{/defaulteventcontext}}
+44
View File
@@ -0,0 +1,44 @@
{{!
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/calendar_day
Calendar day view.
The purpose of this template is to render the calendar day view.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
"iscalendarblock": false
}
}}
<div id="calendar-day-{{uniqid}}" data-template="core_calendar/day_detailed">
{{> core_calendar/header}}
{{> core_calendar/day_detailed}}
</div>
{{#js}}
require(['jquery', 'core_calendar/calendar_view'], function($, CalendarView) {
const isCalendarBlock = {{#iscalendarblock}}true{{/iscalendarblock}}{{^iscalendarblock}}false{{/iscalendarblock}};
CalendarView.init($("#calendar-day-{{uniqid}}"), 'day', isCalendarBlock);
});
{{/js}}
+46
View File
@@ -0,0 +1,46 @@
{{!
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/calendar_mini
Calendar month view for blocks.
The purpose of this template is to render the month view for blocks.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div{{!
}} id="calendar-month-{{date.year}}-{{date.mon}}-{{uniqid}}" {{!
}} data-template="core_calendar/month_mini" {{!
}} data-includenavigation="{{#includenavigation}}true{{/includenavigation}}{{^includenavigation}}false{{/includenavigation}}"{{!
}} data-mini="true"{{!
}}>
{{> core_calendar/month_mini}}
</div>
{{#js}}
require(['jquery', 'core_calendar/calendar_mini'], function($, CalendarMini) {
CalendarMini.init($("#calendar-month-{{date.year}}-{{date.mon}}-{{uniqid}}"), !{{initialeventsloaded}});
});
{{/js}}
@@ -0,0 +1,44 @@
{{!
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/calendar_month
Calendar month view for blcoks.
The purpose of this template is to render the main, detailed monthly view.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
"iscalendarblock": false
}
}}
<div id="calendar-month-{{uniqid}}-{{calendarinstanceid}}" data-template="core_calendar/month_detailed">
{{> core_calendar/header}}
{{> core_calendar/month_detailed}}
</div>
{{#js}}
require(['jquery', 'core_calendar/calendar', 'core_calendar/popover'], function($, Calendar, calendarPopover) {
const isCalendarBlock = {{#iscalendarblock}}true{{/iscalendarblock}}{{^iscalendarblock}}false{{/iscalendarblock}};
Calendar.init($("#calendar-month-{{uniqid}}-{{calendarinstanceid}}"), isCalendarBlock);
});
{{/js}}
@@ -0,0 +1,42 @@
{{!
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/calendar_upcoming
Calendar upcoming view.
The purpose of this template is to render the calendar upcoming view.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div id="calendar-upcoming-{{uniqid}}" data-template="core_calendar/upcoming_detailed">
{{> core_calendar/header}}
{{> core_calendar/upcoming_detailed}}
</div>
{{#js}}
require(['jquery', 'core_calendar/calendar_view'], function($, CalendarView) {
CalendarView.init($("#calendar-upcoming-{{uniqid}}"), 'upcoming');
});
{{/js}}
@@ -0,0 +1,43 @@
{{!
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/calendar_upcoming_mini
Calendar upcoming view.
The purpose of this template is to render the calendar upcoming view.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div id="calendar-upcoming-block-{{uniqid}}" data-template="core_calendar/upcoming_mini">
{{> core_calendar/upcoming_mini}}
</div>
{{#isloggedin}}
{{#js}}
require(['jquery', 'core_calendar/calendar_view'], function($, CalendarView) {
CalendarView.init($("#calendar-upcoming-block-{{uniqid}}"), 'upcoming');
});
{{/js}}
{{/isloggedin}}
+53
View File
@@ -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 <http://www.gnu.org/licenses/>.
}}
{{!
@template core_calendar/day_detailed
Calendar day view.
The purpose of this template is to render the calendar day view.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div{{!
}} class="calendarwrapper"{{!
}} data-context-id="{{defaulteventcontext}}"{{!
}}{{#courseid}} data-courseid="{{courseid}}"{{/courseid}}{{!
}}{{#categoryid}} data-categoryid="{{categoryid}}"{{/categoryid}}{{!
}} data-view="day"{{!
}} data-year="{{date.year}}"{{!
}} data-month="{{date.mon}}"{{!
}} data-day="{{date.mday}}"{{!
}} data-region="day"{{!
}} data-new-event-timestamp="{{neweventtimestamp}}"{{!
}}>
{{> core_calendar/day_navigation }}
{{> core/overlay_loading}}
{{< core_calendar/event_list }}
{{$noeventsmessage}}
{{#str}} daywithnoevents, core_calendar {{/str}}
{{/noeventsmessage}}
{{/core_calendar/event_list}}
</div>
@@ -0,0 +1,64 @@
{{!
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/day_navigation
Calendar day navigation.
The purpose of this template is to render the navigation to switch to previous and next months.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div id="day-navigation-{{uniqid}}" class="controls clearfix">
<div class="calendar-controls">
<a{{!
}} href="{{previousperiodlink}}"{{!
}} class="arrow_link previous"{{!
}} title="{{#str}}dayprev, calendar{{/str}}"{{!
}} data-year="{{previousperiod.year}}"{{!
}} data-month="{{previousperiod.mon}}"{{!
}} data-day="{{previousperiod.mday}}"{{!
}}>
<span class="arrow" aria-hidden="true">{{{larrow}}}</span>
&nbsp;
<span class="arrow_text">{{previousperiodname}}</span>
</a>
<span class="hide"> | </span>
<h2 class="current">{{periodname}}</h2>
<span class="hide"> | </span>
<a{{!
}} href="{{nextperiodlink}}"{{!
}} class="arrow_link next"{{!
}} title="{{#str}}daynext, calendar{{/str}}"{{!
}} data-year="{{nextperiod.year}}"{{!
}} data-month="{{nextperiod.mon}}"{{!
}} data-day="{{nextperiod.mday}}"{{!
}}>
<span class="arrow_text">{{nextperiodname}}</span>
&nbsp;
<span class="arrow" aria-hidden="true">{{{rarrow}}}</span>
</a>
</div>
</div>
@@ -0,0 +1,47 @@
{{!
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_delete_modal
Moodle modal template with save and cancel buttons.
The purpose of this template is to render a modal.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* title A cleaned string (use clean_text()) to display.
* body HTML content for the boday
Example context (json):
{
"title": "Example delete event seriesmodal",
"body": "Do you want to delete this event, or all events in the series?"
}
}}
{{< core/modal }}
{{$footer}}
<button type="button" class="btn btn-primary" data-action="deleteone">{{#str}} deleteoneevent, core_calendar {{/str}}</button>
<button type="button" class="btn btn-secondary" data-action="deleteall">{{#str}} deleteallevents, core_calendar {{/str}}</button>
<button type="button" class="btn btn-secondary" data-action="cancel">{{#str}} cancel {{/str}}</button>
{{/footer}}
{{/ core/modal }}
+113
View File
@@ -0,0 +1,113 @@
{{!
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_details
Calendar event details.
The purpose of this template is to render the event details.
This template is used in the summary modal, day and upcoming views to output event information consistently
across the calendar.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
"formattedtime": "Wednesday, 17 April, 9:27 AM",
"formattedlocation": "Moodle HQ",
"normalisedeventtype": "Group",
"normalisedeventtypetext": "Group event",
"description": "An random event description",
"isactionevent": "true",
"course": {
"viewurl": "http://mymoodlesite/course/view.php?id=1",
"fullname": "Course name"
},
"source": "Ical imported",
"groupname": "Group 1",
"iscategoryevent": "true",
"category": {
"nestedname": "Category name"
},
"iscourseevent": "true",
"groupname": "Group name",
"subscription": "true",
"displayeventsource": "true",
"subscriptionname": "Subscription name",
"subscriptionurl": "http://subscriptionurl"
}
}}
<div class="row">
<div class="col-1">{{#pix}} i/calendareventtime, core, {{#str}} when, core_calendar {{/str}} {{/pix}}</div>
<div class="col-11">{{{formattedtime}}}</div>
</div>
{{#normalisedeventtypetext}}
<div class="row mt-1">
<div class="col-1">{{#pix}} i/calendar, core, {{#str}} eventtype, core_calendar {{/str}} {{/pix}}</div>
<div class="col-11">{{normalisedeventtypetext}}</div>
</div>
{{/normalisedeventtypetext}}
{{#description}}
<div class="row mt-1">
<div class="col-1">{{#pix}} i/calendareventdescription, core, {{#str}} description {{/str}} {{/pix}}</div>
<div class="description-content col-11">{{{.}}}</div>
</div>
{{/description}}
{{#formattedlocation}}
<div class="row mt-1">
<div class="col-1">{{#pix}} i/location, core, {{#str}} location {{/str}} {{/pix}}</div>
<div class="location-content col-11">{{{.}}}</div>
</div>
{{/formattedlocation}}
{{#iscategoryevent}}
<div class="row mt-1">
<div class="col-1">{{#pix}} i/categoryevent, core, {{#str}} category {{/str}} {{/pix}}</div>
<div class="col-11">{{{category.nestedname}}}</div>
</div>
{{/iscategoryevent}}
{{#course.viewurl}}
<div class="row mt-1">
<div class="col-1">{{#pix}} i/courseevent, core, {{#str}} course {{/str}} {{/pix}}</div>
<div class="col-11"><a href="{{course.viewurl}}">{{{course.fullname}}}</a></div>
</div>
{{/course.viewurl}}
{{#groupname}}
<div class="row mt-1">
<div class="col-1">{{#pix}} i/groupevent, core, {{#str}} group {{/str}} {{/pix}}</div>
<div class="col-11">{{{groupname}}}</div>
</div>
{{/groupname}}
{{#subscription}}
{{#displayeventsource}}
<div class="row mt-1">
<div class="col-1">{{#pix}} i/rss, core, {{#str}} eventsource, core_calendar {{/str}} {{/pix}}</div>
<div class="col-11">
{{#subscriptionurl}}
<p><a href="{{subscriptionurl}}">{{#str}}subscriptionsource, core_calendar, {{{subscriptionname}}}{{/str}}</a></p>
{{/subscriptionurl}}
{{^subscriptionurl}}
<p>{{#str}}subscriptionsource, core_calendar, {{{subscriptionname}}}{{/str}}</p>
{{/subscriptionurl}}
</div>
</div>
{{/displayeventsource}}
{{/subscription}}
+45
View File
@@ -0,0 +1,45 @@
{{!
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_filter
Filter to select which event types displayed on this page.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div id="event-filter-{{uniqid}}" class="calendar_filters mt-2">
<ul>
{{#eventtypes}}
<li>
{{> core_calendar/event_filter_key }}
</li>
{{/eventtypes}}
</ul>
</div>
{{#js}}
require(['jquery', 'core_calendar/calendar_filter'], function($, CalendarFilter) {
CalendarFilter.init($("#event-filter-{{uniqid}}"));
});
{{/js}}
@@ -0,0 +1,48 @@
{{!
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_filter_key
Key item for the event filter.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<a href="#" data-action="filter-event-type" data-eventtype="{{eventtype}}" data-eventtype-hidden="{{hidden}}">
{{^hidden}}
<span class="calendar_event_{{eventtype}}">
{{#pix}}i/hide, core, {{#str}}hideeventtype, calendar, {{name}}{{/str}}{{/pix}}
</span>
<span>&nbsp;</span>
<span class="eventname">{{#str}}hideeventtype, calendar, {{name}}{{/str}}</span>
{{/hidden}}
{{#hidden}}
<span class="calendar_event_{{eventtype}}">
{{#pix}}i/show, core, {{#str}}showeventtype, calendar, {{name}}{{/str}}{{/pix}}
</span>
<span>&nbsp;</span>
<span class="eventname">{{#str}}showeventtype, calendar, {{name}}{{/str}}</span>
{{/hidden}}
</a>
+51
View File
@@ -0,0 +1,51 @@
{{!
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_icon
Event icon display.
The purpose of this template is to provide a common location for the
rendering of event icons.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
"modulename": "assign"
}
}}
{{#modulename}}
{{#icon}}
{{#iconurl}}
<img alt="{{alttext}}" title="{{alttext}}" src="{{{ iconurl }}}" class="icon {{iconclass}}">
{{/iconurl}}
{{^iconurl}}
{{#pix}} monologo, {{modulename}} {{/pix}}
{{/iconurl}}
{{/icon}}
{{^icon}}
{{#pix}} monologo, {{modulename}} {{/pix}}
{{/icon}}
{{/modulename}}
{{^modulename}}
{{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}}
{{/modulename}}
+108
View File
@@ -0,0 +1,108 @@
{{!
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_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):
{
"id": 1,
"name": "Sample event name",
"normalisedeventtype": "course",
"course": {
"id": 1
},
"canedit": true,
"candelete": true,
"isactionevent": true,
"icon": {
"key": "i/courseevent",
"component": "core",
"alttext": "Some course event",
"iconurl": "#"
},
"editurl": "#",
"url": "#"
}
}}
<div{{!
}} data-type="event"{{!
}} data-course-id="{{course.id}}"{{!
}} data-event-id="{{id}}"{{!
}} class="event mt-3"{{!
}} data-event-component="{{component}}"{{!
}} data-event-eventtype="{{eventtype}}"{{!
}} data-eventtype-{{normalisedeventtype}}="1"{{!
}} data-event-title="{{name}}"{{!
}} data-event-count="{{eventcount}}"{{!
}}>
<div class="card rounded">
<div class="box card-header clearfix calendar_event_{{normalisedeventtype}}">
<div class="commands float-sm-right">
{{#canedit}}
{{#candelete}}
<a href="{{deleteurl}}" data-action="delete" aria-label="{{#str}}delete{{/str}}" title="{{#str}}delete{{/str}}">
{{#pix}}t/delete, core{{/pix}}
</a>
{{/candelete}}
{{^isactionevent}}
<a href="{{editurl}}" data-action="edit" aria-label="{{#str}}edit{{/str}}" title="{{#str}}edit{{/str}}">
{{#pix}}t/edit, core{{/pix}}
</a>
{{/isactionevent}}
{{/canedit}}
</div>
{{#icon}}
<div class="d-inline-block mt-1 align-top">
{{#iconurl}}
<img alt="{{alttext}}" title="{{alttext}}" src="{{{iconurl}}}" class="icon {{iconclass}}">
{{/iconurl}}
{{^iconurl}}
{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}
{{/iconurl}}
</div>
{{/icon}}
<div class="d-inline-block">
<h3 class="name d-inline-block">{{{name}}}</h3>
</div>
</div>
<div class="description card-body">
{{> core_calendar/event_details }}
</div>
{{#action.actionable}}
<div class="card-footer text-right bg-transparent">
<a href="{{action.url}}" class="card-link">{{{action.name}}}</a>
</div>
{{/action.actionable}}
{{^action.actionable}}
{{#isactionevent}}
<div class="card-footer text-right bg-transparent">
<a href="{{url}}" class="card-link">{{#str}} gotoactivity, core_calendar {{/str}}</a>
</div>
{{/isactionevent}}
{{/action.actionable}}
</div>
</div>
+43
View File
@@ -0,0 +1,43 @@
{{!
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_list
Calendar event list.
The purpose of this template is to render a list of events.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div class="eventlist my-1">
{{#events}}
{{> core_calendar/event_item }}
{{/events}}
{{^events}}
<span class="calendar-information calendar-no-results">
{{$noeventsmessage}}{{/noeventsmessage}}
</span>
{{/events}}
</div>
@@ -0,0 +1,48 @@
{{!
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_subscription
Calendar event subscription.
The purpose of this template is to render the event subscription data.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
{{#subscription}}
{{#displayeventsource}}
<div>
{{#subscriptionurl}}
<p><a href="{{subscriptionurl}}">{{#str}}subscriptionsource, core_calendar, {{{subscriptionname}}}{{/str}}</a></p>
{{/subscriptionurl}}
{{^subscriptionurl}}
<p>{{#str}}subscriptionsource, core_calendar, {{{subscriptionname}}}{{/str}}</p>
{{/subscriptionurl}}
</div>
{{/displayeventsource}}
{{/subscription}}
@@ -0,0 +1,45 @@
{{!
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",
"location": "13th floor, building 42",
"eventtype": "User",
"source": "Ical imported",
"groupname": "Group 1"
}
}}
<div{{!
}} class="summary-modal-container"{{!
}} 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">
{{> core_calendar/event_details }}
</div>
</div>
@@ -0,0 +1,47 @@
{{!
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_modal
This template renders the calendar events summary modal.
Example context (json):
{
"title": "Assignment due 1"
}
}}
{{< core/modal }}
{{$footer}}
{{#candelete}}
<button type="button" class="btn btn-secondary" data-action="delete">{{#str}} delete {{/str}}</button>
{{/candelete}}
{{#action.actionable}}
<a href="{{action.url}}">{{{action.name}}}</a>
{{/action.actionable}}
{{^action.actionable}}
{{#isactionevent}}
<a href="{{url}}">{{#str}} gotoactivity, core_calendar {{/str}}</a>
{{/isactionevent}}
{{/action.actionable}}
{{^isactionevent}}
{{#canedit}}
<button type="button" class="btn btn-primary" data-action="edit">{{#str}} edit {{/str}}</button>
{{/canedit}}
{{/isactionevent}}
{{/footer}}
{{/ core/modal }}
@@ -0,0 +1,52 @@
{{!
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/export_calendar_url
Template for the URL for the exported calendar.
Example context (json):
{
"calendarexporturl": "https://www.moodle.org"
}
}}
<div class="card">
<div class="card-body alert-info">
<div class="mb-3">
<label for="calendarexporturl">{{#str}}calendarexporturl, calendar{{/str}}</label>
<div class="input-group">
<input type="text" id="calendarexporturl" class="form-control" value="{{calendarexporturl}}" readonly />
<div class="input-group-append">
<button id="copyexporturl" {{!
}} data-action="copytoclipboard"{{!
}} data-clipboard-target="#calendarexporturl"{{!
}} data-clipboard-success-message="{{#str}}calendarurlcopiedtoclipboard, core_calendar{{/str}}"{{!
}} class="btn btn-secondary"{{!
}} aria-label="{{#str}}copycalendarurl, calendar{{/str}}"{{!
}} disabled>
{{#str}}copyurl, calendar{{/str}}
</button>
</div>
</div>
</div>
</div>
</div>
{{#js}}
require(['core_calendar/export'], function(calendarExport) {
calendarExport.init();
});
{{/js}}
@@ -0,0 +1,42 @@
{{!
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/footer_options
Displays export options on the calendar footer.
Example context (json):
{
"footerlinks": [
{
"url": "calendar/view.php?view=month",
"linkname": "Full calendar"
},
{
"url": "calendar/managesubscriptions.php",
"linkname": "Manage subcriptions"
}
]
}
}}
<div class="bottom">
{{#footerlinks}}
<span class="footer-link">
<a href="{{url}}">{{linkname}}</a>
</span>
{{/footerlinks}}
</div>
+43
View File
@@ -0,0 +1,43 @@
{{!
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/header
Calendar header.
The purpose of this template is to render the month header.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div class="header d-flex flex-wrap p-1">
{{#showviewselector}}
{{> core_calendar/view_selector}}
{{/showviewselector}}
{{#filter_selector}}
{{{filter_selector}}}
{{/filter_selector}}
{{> core_calendar/add_event_button}}
</div>
<div aria-live="polite" class="sr-only calendar-announcements"></div>
@@ -0,0 +1,70 @@
{{!
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/minicalendar_day_link
Displays link to calendar day in mini calendar, with hover tooltip.
Example context (json):
{
"day": "Today",
"url": "http://example.com/",
"title": "Monday 2nd January",
"content": "<img class='icon smallicon' src='../../../pix/i/siteevent.svg'>Test site event"
}
}}
<a {{!
}} id="calendar-day-popover-link-{{courseid}}-{{year}}-{{yday}}-{{uniqid}}"{{!
}} href="{{$url}}{{url}}{{/url}}"{{!
}} data-container="body"{{!
}} data-toggle="popover"{{!
}} data-html="true"{{!
}} data-region="mini-day-link"{{!
}} data-trigger="hover focus"{{!
}} data-placement="top"{{!
}} data-year="{{year}}"{{!
}} data-month="{{date.mon}}"{{!
}} data-courseid="{{courseid}}"{{!
}} data-categoryid="{{categoryid}}"{{!
}} data-title="{{$title}}{{title}}{{/title}}"{{!
}} data-alternate="{{$nocontent}}{{/nocontent}}"{{!
}} aria-label="{{viewdaylinktitle}}"{{!
}}>{{$day}}{{day}}{{/day}}</a>
<div class="hidden">
{{$content}}{{/content}}
</div>
{{#js}}
require(['jquery'], function($) {
require(['theme_boost/bootstrap/popover'], function() {
var target = $("#calendar-day-popover-link-{{courseid}}-{{year}}-{{yday}}-{{uniqid}}");
target.popover({
content: function() {
var source = target.next().find("> *:not('.hidden')");
var content = $('<div>');
if (source.length) {
content.html(source.clone(false));
} else {
content.html(target.data('alternate'));
}
return content.html();
}
});
});
});
{{/js}}
@@ -0,0 +1,54 @@
{{!
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/modal_event_form
Moodle modal template with save and cancel buttons.
The purpose of this template is to render a modal.
Classes required for JS:
* none
Data attributes required for JS:
* none
Context variables required for this template:
* title A cleaned string (use clean_text()) to display.
* body HTML content for the boday
Example context (json):
{
"title": "Example save cancel modal",
"body": "Some example content for the body"
}
}}
{{< core/modal }}
{{$footer}}
<button type="button"
class="btn btn-primary"
data-context-id="{{contextid}}"
data-action="save">
{{#str}} save {{/str}}
<span class="hidden" data-region="loading-icon-container">
{{> core/loading }}
</span>
</button>
{{/footer}}
{{/ core/modal }}
+182
View File
@@ -0,0 +1,182 @@
{{!
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/month_detailed
Calendar month view.
The purpose of this template is to render the month view.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div{{!
}} class="calendarwrapper"{{!
}}{{#courseid}} data-courseid="{{courseid}}"{{/courseid}}{{!
}}{{#categoryid}} data-categoryid="{{categoryid}}"{{/categoryid}}{{!
}} data-context-id="{{defaulteventcontext}}"{{!
}} data-month="{{date.mon}}"{{!
}} data-year="{{date.year}}"{{!
}} data-view="{{view}}"{{!
}}>
{{> core_calendar/month_navigation }}
{{> core/overlay_loading}}
<table id="month-detailed-{{uniqid}}-{{calendarinstanceid}}" class="calendarmonth calendartable mb-0">
<thead>
<tr>
{{# daynames }}
<th class="header text-xs-center">
<span class="sr-only">{{fullname}}</span>
<span aria-hidden="true">{{shortname}}</span>
</th>
{{/ daynames }}
</tr>
</thead>
<tbody>
{{#weeks}}
<tr data-region="month-view-week">
{{#prepadding}}
<td class="dayblank">&nbsp;</td>
{{/prepadding}}
{{#days}}
<td class="day text-sm-center text-md-left{{!
}}{{#istoday}} today{{/istoday}}{{!
}}{{#isweekend}} weekend{{/isweekend}}{{!
}}{{#durationevents.0}} duration{{/durationevents.0}}{{!
}}{{#durationevents}} duration_{{.}}{{/durationevents}}{{!
}}{{#defaulteventcontext}} clickable{{/defaulteventcontext}}{{!
}}{{#hasevents}} hasevent{{/hasevents}}{{!
}}"
data-day="{{mday}}"
data-day-timestamp="{{timestamp}}"
data-drop-zone="month-view-day"
data-region="day"
data-new-event-timestamp="{{neweventtimestamp}}"{{#istoday}} title="{{#str}} today, core_calendar {{/str}}"{{/istoday}}
{{#hasevents}} data-title="{{viewdaylinktitle}}"{{/hasevents}}>
<div class="d-none d-md-block hidden-phone text-xs-center">
<span class="sr-only">{{daytitle}}</span>
{{#hasevents}}
<a data-action="view-day-link" href="#" class="aalink day" aria-label="{{viewdaylinktitle}}"
data-year="{{date.year}}" data-month="{{date.mon}}" data-day="{{mday}}"
data-courseid="{{courseid}}" data-categoryid="{{categoryid}}"
data-timestamp="{{timestamp}}"><span class="day-number-circle"><span class="day-number">{{mday}}</span></span></a>
{{/hasevents}}
{{^hasevents}}
<span aria-hidden="true"><span class="day-number-circle"><span class="day-number">{{mday}}</span></span></span>
{{/hasevents}}
{{#hasevents}}
<div data-region="day-content">
<ul>
{{#events}}
{{#underway}}
<li class="events-underway">[{{{name}}}]</li>
{{/underway}}
{{^underway}}
<li data-region="event-item"
data-event-component="{{component}}"
data-event-eventtype="{{eventtype}}"
data-event-folded="false"
data-eventtype-{{normalisedeventtype}}="1"
{{#draggable}}
draggable="true"
data-drag-type="move"
{{#mindaytimestamp}}
data-min-day-timestamp="{{.}}"
{{/mindaytimestamp}}
{{#mindayerror}}
data-min-day-error="{{.}}"
{{/mindayerror}}
{{#maxdaytimestamp}}
data-max-day-timestamp="{{.}}"
{{/maxdaytimestamp}}
{{#maxdayerror}}
data-max-day-error="{{.}}"
{{/maxdayerror}}
{{/draggable}}>
<a data-action="view-event" data-event-id="{{id}}" href="{{url}}" title="{{name}}">
<span class="calendar-circle calendar_event_{{normalisedeventtype}}">
&nbsp;
</span>
<span class="eventname">{{{name}}}</span>
</a>
</li>
{{/underway}}
{{/events}}
<li data-action="view-more-events" style="display: none">
<strong>
<a data-action="view-day-link" href="#" class="aalink day" aria-label="{{viewdaylinktitle}}"
data-year="{{date.year}}" data-month="{{date.mon}}" data-day="{{mday}}"
data-courseid="{{courseid}}" data-categoryid="{{categoryid}}"
data-timestamp="{{timestamp}}">
{{#str}} moreevents, calendar, {{hasmoreevents}} {{/str}}
</a>
</strong>
</li>
</ul>
<div class="hidden">
{{#events}}
<div data-popover-eventtype-{{normalisedeventtype}}="1">
{{> core_calendar/event_icon}}
{{{name}}}
</div>
{{/events}}
</div>
</div>
{{/hasevents}}
</div>
<div class="d-md-none hidden-desktop hidden-tablet">
<span class="sr-only">{{daytitle}}</span>
{{#hasevents}}
<a data-action="view-day-link" href="#" class="day aalink" aria-label="{{viewdaylinktitle}}"
data-year="{{date.year}}" data-month="{{date.mon}}" data-day="{{mday}}"
data-courseid="{{courseid}}" data-categoryid="{{categoryid}}"
data-timestamp="{{timestamp}}"><span class="day-number-circle"><span class="day-number">{{mday}}</span></span></a>
{{/hasevents}}
{{^hasevents}}
<span aria-hidden="true"><span class="day-number-circle"><span class="day-number">{{mday}}</span></span></span>
{{/hasevents}}
</div>
</td>
{{/days}}
{{#postpadding}}
<td class="dayblank">&nbsp;</td>
{{/postpadding}}
</tr>
{{/weeks}}
</tbody>
</table>
</div>
{{#js}}
require([
'jquery',
'core_calendar/month_view_drag_drop'
], function(
$,
DragDrop
) {
var root = $('#month-detailed-{{uniqid}}-{{calendarinstanceid}}');
DragDrop.init(root);
});
{{/js}}
+183
View File
@@ -0,0 +1,183 @@
{{!
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/month_mini
Calendar month view for blocks.
The purpose of this template is to render the month view for blocks.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div{{!
}} id="month-mini-{{date.year}}-{{date.mon}}-{{uniqid}}"{{!
}} class="calendarwrapper"{{!
}} data-courseid="{{courseid}}"{{!
}} data-categoryid="{{categoryid}}"{{!
}} data-month="{{date.mon}}"{{!
}} data-year="{{date.year}}"{{!
}} data-day="{{date.mday}}"{{!
}} data-view="month"{{!
}}>
{{> core/overlay_loading}}
<table class="minicalendar calendartable">
<caption class="calendar-controls">
{{#includenavigation}}
<a{{!
}} href="#"{{!
}} class="arrow_link previous"{{!
}} title="{{#str}}monthprev, calendar{{/str}}"{{!
}} data-year="{{previousperiod.year}}"{{!
}} data-month="{{previousperiod.mon}}"{{!
}}>
<span class="arrow">{{{larrow}}}</span>
</a>
<span class="hide"> | </span>
<span class="current">
<a href="{{{url}}}" title="{{#str}}monththis, calendar{{/str}}">{{periodname}}</a>
</span>
<span class="hide"> | </span>
<a{{!
}} href="#"{{!
}} class="arrow_link next"{{!
}} title="{{#str}}monthnext, calendar{{/str}}"{{!
}} data-year="{{nextperiod.year}}"{{!
}} data-month="{{nextperiod.mon}}"{{!
}}>
<span class="arrow">{{{rarrow}}}</span>
</a>
{{/includenavigation}}
{{^includenavigation}}
<h3>
<a href="{{{url}}}" title="{{#str}}monththis, calendar{{/str}}">{{periodname}}</a>
</h3>
{{/includenavigation}}
</caption>
<thead>
<tr>
{{# daynames }}
<th class="header text-xs-center">
<span class="sr-only">{{fullname}}</span>
<span aria-hidden="true">{{shortname}}</span>
</th>
{{/ daynames }}
</tr>
</thead>
<tbody>
{{#weeks}}
<tr data-region="month-view-week">
{{#prepadding}}
<td class="dayblank">&nbsp;</td>
{{/prepadding}}
{{#days}}
<td class="day text-center{{!
This is the list of additional classes to display.
This cell is for today.
}}{{#istoday}} today{{/istoday}}{{!
This day falls on a weekend.
}}{{#isweekend}} weekend{{/isweekend}}{{!
There is at least one event.
}}{{#events.0}} hasevent{{/events.0}}{{!
There are events on this day which span multiple days.
}}{{#durationevents.0}} duration{{/durationevents.0}}{{!
}}{{#durationevents}} duration_{{.}}{{/durationevents}}{{!
}}{{#islastday}} duraction_finish{{/islastday}}{{!
These event types fall on this day.
}}{{#calendareventtypes}}{{!
}} calendar_event_{{.}}{{!
}}{{/calendareventtypes}}{{!
This day contains the last day of an event.
}}{{#haslastdayofevent}}{{!
}} duration_finish{{!
}}{{/haslastdayofevent}}{{!
}}"{{!
Add data-eventtype-[eventtype] data attributes.
These are used to show and hide events using the filter.
}}{{#calendareventtypes}}{{!
}} data-eventtype-{{.}}="1"{{!
}}{{/calendareventtypes}}{{!
This is the timestamp for this month.
}} data-day-timestamp="{{timestamp}}"{{!
}}>{{!
}}<span class="sr-only">{{daytitle}}</span>
{{#popovertitle}}
{{< core_calendar/minicalendar_day_link }}
{{$day}}{{mday}}{{/day}}
{{$url}}{{viewdaylink}}{{/url}}
{{$title}}{{popovertitle}}{{/title}}
{{$nocontent}}{{#str}}eventnone, calendar{{/str}}{{/nocontent}}
{{$content}}
{{#events}}
<div data-popover-eventtype-{{normalisedeventtype}}="1">
{{> core_calendar/event_icon}}
{{{popupname}}}
</div>
{{/events}}
{{/content}}
{{/ core_calendar/minicalendar_day_link }}
{{/popovertitle}}{{!
}}{{^popovertitle}}
<span aria-hidden="true">{{mday}}</span>
{{/popovertitle}}{{!
}}</td>
{{/days}}
{{#postpadding}}
<td class="dayblank">&nbsp;</td>
{{/postpadding}}
</tr>
{{/weeks}}
</tbody>
</table>
</div>
{{#js}}
require([
'jquery',
'core_calendar/selectors',
'core_calendar/events',
], function(
$,
CalendarSelectors,
CalendarEvents
) {
$('body').on(CalendarEvents.filterChanged, function(e, data) {
M.util.js_pending("month-mini-{{uniqid}}-filterChanged");
// A filter value has been changed.
// Find all matching cells in the popover data, and hide them.
$("#month-mini-{{date.year}}-{{date.mon}}-{{uniqid}}")
.find(CalendarSelectors.popoverType[data.type])
.toggleClass('hidden', !!data.hidden);
M.util.js_complete("month-mini-{{uniqid}}-filterChanged");
});
});
{{/js}}
@@ -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 <http://www.gnu.org/licenses/>.
}}
{{!
@template core_calendar/month_navigation
Calendar month navigation.
The purpose of this template is to render the navigation to switch to previous and next months.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div id="month-navigation-{{uniqid}}-{{calendarinstanceid}}" class="controls">
<div class="calendar-controls">
<a{{!
}} href="{{previousperiodlink}}"{{!
}} class="arrow_link previous"{{!
}} title="{{#str}}monthprev, calendar{{/str}}"{{!
}} data-year="{{previousperiod.year}}"{{!
}} data-month="{{previousperiod.mon}}"{{!
}} data-drop-zone="nav-link" {{!
}}>
<span class="arrow" aria-hidden="true">{{{larrow}}}</span>
&nbsp;
<span class="arrow_text">{{previousperiodname}}</span>
</a>
<span class="hide"> | </span>
{{#viewinginblock}}
<h4 class="current">{{periodname}}</h4>
{{/viewinginblock}}
{{^viewinginblock}}
<h2 class="current">{{periodname}}</h2>
{{/viewinginblock}}
<span class="hide"> | </span>
<a{{!
}} href="{{nextperiodlink}}"{{!
}} class="arrow_link next"{{!
}} title="{{#str}}monthnext, calendar{{/str}}"{{!
}} data-year="{{nextperiod.year}}"{{!
}} data-month="{{nextperiod.mon}}"{{!
}} data-drop-zone="nav-link" {{!
}}>
<span class="arrow_text">{{nextperiodname}}</span>
&nbsp;
<span class="arrow" aria-hidden="true">{{{rarrow}}}</span>
</a>
</div>
</div>
{{#js}}
require(['jquery', 'core_calendar/month_navigation_drag_drop'], function($, DragDrop) {
var root = $('#month-navigation-{{uniqid}}-{{calendarinstanceid}}');
DragDrop.init(root);
});
{{/js}}
@@ -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 core_calendar/subscription_update_result
Calendar subscription update result.
The purpose of this template is to render the calendar subscription update result.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
"subscriptionname": "Moodle",
"eventsimported": 1,
"eventsskipped": 2,
"eventsupdated": 3,
"deletedcount": 4,
"errors": [
"Event 1",
"Event 2"
]
}
}}
{{#subscriptionname}}
<p>{{#str}} subscriptionupdated, calendar, {{subscriptionname}} {{/str}}</p>
{{/subscriptionname}}
<ul>
<li>{{#str}} eventsimported, calendar, {{eventsimported}} {{/str}}</li>
<li>{{#str}} eventsskipped, calendar, {{eventsskipped}} {{/str}}</li>
<li>{{#str}} eventsupdated, calendar, {{eventsupdated}} {{/str}}</li>
<li>{{#str}} eventsdeleted, calendar, {{eventsdeleted}} {{/str}}</li>
</ul>
{{#haserror}}
<p>{{#str}} erroraddingevent, calendar {{/str}}</p>
<ul>
{{#eventserror}}
<li>{{.}}</li>
{{/eventserror}}
</ul>
{{/haserror}}
@@ -0,0 +1,42 @@
{{!
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/upcoming_detailed
Calendar upcoming detailed.
The purpose of this template is to render the calendar upcoming detailed view.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div class="calendarwrapper" data-view="upcoming" data-context-id="{{defaulteventcontext}}" data-courseid="{{courseid}}">
{{> core/overlay_loading}}
<h2 class="current text-center">{{#str}}upcomingevents, core_calendar{{/str}}</h2>
{{< core_calendar/event_list }}
{{$noeventsmessage}}
{{#str}} noupcomingevents, core_calendar {{/str}}
{{/noeventsmessage}}
{{/core_calendar/event_list}}
</div>
+115
View File
@@ -0,0 +1,115 @@
{{!
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/upcoming_mini
Calendar upcoming view for blocks.
The purpose of this template is to render the upcoming view for blocks.
Classes required for JS:
* none
Data attributes required for JS:
* none
Example context (json):
{
}
}}
<div class="card-text content calendarwrapper"{{!
}} id="month-upcoming-mini-{{uniqid}}"{{!
}} data-context-id="{{defaulteventcontext}}"{{!
}} data-courseid="{{courseid}}"{{!
}} data-categoryid="{{categoryid}}"{{!
}}>
{{> core/overlay_loading}}
{{#events}}
<div{{!
}} class="event d-flex border-bottom pt-2 pb-3"{{!
}} data-eventtype-{{normalisedeventtype}}="1"{{!
}} data-region="event-item"{{!
}}>
<div class="activityiconcontainer small courseicon mr-3">
{{#icon}}
{{#iconurl}}
<img alt="{{alttext}}" title="{{alttext}}" src="{{{ iconurl }}}" class="icon {{iconclass}}">
{{/iconurl}}
{{^iconurl}}
{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}
{{/iconurl}}
{{/icon}}
</div>
<div class="overflow-auto">
<h6 class="d-flex mb-1">
<a{{!
}} class="text-truncate"{{!
}} data-type="event"{{!
}} data-action="view-event"{{!
}} data-event-id="{{id}}"{{!
}} href="{{viewurl}}"{{!
}} title="{{name}}"{{!
}}>{{{name}}}</a>
</h6>
<div class="date small">{{{formattedtime}}}</div>
</div>
</div>
{{/events}}
{{^events}}
{{#str}}noupcomingevents, calendar{{/str}}
{{/events}}
</div>
{{#js}}
require([
'jquery',
'core_calendar/selectors',
'core_calendar/events',
], function(
$,
CalendarSelectors,
CalendarEvents
) {
var root = $('#month-upcoming-mini-{{uniqid}}');
$('body').on(CalendarEvents.filterChanged, function(e, data) {
M.util.js_pending("month-upcoming-mini-{{uniqid}}-filterChanged");
// A filter value has been changed.
// Find all matching cells in the popover data, and hide them.
var target = $("#month-upcoming-mini-{{uniqid}}").find(CalendarSelectors.eventType[data.type]);
var transitionPromise = $.Deferred();
if (data.hidden) {
transitionPromise.then(function() {
return target.slideUp('fast').promise();
});
} else {
transitionPromise.then(function() {
return target.slideDown('fast').promise();
});
}
transitionPromise.then(function() {
M.util.js_complete("month-upcoming-mini-{{uniqid}}-filterChanged");
return;
});
transitionPromise.resolve();
});
});
{{/js}}
+57
View File
@@ -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 <http://www.gnu.org/licenses/>.
}}
{{!
@template core_calendar/view_selector
This template renders display dropdown.
Example context (json):
{
"viewingmonth": true,
"viewingday": false,
"viewingupcoming": false
}
}}
<div data-region="view-selector">
<button id="calendarviewdropdown" type="button" class="btn btn-outline-secondary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="d-sm-inline-block" data-active-item-text>
{{#viewingmonth}}{{#str}} month {{/str}}{{/viewingmonth}}
{{#viewingday}}{{#str}} day, core_calendar {{/str}}{{/viewingday}}
{{#viewingupcoming}}{{#str}} upcomingevents, core_calendar {{/str}}{{/viewingupcoming}}
</span>
</button>
<ul class="dropdown-menu" data-show-active-item aria-labelledby="calendarviewdropdown">
<li>
<a class="dropdown-item {{#viewingmonth}}active{{/viewingmonth}}" href="#" data-view="month"
data-year="{{date.year}}" data-month="{{date.mon}}" data-day="{{date.mday}}" data-courseid="{{courseid}}" data-categoryid="{{categoryid}}">
{{#str}} month {{/str}}
</a>
</li>
<li>
<a class="dropdown-item {{#viewingday}}active{{/viewingday}}" href="#" data-view="day" data-year="{{date.year}}" data-month="{{date.mon}}"
data-day="{{date.mday}}" data-courseid="{{courseid}}" data-categoryid="{{categoryid}}">
{{#str}} day, core_calendar {{/str}}
</a>
</li>
<li>
<a class="dropdown-item {{#viewingupcoming}}active{{/viewingupcoming}}" href="#" data-view="upcoming"
data-year="{{date.year}}" data-month="{{date.mon}}" data-day="{{date.mday}}" data-courseid="{{courseid}}" data-categoryid="{{categoryid}}">
{{#str}} upcomingevents, core_calendar {{/str}}
</a>
</li>
</ul>
</div>