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

View file

@ -179,6 +179,24 @@ blockquote.shared_content {
border: none; 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{ .settings-heading a:after{
content: ' »'; content: ' »';
} }

View file

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