Merge branch 'm28_MDL-46127' of https://github.com/totara/moodle

Conflicts:
	theme/bootstrapbase/style/moodle.css
This commit is contained in:
Dan Poltawski 2014-09-30 09:55:03 +01:00
commit d62f99195a
6 changed files with 82 additions and 77 deletions

View File

@ -102,29 +102,22 @@ echo $OUTPUT->box_start('eventlist');
$url = new moodle_url(CALENDAR_URL.'delete.php', array('id'=>$event->id, 'confirm'=>true));
$buttons = $OUTPUT->single_button($url, get_string('delete'));
// If there are repeated events then add a Delete Repeated button
$repeatspan = '';
// And add the cancel button.
$buttons .= $OUTPUT->single_button($viewcalendarurl, get_string('cancel'));
// And show the buttons and notes.
echo $OUTPUT->box_start('generalbox', 'notice');
echo html_writer::tag('p', get_string('confirmeventdelete', 'calendar', format_string($event->name)));
// If there are repeated events then add a Delete Repeated button.
if (!empty($event->eventrepeats) && $event->eventrepeats > 0) {
$url = new moodle_url(CALENDAR_URL.'delete.php', array('id'=>$event->repeatid, 'confirm'=>true, 'repeats'=>true));
$buttons .= $OUTPUT->single_button($url, get_string('deleteall'));
$repeatspan = '<br /><br /><span>'.get_string('youcandeleteallrepeats', 'calendar', $event->eventrepeats).'</span>';
echo html_writer::tag('p', get_string('youcandeleteallrepeats', 'calendar', $event->eventrepeats));
}
// And add the cancel button
$buttons .= $OUTPUT->single_button($viewcalendarurl, get_string('cancel'));
// And show the buttons and notes
echo $OUTPUT->box_start('generalbox', 'notice');
echo $OUTPUT->box(get_string('confirmeventdelete', 'calendar').$repeatspan);
echo $OUTPUT->box($buttons, 'buttons');
echo $OUTPUT->box_end();
// Print the event so that people can visually confirm they have the correct event
$event->time = calendar_format_event_time($event, time(), null, false);
$renderer = $PAGE->get_renderer('core_calendar');
echo $renderer->start_layout();
echo $renderer->event($event, false);
echo $renderer->complete_layout();
echo $OUTPUT->box_end();
echo $OUTPUT->footer();

View File

