Skip to content

Commit

Permalink
MDL-65671 calendar: remove course selector label from exporters
Browse files Browse the repository at this point in the history
  • Loading branch information
lameze committed Jun 12, 2019
1 parent 4cc9d7c commit 859bc93
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 23 deletions.
2 changes: 1 addition & 1 deletion calendar/amd/build/view_manager.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions calendar/amd/src/view_manager.js
Expand Up @@ -134,7 +134,7 @@ define([
return window.history.pushState({}, '', '?view=day');
}).fail(Notification.exception);
} else if (view == 'upcoming') {
reloadCurrentUpcoming(root, courseId, categoryId, 'core_calendar/calendar_upcoming')
reloadCurrentUpcoming(root, courseId, categoryId, root, 'core_calendar/calendar_upcoming')
.then(function() {
return window.history.pushState({}, '', '?view=upcoming');
}).fail(Notification.exception);
Expand Down Expand Up @@ -353,13 +353,15 @@ define([
* @param {Number} courseId The course id.
* @param {Number} categoryId The id of the category whose events are shown
* @param {String} template The template to be rendered.
* @param {object} target The element being replaced. If not specified, the calendarwrapper is used.
* @return {promise}
*/
var reloadCurrentUpcoming = function(root, courseId, categoryId, template) {
var reloadCurrentUpcoming = function(root, courseId, categoryId, target, template) {
startLoading(root);

var target = root.find(CalendarSelectors.wrapper);
target = target || root.find(CalendarSelectors.wrapper);
template = template || root.attr('data-template');

if (typeof courseId === 'undefined') {
courseId = root.find(CalendarSelectors.wrapper).data('courseid');
}
Expand Down
3 changes: 1 addition & 2 deletions calendar/classes/external/calendar_day_exporter.php
Expand Up @@ -240,8 +240,7 @@ protected function get_default_add_context() {
* @return string The html code for the course filter selector.
*/
protected function get_course_filter_selector(renderer_base $output) {
$langstr = get_string('dayviewfor', 'calendar');
return $output->course_filter_selector($this->url, $langstr, $this->calendar->course->id);
return $output->course_filter_selector($this->url, '', $this->calendar->course->id);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions calendar/classes/external/calendar_upcoming_exporter.php
Expand Up @@ -170,8 +170,7 @@ protected function get_default_add_context() {
* @return string The html code for the course filter selector.
*/
protected function get_course_filter_selector(renderer_base $output) {
$langstr = get_string('upcomingeventsfor', 'calendar');
return $output->course_filter_selector($this->url, $langstr, $this->calendar->course->id);
return $output->course_filter_selector($this->url, '', $this->calendar->course->id);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions calendar/classes/external/month_exporter.php
Expand Up @@ -252,8 +252,7 @@ protected function get_other_values(renderer_base $output) {
*/
protected function get_course_filter_selector(renderer_base $output) {
$content = '';
$content .= $output->course_filter_selector($this->url, get_string('detailedmonthviewfor', 'calendar'),
$this->calendar->course->id);
$content .= $output->course_filter_selector($this->url, '', $this->calendar->course->id);

return $content;
}
Expand Down
4 changes: 1 addition & 3 deletions calendar/templates/calendar_day.mustache
Expand Up @@ -32,9 +32,7 @@
}
}}
<div id="calendar-day-{{uniqid}}" data-template="core_calendar/day_detailed">
<div class="mb-5">
{{> core_calendar/view_selector}}
</div>
{{> core_calendar/header}}
{{> core_calendar/day_detailed}}
</div>
{{#js}}
Expand Down
5 changes: 1 addition & 4 deletions calendar/templates/calendar_month.mustache
Expand Up @@ -32,10 +32,7 @@
}
}}
<div id="calendar-month-{{uniqid}}" data-template="core_calendar/month_detailed">
<div class="mb-5">
{{> core_calendar/view_selector}}
</div>

{{> core_calendar/header}}
{{> core_calendar/month_detailed}}
</div>
{{#js}}
Expand Down
2 changes: 1 addition & 1 deletion calendar/templates/calendar_upcoming.mustache
Expand Up @@ -32,7 +32,7 @@
}
}}
<div id="calendar-upcoming-{{uniqid}}" data-template="core_calendar/upcoming_detailed">

{{> core_calendar/header}}
{{> core_calendar/upcoming_detailed}}
</div>
{{#js}}
Expand Down
1 change: 0 additions & 1 deletion calendar/templates/day_detailed.mustache
Expand Up @@ -43,7 +43,6 @@
}} data-region="day"{{!
}} data-new-event-timestamp="{{neweventtimestamp}}"{{!
}}>
{{> core_calendar/header}}
{{> core_calendar/day_navigation }}
{{> core/overlay_loading}}
{{> core_calendar/event_list }}
Expand Down
5 changes: 3 additions & 2 deletions calendar/templates/header.mustache
Expand Up @@ -31,9 +31,10 @@
{
}
}}
<div class="header">
<div class="header d-flex flex-wrap mb-5">
{{> core_calendar/view_selector}}
{{#filter_selector}}
{{{filter_selector}}}
{{/filter_selector}}
{{> core_calendar/add_event_button}}
</div>
</div>
1 change: 0 additions & 1 deletion calendar/templates/month_detailed.mustache
Expand Up @@ -40,7 +40,6 @@
}} data-year="{{date.year}}"{{!
}} data-view="month"{{!
}}>
{{> core_calendar/header }}
{{> core_calendar/month_navigation }}
{{> core/overlay_loading}}
<table id="month-detailed-{{uniqid}}" class="calendarmonth calendartable mb-0">
Expand Down
1 change: 0 additions & 1 deletion calendar/templates/upcoming_detailed.mustache
Expand Up @@ -32,7 +32,6 @@
}
}}
<div class="calendarwrapper" data-view="upcoming" data-context-id="{{defaulteventcontext}}" data-courseid="{{courseid}}">
{{> core_calendar/header}}
{{> core/overlay_loading}}
<h2 class="current">{{#str}}upcomingevents, core_calendar{{/str}}</h2>
{{> core_calendar/event_list }}
Expand Down

0 comments on commit 859bc93

Please sign in to comment.