fix event html construction (fixes #2646)

This commit is contained in:
rabuzarus 2017-10-13 20:03:47 +02:00
parent 553428d1b1
commit dcbf4d6d11
3 changed files with 38 additions and 12 deletions

View file

@ -12,7 +12,6 @@ require_once 'include/map.php';
require_once 'include/datetime.php';
function format_event_html($ev, $simple = false) {
if (! ((is_array($ev)) && count($ev))) {
return '';
}
@ -32,7 +31,7 @@ function format_event_html($ev, $simple = false) {
if ($simple) {
$o = "<h3>" . bbcode($ev['summary']) . "</h3>";
$o .= "<p>" . bbcode($ev['desc']) . "</p>";
$o .= "<div>" . bbcode($ev['desc']) . "</div>";
$o .= "<h4>" . t('Starts:') . "</h4><p>" . $event_start . "</p>";
@ -49,27 +48,26 @@ function format_event_html($ev, $simple = false) {
$o = '<div class="vevent">' . "\r\n";
$o .= '<div class="summary event-summary">' . bbcode($ev['summary']) . '</div>' . "\r\n";
$o .= '<p class="summary event-summary">' . bbcode($ev['summary']) . '</p>' . "\r\n";
$o .= '<p class="description event-description">' . bbcode($ev['desc']) . '</p>' . "\r\n";
$o .= '<p class="event-start">' . t('Starts:') . ' <abbr class="dtstart" title="'
$o .= '<div class="event-start"><span class="event-label">' . t('Starts:') . '</span>&nbsp;<span class="dtstart" title="'
. datetime_convert('UTC', 'UTC', $ev['start'], (($ev['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' ))
. '" >'.$event_start
. '</abbr></p>' . "\r\n";
. '</span></div>' . "\r\n";
if (! $ev['nofinish']) {
$o .= '<p class="event-end" >' . t('Finishes:') . ' <abbr class="dtend" title="'
$o .= '<div class="event-end" ><span class="event-label">' . t('Finishes:') . '</span>&nbsp;<span class="dtend" title="'
. datetime_convert('UTC', 'UTC', $ev['finish'], (($ev['adjust']) ? ATOM_TIME : 'Y-m-d\TH:i:s' ))
. '" >'.$event_end
. '</abbr></p>' . "\r\n";
. '</span></div>' . "\r\n";
}
$o .= '<div class="description event-description">' . bbcode($ev['desc']) . '</div>' . "\r\n";
if (strlen($ev['location'])) {
$o .= '<p class="event-location"> ' . t('Location:') . ' <span class="location">'
$o .= '<div class="event-location"><span class="event-label">' . t('Location:') . '</span>&nbsp;<span class="location">'
. bbcode($ev['location'])
. '</span></p>' . "\r\n";
. '</span></div>' . "\r\n";
// Include a map of the location if the [map] BBCode is used.
if (strpos($ev['location'], "[map") !== false) {

View file

@ -179,6 +179,24 @@ blockquote.shared_content {
border: none;
}
/* Events */
.event-summary {
margin: 0px 0px 10px 0px;
font-weight: bold;
}
.vevent .event-summary {
margin: 0px 0px 10px 0px;
}
.vevent .event-description {
padding: 10px 0;
}
.event-label {
font-weight: bold;
}
.settings-heading a:after{
content: ' »';
}

View file

@ -2447,9 +2447,19 @@ ul li:hover .contact-wrapper .contact-action-link:hover {
.event-buttons .plink-event-link {
margin-left: 20px;
}
.vevent .event-summary {
font-size: 16px;
}
.vevent .event-description {
padding: 10px 0;
}
.vevent .event-location .location {
font-size: inherit;
color: inherit;
}
.modal-body .vevent .event-summary {
display: none;
}
/* Event Cards */
.event-card-details, .event-card-header {