@ -268,7 +268,7 @@ class core_calendar_renderer extends plugin_renderer_base {
// There is nothing to display today.
$output .= $this->output->heading(get_string('daywithnoevents', 'calendar'), 3);
} else {
$output .= html_writer::start_tag('div', array('class'=>'eventlist'));
$output .= html_writer::start_tag('div', array('class' => 'eventlist'));
$underway = array();
// First, print details about events that start today
foreach ($events as $event) {
@ -309,32 +309,25 @@ class core_calendar_renderer extends plugin_renderer_base {
$event = calendar_add_event_metadata($event);
$context = $event->context;
$anchor = html_writer::tag('a', '', array('name'=>'event_'.$event->id));
$table = new html_table();
$table->attributes = array('class'=>'event', 'cellspacing'=>'0');
$table->data = array(
0 => new html_table_row(),
1 => new html_table_row(),
);
$output = '';
if (!empty($event->icon)) {
$table->data[0]->cells[0] = new html_table_cell($anchor.$event->icon);
$output .= $event->icon;
} else {
$table->data[0]->cells[0] = new html_table_cell($anchor.$this->output->spacer(array('height'=>16, 'width'=>16, 'br'=>true)));
$output .= $this->output->spacer(array('height' => 16, 'width' => 16));
}
$table->data[0]->cells[0]->attributes['class'] .= ' picture';
$table->data[0]->cells[1] = new html_table_cell();
$table->data[0]->cells[1]->attributes['class'] .= ' topic';
if (!empty($event->referer)) {
$table->data[0]->cells[1]->text .= html_writer::tag('div', $event->referer, array('class'=>'referer'));
$output .= $this->output->heading($event->referer, 3, array('class' => 'referer'));
} else {
$table->data[0]->cells[1]->text .= html_writer::tag('div', format_string($event->name, false, array('context' => $context)), array('class'=>'name'));
$output .= $this->output->heading(
format_string($event->name, false, array('context' => $context)),
3,
array('class' => 'name')
);
}
if (!empty($event->courselink)) {
$table->data[0]->cells[1]->text .= html_writer::tag('div', $event->courselink, array('class'=>'course'));
$output .= html_writer::tag('div', $event->courselink, array('class' => 'course'));
}
// Show subscription source if needed.
if (!empty($event->subscription) && $CFG->calendar_showicalsource) {
@ -344,23 +337,25 @@ class core_calendar_renderer extends plugin_renderer_base {
// File based ical.
$source = get_string('subsource', 'calendar', $event->subscription);
}
$table->data[0]->cells[1]->text .= html_writer::tag('div', $source, array('class' => 'subscription'));
$output .= html_writer::tag('div', $source, array('class' => 'subscription'));
}
if (!empty($event->time)) {
$table->data[0]->cells[1]->text .= html_writer::tag('span', $event->time, array('class'=>'date'));
$output .= html_writer::tag('span', $event->time, array('class' => 'date'));
} else {
$table->data[0]->cells[1]->text .= html_writer::tag('span', calendar_time_representation($event->timestart), array('class'=>'date'));
$output .= html_writer::tag('span', calendar_time_representation($event->timestart), array('class' => 'date'));
}
$table->data[1]->cells[0] = new html_table_cell('&nbsp;');
$table->data[1]->cells[0]->attributes['class'] .= 'side';
$eventdetailshtml = '';
$eventdetailsclasses = '';
$table->data[1]->cells[1] = new html_table_cell(format_text($event->description, $event->format, array('context' => $context)));
$table->data[1]->cells[1]->attributes['class'] .= ' description';
$eventdetailshtml .= format_text($event->description, $event->format, array('context' => $context));
$eventdetailsclasses .= 'description';
if (isset($event->cssclass)) {
$table->data[1]->cells[1]->attributes['class'] .= ' '.$event->cssclass;
$eventdetailsclasses .= ' '.$event->cssclass;
}
$output .= html_writer::tag('div', $eventdetailshtml, array('class' => $eventdetailsclasses));
if (calendar_edit_event_allowed($event) && $showactions) {
if (empty($event->cmid)) {
$editlink = new moodle_url(CALENDAR_URL.'event.php', array('action'=>'edit', 'id'=>$event->id));
@ -384,9 +379,9 @@ class core_calendar_renderer extends plugin_renderer_base {
$commands .= html_writer::end_tag('a');
}
$commands .= html_writer::end_tag('div');
$table->data[1]->cells[1]->text .= $commands;
$output .= $commands;
}
return html_writer::table($table);
return html_writer::tag('div', $output , array('class' => 'event', 'id' => 'event_' . $event->id));
}
/**
@ -621,7 +616,7 @@ class core_calendar_renderer extends plugin_renderer_base {
$output .= html_writer::end_tag('div');
if ($events) {
$output .= html_writer::start_tag('div', array('class'=>'eventlist'));
$output .= html_writer::start_tag('div', array('class' => 'eventlist'));
foreach ($events as $event) {
// Convert to calendar_event object so that we transform description
// accordingly

View File

@ -39,7 +39,7 @@ $string['collastupdated'] = 'Last updated';
$string['colpoll'] = 'Update';
$string['colactions'] = 'Actions';
$string['commontasks'] = 'Options';
$string['confirmeventdelete'] = 'Are you sure you want to delete this event?';
$string['confirmeventdelete'] = 'Are you sure you want to delete the "{$a}" event?';
$string['course'] = 'Course';
$string['courseevent'] = 'Course event';
$string['courseevents'] = 'Course events';

View File

@ -27,17 +27,21 @@
.path-calendar .maincalendar .calendar-controls .next{width: 30%;}
.path-calendar .maincalendar .calendar-controls .current {width: 39.95%;}
.path-calendar .maincalendar .controls {width:98%;margin:10px auto;}
.path-calendar .maincalendar .eventlist .event {width:100%;margin-bottom:10px;border-spacing:0px;border-collapse:separate;border-width:1px;border-style:solid;}
.path-calendar .maincalendar .eventlist .event .topic .name {float:left;}
.dir-rtl.path-calendar .maincalendar .eventlist .event .topic .name {float:right;}
.path-calendar .maincalendar .eventlist .event .topic .date {float:right;}
.dir-rtl.path-calendar .maincalendar .eventlist .event .topic .date {float:left;}
.path-calendar .maincalendar .eventlist {margin:0;}
.path-calendar .maincalendar .eventlist .event {width:100%;margin-bottom:10px;border-spacing:0px;border-collapse:separate;border-width:1px;border-style:solid;list-style-type: none;}
.path-calendar .maincalendar .eventlist .event > img {float:left;}
.path-calendar .maincalendar .eventlist .event > img {float:right;}
.path-calendar .maincalendar .eventlist .event .name {float:left;margin:0;}
.dir-rtl.path-calendar .maincalendar .eventlist .event .name {float:right;}
.path-calendar .maincalendar .eventlist .event .date {float:right;}
.dir-rtl.path-calendar .maincalendar .eventlist .event .date {float:left;}
.path-calendar .maincalendar .eventlist .event .subscription {float:left;clear:left;}
.dir-rtl.path-calendar .maincalendar .eventlist .event .subscription {float:right;clear:right;}
.path-calendar .maincalendar .eventlist .event .course {float:left;clear:left;}
.dir-rtl.path-calendar .maincalendar .eventlist .event .course {float:right;clear:right;}
.path-calendar .maincalendar .eventlist .event .side {width:32px;}
.path-calendar .maincalendar .eventlist .event .commands a { margin: 0 3px;}
.path-calendar .maincalendar .eventlist .description {clear: both;}
.path-calendar .maincalendar .header {overflow:hidden;}
.path-calendar .maincalendar .header .buttons {float: right;}
.dir-rtl.path-calendar .maincalendar .header .buttons {float: left;}

View File

@ -159,34 +159,38 @@
}
}
.eventlist {
margin: 0;
.event {
width: 100%;
width: 92%;
border-spacing: 0;
border-collapse: separate;
position: relative;
padding: 19px;
padding: 20px 4%;
margin-bottom: 20px;
background-color: lighten(@wellBackground, 3%);
border: 1px solid darken(@wellBackground, 7%);
.border-radius(@baseBorderRadius);
.box-shadow(inset 0 1px 1px rgba(0,0,0,.05));
.picture {
vertical-align: text-top;
list-style-type: none;
> img {
padding-top: 3px;
float: left;
}
.topic {
.name {
font-size: @fontSizeLarge;
font-weight: 200;
line-height: 24px;
float: left;
}
.name,
.course {
margin-bottom: 5px;
}
.date {
float: right;
}
.name {
font-size: @fontSizeLarge;
font-weight: 200;
line-height: 24px;
float: left;
margin: 0;
}
.name,
.course {
margin-bottom: 5px;
}
.date {
float: right;
}
.course,
.subscription {
@ -199,6 +203,7 @@
.description {
background-color: @white;
padding: 5px;
clear: both;
.commands {
position: absolute;
right: 0;
@ -207,6 +212,9 @@
}
}
.commands {
position: absolute;
top: 2px;
right: 2px;
a {
margin: 0 3px;
}
@ -257,13 +265,14 @@
}
.eventlist {
.event {
.topic {
.name {
float: right;
}
.date {
float: left;
}
> img {
float: right;
}
.name {
float: right;
}
.date {
float: left;
}
.description {
.commands {
@ -276,6 +285,10 @@
float: right;
clear: right;
}
.commands {
left: 2px;
right: inherit;
}
}
}
}

File diff suppressed because one or more lines are too long