mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
MDL-59392 calendar: Apply event filters to main calendar view
This commit is contained in:
parent
c8b6e9ab34
commit
fc60d3194f
2 changed files with 24 additions and 3 deletions
|
@ -1049,7 +1049,7 @@ class calendar_information {
|
|||
public function add_sidecalendar_blocks(core_calendar_renderer $renderer, $showfilters=false, $view=null) {
|
||||
if ($showfilters) {
|
||||
$filters = new block_contents();
|
||||
$filters->content = $renderer->fake_block_filters($this->courseid, 0, 0, 0, $view, $this->courses);
|
||||
$filters->content = $renderer->event_filter();
|
||||
$filters->footer = '';
|
||||
$filters->title = get_string('eventskey', 'calendar');
|
||||
$renderer->add_pretend_calendar_block($filters, BLOCK_POS_RIGHT);
|
||||
|
|
|
@ -77,8 +77,9 @@
|
|||
<li class="events-underway">[{{name}}]</li>
|
||||
{{/underway}}
|
||||
{{^underway}}
|
||||
<li class="calendar_event_{{eventtype}}"
|
||||
<li class="calendar_event_{{calendareventtype}}"
|
||||
data-region="event-item"
|
||||
data-eventtype-{{calendareventtype}}="1"
|
||||
{{#canedit}}
|
||||
draggable="true"
|
||||
data-drag-type="move"
|
||||
|
@ -113,8 +114,28 @@
|
|||
</table>
|
||||
</div>
|
||||
{{#js}}
|
||||
require(['jquery', 'core_calendar/month_view_drag_drop'], function($, DragDrop) {
|
||||
require([
|
||||
'jquery',
|
||||
'core_calendar/month_view_drag_drop',
|
||||
'core_calendar/selectors',
|
||||
'core_calendar/events',
|
||||
], function(
|
||||
$,
|
||||
DragDrop,
|
||||
CalendarSelectors,
|
||||
CalendarEvents
|
||||
) {
|
||||
var root = $('#month-detailed-{{uniqid}}');
|
||||
DragDrop.init(root);
|
||||
|
||||
$('body').on(CalendarEvents.filterChanged, function(e, data) {
|
||||
M.util.js_pending("month-detailed-{{uniqid}}-filterChanged");
|
||||
// A filter value has been changed.
|
||||
// Find all matching cells in the popover data, and hide them.
|
||||
$("#month-detailed-{{uniqid}}")
|
||||
.find(CalendarSelectors.eventType[data.type])
|
||||
.toggleClass('hidden', !!data.hidden);
|
||||
M.util.js_complete("month-detailed-{{uniqid}}-filterChanged");
|
||||
});
|
||||
});
|
||||
{{/js}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue