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 @@ ...@@ -310,12 +310,12 @@
<article class="studip"> <article class="studip">
<header> <header>
<h1><?= _('Veranstaltungsort') ?> / <?= _('Veranstaltungszeiten')?></h1> <h1><?= _('Räume und Zeiten') ?></h1>
</header> </header>
<section> <section>
<?= $sem->getDatesTemplate( <?= $sem->getDatesTemplate(
'dates/seminar_html_location', 'dates/seminar_html_location',
['ort' => $course->ort, 'disable_list_shrinking' => true, 'show_room' => false] ['ort' => $course->ort]
) ?> ) ?>
</section> </section>
</article> </article>
......
...@@ -223,8 +223,7 @@ function shrink_dates($dates) { ...@@ -223,8 +223,7 @@ function shrink_dates($dates) {
} }
if (empty($dates[$i]["conjuncted"]) || empty($dates[$i+1]["conjuncted"])) { if (empty($dates[$i]["conjuncted"]) || empty($dates[$i+1]["conjuncted"])) {
$return_string .= ' ' . strftime('%A', $dates[$i]['start_time']) .'.'; $return_string .= strftime(' %A, %d.%m.%Y', $dates[$i]['start_time']);
$return_string .= date (" d.m.y", $dates[$i]["start_time"]);
} }
if (!$conjuncted && !empty($dates[$i+1]["conjuncted"])) { if (!$conjuncted && !empty($dates[$i+1]["conjuncted"])) {
......
...@@ -409,12 +409,10 @@ class SingleDate ...@@ -409,12 +409,10 @@ class SingleDate
if (!$this->date) { if (!$this->date) {
return null; return null;
} elseif ((($end_hours - $start_hours) / 60 / 60) > 23) { } elseif ((($end_hours - $start_hours) / 60 / 60) > 23) {
return sprintf('%s , %s (%s)',strftime('%a', $this->date), return sprintf('%s (%s)', strftime('%A, %d.%m.%Y', $this->date),
strftime('%d.%m.%Y', $this->date),
_('ganztägig')); _('ganztägig'));
} else { } else {
return sprintf('%s., %s - %s',strftime('%a', $this->date), return sprintf('%s - %s', strftime('%A, %d.%m.%Y %H:%M', $this->date),
strftime('%d.%m.%Y %H:%M', $this->date),
strftime('%H:%M', $this->end_time)); strftime('%H:%M', $this->end_time));
} }
} }
......
...@@ -171,19 +171,6 @@ STUDIP.domReady(function () { ...@@ -171,19 +171,6 @@ STUDIP.domReady(function () {
$('.more-dates').attr('title', $gettext('Blenden Sie die restlichen Termine ein')); $('.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)); }(jQuery));
/* ------------------------------------------------------------------------ /* ------------------------------------------------------------------------
......
...@@ -23,8 +23,9 @@ if (is_array($dates['regular']['turnus_data'])) foreach ($dates['regular']['turn ...@@ -23,8 +23,9 @@ if (is_array($dates['regular']['turnus_data'])) foreach ($dates['regular']['turn
if ($link) { if ($link) {
$output[ $output[
'<a href="' . $room_obj->getActionLink('show') . '" data-dialog="1">' '<a href="' . $room_obj->getActionLink('show') . '" data-dialog="1">'
. htmlReady($room_obj->name) . '</a>' . htmlReady($room_obj->name)
][] = $cycle['tostring_short'] .' ('. $count .'x)'; . '</a>'
][] = $cycle['tostring'] .' ('. $count .'x)';
} else { } else {
$output[htmlReady($room_obj->name)][] = $cycle['tostring_short'] .' ('. $count .'x)'; $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 ...@@ -37,7 +38,7 @@ if (is_array($dates['regular']['turnus_data'])) foreach ($dates['regular']['turn
if($count) : if($count) :
$without_location .= '(' . $count . 'x)'; $without_location .= '(' . $count . 'x)';
endif; endif;
$output[_('k.A.')][] = $without_location; $output[_('Keine Raumangabe')][] = $without_location;
endif; endif;
endforeach; endforeach;
endforeach; endforeach;
...@@ -51,7 +52,7 @@ if (isset($dates['irregular']) && is_array($dates['irregular'])) { ...@@ -51,7 +52,7 @@ if (isset($dates['irregular']) && is_array($dates['irregular'])) {
elseif (!empty($date['raum'])) : elseif (!empty($date['raum'])) :
$output_dates[$date['raum']][] = $date; $output_dates[$date['raum']][] = $date;
else : else :
$output_dates[_('k.A.')][] = $date['tostring']; $output_dates[_('Keine Raumangabe')][] = $date['tostring'];
endif; endif;
endforeach; endforeach;
} }
...@@ -63,7 +64,8 @@ foreach ($output_dates as $dates) : ...@@ -63,7 +64,8 @@ foreach ($output_dates as $dates) :
if ($link) { if ($link) {
$output[ $output[
'<a href="' . $room_obj->getActionLink('show') . '" data-dialog="1">' '<a href="' . $room_obj->getActionLink('show') . '" data-dialog="1">'
. htmlReady($room_obj->name) . '</a>' . htmlReady($room_obj->name)
. '</a>'
][] = implode('<br>', shrink_dates($dates)); ][] = implode('<br>', shrink_dates($dates));
} else { } else {
$output[htmlReady($room_obj->name)][] = implode('<br>', shrink_dates($dates)); $output[htmlReady($room_obj->name)][] = implode('<br>', shrink_dates($dates));
...@@ -71,35 +73,23 @@ foreach ($output_dates as $dates) : ...@@ -71,35 +73,23 @@ foreach ($output_dates as $dates) :
elseif (isset($dates[0]['raum'])) : elseif (isset($dates[0]['raum'])) :
$output['(' . htmlReady($dates[0]['raum']) . ')'][] = implode('<br>', shrink_dates($dates)); $output['(' . htmlReady($dates[0]['raum']) . ')'][] = implode('<br>', shrink_dates($dates));
else : else :
$output[_('k.A.')][] = implode('<br>', $dates); $output[_('Keine Raumangabe')][] = implode('<br>', $dates);
endif; endif;
endforeach; endforeach;
?> ?>
<? if (count($output) === 0) : ?> <? if (count($output) === 0) : ?>
<?= htmlReady($ort) ?: _("nicht angegeben") ?> <?= htmlReady($ort) ?: _('Keine Raumangabe') ?>
<? else: ?> <? else: ?>
<table class="default"> <dl>
<? foreach ($output as $room => $dates) : ?> <? foreach ($output as $room_html => $dates) : ?>
<tr> <dt><?= $room_html ?></dt>
<td style="vertical-align: top"><?= $room ?></td> <? foreach ($dates as $date) : ?>
<td> <dd>
<? $dates = implode('<br>', $dates) ?> <?= $date ?>
</dd>
<? 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>
<? endforeach ?> <? endforeach ?>
<? endforeach ?>
</table> </table>
<? endif ?> <? 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