Skip to content

Commit

Permalink
MDL-65671 calendar: tidy up calendar header
Browse files Browse the repository at this point in the history
  • Loading branch information
lameze committed Jun 12, 2019
1 parent 859bc93 commit fed1cc7
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 9 deletions.
3 changes: 2 additions & 1 deletion calendar/renderer.php
Expand Up @@ -297,7 +297,8 @@ public function course_filter_selector(moodle_url $returnurl, $label = null, $co
}

$select = html_writer::label($label, 'course', false, ['class' => 'mr-1']);
$select .= html_writer::select($courseoptions, 'course', $selected, false, ['class' => 'cal_courses_flt']);
$select .= html_writer::select($courseoptions, 'course', $selected, false,
['class' => 'cal_courses_flt mr-auto']);

return $select;
}
Expand Down
2 changes: 1 addition & 1 deletion calendar/templates/header.mustache
Expand Up @@ -31,7 +31,7 @@
{
}
}}
<div class="header d-flex flex-wrap mb-5">
<div class="header d-flex flex-wrap">
{{> core_calendar/view_selector}}
{{#filter_selector}}
{{{filter_selector}}}
Expand Down
2 changes: 1 addition & 1 deletion calendar/templates/upcoming_detailed.mustache
Expand Up @@ -33,6 +33,6 @@
}}
<div class="calendarwrapper" data-view="upcoming" data-context-id="{{defaulteventcontext}}" data-courseid="{{courseid}}">
{{> core/overlay_loading}}
<h2 class="current">{{#str}}upcomingevents, core_calendar{{/str}}</h2>
<h2 class="current text-center">{{#str}}upcomingevents, core_calendar{{/str}}</h2>
{{> core_calendar/event_list }}
</div>
3 changes: 1 addition & 2 deletions calendar/templates/view_selector.mustache
Expand Up @@ -26,9 +26,8 @@
"viewingupcoming": false
}
}}
<div class="dropdown mb-1" data-region="view-selector">
<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">
{{#pix}} a/view_icon_active {{/pix}}
<span class="d-sm-inline-block" data-active-item-text>
{{#viewingmonth}}{{#str}} month {{/str}}{{/viewingmonth}}
{{#viewingday}}{{#str}} day, core_calendar {{/str}}{{/viewingday}}
Expand Down
13 changes: 9 additions & 4 deletions calendar/view.php
Expand Up @@ -61,7 +61,9 @@
$time = time();
}

if ($courseid != SITEID) {
$iscoursecalendar = $courseid != SITEID;

if ($iscoursecalendar) {
$url->param('course', $courseid);
}

Expand All @@ -80,7 +82,7 @@

$course = get_course($courseid);

if ($courseid != SITEID && !empty($courseid)) {
if ($iscoursecalendar && !empty($courseid)) {
navigation_node::override_active_url(new moodle_url('/course/view.php', array('id' => $course->id)));
} else if (!empty($categoryid)) {
core_course_category::get($categoryid); // Check that category exists and can be accessed.
Expand Down Expand Up @@ -115,15 +117,18 @@
// Print title and header
$PAGE->set_pagelayout('standard');
$PAGE->set_title("$course->shortname: $strcalendar: $pagetitle");
$PAGE->set_heading($COURSE->fullname);

$headingstr = ($iscoursecalendar) ? get_string('coursecalendar', 'core_calendar', $COURSE->shortname) :
get_string('calendar', 'core_calendar');
$PAGE->set_heading($headingstr);

$renderer = $PAGE->get_renderer('core_calendar');
$calendar->add_sidecalendar_blocks($renderer, true, $view);

echo $OUTPUT->header();
echo $renderer->start_layout();
echo html_writer::start_tag('div', array('class'=>'heightcontainer'));
echo $OUTPUT->heading(get_string('calendar', 'calendar'));



list($data, $template) = calendar_get_view($calendar, $view, true, false, $lookahead);
Expand Down
1 change: 1 addition & 0 deletions lang/en/calendar.php
Expand Up @@ -46,6 +46,7 @@
$string['courseevent'] = 'Course event';
$string['courseevents'] = 'Course events';
$string['categoryevents'] = 'Category events';
$string['coursecalendar'] = '{$a} calendar';
$string['courses'] = 'Courses';
$string['customexport'] = 'Custom range ({$a->timestart} - {$a->timeend})';
$string['daily'] = 'Daily';
Expand Down
4 changes: 4 additions & 0 deletions theme/boost/scss/moodle/calendar.scss
Expand Up @@ -437,3 +437,7 @@ table.calendartable caption {
margin: 0;
}
}

.cal_courses_flt {
color: #868e96;
}
3 changes: 3 additions & 0 deletions theme/boost/style/moodle.css
Expand Up @@ -11677,6 +11677,9 @@ table.calendartable caption {
.description-content > p {
margin: 0; }

.cal_courses_flt {
color: #868e96; }

/* course.less */
/* COURSE CONTENT */
.section-modchooser-link img {
Expand Down
3 changes: 3 additions & 0 deletions theme/classic/style/moodle.css
Expand Up @@ -11919,6 +11919,9 @@ table.calendartable caption {
.description-content > p {
margin: 0; }

.cal_courses_flt {
color: #868e96; }

/* course.less */
/* COURSE CONTENT */
.section-modchooser-link img {
Expand Down

0 comments on commit fed1cc7

Please sign in to comment.