Skip to content
Snippets Groups Projects
Commit bd6c2bdd authored by Moritz Strohm's avatar Moritz Strohm
Browse files

made the times / rooms section on the course details page more accessible, closes #1244

Closes #1244

Merge request studip/studip!840
parent 61cff027
No related branches found
No related tags found
No related merge requests found
Pipeline #8910 passed
......@@ -310,12 +310,12 @@
<article class="studip">
<header>
<h1><?= _('Veranstaltungsort') ?> / <?= _('Veranstaltungszeiten')?></h1>
<h1><?= _('Räume und Zeiten') ?></h1>
</header>
<section>
<?= $sem->getDatesTemplate(
'dates/seminar_html_location',
['ort' => $course->ort, 'disable_list_shrinking' => true, 'show_room' => false]
['ort' => $course->ort]
) ?>
</section>
</article>
......
......@@ -223,8 +223,7 @@ function shrink_dates($dates) {
}
if (empty($dates[$i]["conjuncted"]) || empty($dates[$i+1]["conjuncted"])) {
$return_string .= ' ' . strftime('%A', $dates[$i]['start_time']) .'.';
$return_string .= date (" d.m.y", $dates[$i]["start_time"]);
$return_string .= strftime(' %A, %d.%m.%Y', $dates[$i]['start_time']);
}
if (!$conjuncted && !empty($dates[$i+1]["conjuncted"])) {
......
......@@ -409,12 +409,10 @@ class SingleDate
if (!$this->date) {
return null;
} elseif ((($end_hours - $start_hours) / 60 / 60) > 23) {
return sprintf('%s , %s (%s)',strftime('%a', $this->date),
strftime('%d.%m.%Y', $this->date),
return sprintf('%s (%s)', strftime('%A, %d.%m.%Y', $this->date),
_('ganztägig'));
} else {
return sprintf('%s., %s - %s',strftime('%a', $this->date),
strftime('%d.%m.%Y %H:%M', $this->date),
return sprintf('%s - %s', strftime('%A, %d.%m.%Y %H:%M', $this->date),
strftime('%H:%M', $this->end_time));
}
}
......
......@@ -171,19 +171,6 @@ STUDIP.domReady(function () {
$('.more-dates').attr('title', $gettext('Blenden Sie die restlichen Termine ein'));
}
});
$(document).on('click', '.more-location-dates', function () {
$(this).closest('div').prev().toggle();
$(this).prev().toggle();
if ($(this).closest('div').prev().is(':visible')) {
$(this).text('(weniger)');
$(this).attr('title', $gettext('Blenden Sie die restlichen Termine aus'));
} else {
$(this).text('(mehr)');
$(this).attr('title', $gettext('Blenden Sie die restlichen Termine ein'));
}
});
}(jQuery));
/* ------------------------------------------------------------------------
......
......@@ -23,8 +23,9 @@ if (is_array($dates['regular']['turnus_data'])) foreach ($dates['regular']['turn
if ($link) {
$output[
'<a href="' . $room_obj->getActionLink('show') . '" data-dialog="1">'
. htmlReady($room_obj->name) . '</a>'
][] = $cycle['tostring_short'] .' ('. $count .'x)';
. htmlReady($room_obj->name)
. '</a>'
][] = $cycle['tostring'] .' ('. $count .'x)';
} else {
$output[htmlReady($room_obj->name)][] = $cycle['tostring_short'] .' ('. $count .'x)';
}
......@@ -37,7 +38,7 @@ if (is_array($dates['regular']['turnus_data'])) foreach ($dates['regular']['turn
if($count) :
$without_location .= '(' . $count . 'x)';
endif;
$output[_('k.A.')][] = $without_location;
$output[_('Keine Raumangabe')][] = $without_location;
endif;
endforeach;
endforeach;
......@@ -51,7 +52,7 @@ if (isset($dates['irregular']) && is_array($dates['irregular'])) {
elseif (!empty($date['raum'])) :
$output_dates[$date['raum']][] = $date;
else :
$output_dates[_('k.A.')][] = $date['tostring'];
$output_dates[_('Keine Raumangabe')][] = $date['tostring'];
endif;
endforeach;
}
......@@ -63,7 +64,8 @@ foreach ($output_dates as $dates) :
if ($link) {
$output[
'<a href="' . $room_obj->getActionLink('show') . '" data-dialog="1">'
. htmlReady($room_obj->name) . '</a>'
. htmlReady($room_obj->name)
. '</a>'
][] = implode('<br>', shrink_dates($dates));
} else {
$output[htmlReady($room_obj->name)][] = implode('<br>', shrink_dates($dates));
......@@ -71,35 +73,23 @@ foreach ($output_dates as $dates) :
elseif (isset($dates[0]['raum'])) :
$output['(' . htmlReady($dates[0]['raum']) . ')'][] = implode('<br>', shrink_dates($dates));
else :
$output[_('k.A.')][] = implode('<br>', $dates);
$output[_('Keine Raumangabe')][] = implode('<br>', $dates);
endif;
endforeach;
?>
<? if (count($output) === 0) : ?>
<?= htmlReady($ort) ?: _("nicht angegeben") ?>
<?= htmlReady($ort) ?: _('Keine Raumangabe') ?>
<? else: ?>
<table class="default">
<? foreach ($output as $room => $dates) : ?>
<tr>
<td style="vertical-align: top"><?= $room ?></td>
<td>
<? $dates = implode('<br>', $dates) ?>
<? if (mb_strlen($dates) > 222 && !$disable_list_shrinking) : ?>
<?= mb_substr($dates, 0, 228) ?>
<div class="more-location-dates-infos" style="display:none">
<?= $dates ?>
</div>
<div>
<span class='more-location-digits'>...</span>
<a class="more-location-dates" style="cursor: pointer; margin-left: 3px">(mehr)</a>
</div>
<? else : ?>
<?= $dates ?>
<? endif ?>
</td>
<dl>
<? foreach ($output as $room_html => $dates) : ?>
<dt><?= $room_html ?></dt>
<? foreach ($dates as $date) : ?>
<dd>
<?= $date ?>
</dd>
<? endforeach ?>
<? endforeach ?>
</table>
<? endif ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment