diff --git a/calendar/amd/build/calendar_filter.min.js b/calendar/amd/build/calendar_filter.min.js index ddf2010dcef..9ce9df0c1b6 100644 --- a/calendar/amd/build/calendar_filter.min.js +++ b/calendar/amd/build/calendar_filter.min.js @@ -1 +1 @@ -define(["jquery","core_calendar/selectors","core_calendar/events","core/str","core/templates"],function(a,b,c,d,e){var f=function(d){d.on("click",b.eventFilterItem,function(b){var c=a(b.currentTarget);g(c),b.preventDefault()}),a("body").on(c.viewUpdated,function(){var c=d.find(b.eventFilterItem);c.each(function(b,c){if(c=a(c),c.data("eventtype-hidden")){var d=i(c);h(d)}})})},g=function(a){var b=i(a);return b.hidden=!b.hidden,d.get_string("eventtype"+b.eventtype,"calendar").then(function(a){return b.name=a,b}).then(function(a){return e.render("core_calendar/event_filter_key",a)}).then(function(b,c){return e.replaceNode(a,b,c)}).then(function(){h(b)})},h=function(b){M.util.js_pending("month-mini-filterChanged"),a("body").trigger(c.filterChanged,{type:b.eventtype,hidden:b.hidden}),M.util.js_complete("month-mini-filterChanged")},i=function(a){return{eventtype:a.data("eventtype"),hidden:a.data("eventtype-hidden")}};return{init:function(b){b=a(b),f(b)}}}); \ No newline at end of file +define(["jquery","core_calendar/selectors","core_calendar/events","core/str","core/templates"],function(a,b,c,d,e){var f=function(d){d.on("click",b.eventFilterItem,function(b){var c=a(b.currentTarget);g(c),b.preventDefault()}),a("body").on(c.viewUpdated,function(){var c=d.find(b.eventFilterItem);c.each(function(b,c){if(c=a(c),c.data("eventtype-hidden")){var d=i(c);h(d)}})})},g=function(a){var b=i(a);return b.hidden=!b.hidden,d.get_string("eventtype"+b.eventtype,"calendar").then(function(a){return b.name=a,b.icon=!0,b.key="i/"+b.eventtype+"event",b.component="core",b}).then(function(a){return e.render("core_calendar/event_filter_key",a)}).then(function(b,c){return e.replaceNode(a,b,c)}).then(function(){h(b)})},h=function(b){M.util.js_pending("month-mini-filterChanged"),a("body").trigger(c.filterChanged,{type:b.eventtype,hidden:b.hidden}),M.util.js_complete("month-mini-filterChanged")},i=function(a){return{eventtype:a.data("eventtype"),hidden:a.data("eventtype-hidden")}};return{init:function(b){b=a(b),f(b)}}}); \ No newline at end of file diff --git a/calendar/amd/src/calendar_filter.js b/calendar/amd/src/calendar_filter.js index 622dafd890c..41dd4488e8b 100644 --- a/calendar/amd/src/calendar_filter.js +++ b/calendar/amd/src/calendar_filter.js @@ -67,6 +67,9 @@ function( return Str.get_string('eventtype' + data.eventtype, 'calendar') .then(function(nameStr) { data.name = nameStr; + data.icon = true; + data.key = 'i/' + data.eventtype + 'event'; + data.component = 'core'; return data; }) diff --git a/calendar/lib.php b/calendar/lib.php index 0defb7a3246..b26473012fc 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -3661,6 +3661,9 @@ function calendar_get_filter_types() { return [ 'eventtype' => $type, 'name' => get_string("eventtype{$type}", "calendar"), + 'icon' => true, + 'key' => 'i/'.$type.'event', + 'component' => 'core' ]; }, $types); } diff --git a/calendar/templates/event_icon.mustache b/calendar/templates/event_icon.mustache index fb88bd6c6ea..ea61b32cf93 100644 --- a/calendar/templates/event_icon.mustache +++ b/calendar/templates/event_icon.mustache @@ -37,5 +37,5 @@ {{#pix}} icon, {{modulename}} {{/pix}} {{/modulename}} {{^modulename}} - {{#pix}} i/{{eventtype}}event, core {{/pix}} + {{#icon}}{{#pix}} {{key}}, {{component}}, {{alttext}} {{/pix}}{{/icon}} {{/modulename}} diff --git a/calendar/templates/month_mini.mustache b/calendar/templates/month_mini.mustache index 2a34335462c..498d3c13e62 100644 --- a/calendar/templates/month_mini.mustache +++ b/calendar/templates/month_mini.mustache @@ -136,12 +136,7 @@ {{$content}} {{#events}}
- {{#modulename}} - {{#pix}} icon, {{modulename}} {{/pix}} - {{/modulename}} - {{^modulename}} - {{#pix}} i/{{eventtype}}event, core {{/pix}} - {{/modulename}} + {{> core_calendar/event_icon}} {{{popupname}}}
{{/events}}