From bd6c2bddb4d00f074751c4ac5db8e2c6e8e2c85c Mon Sep 17 00:00:00 2001 From: Moritz Strohm Date: Mon, 23 Jan 2023 14:06:33 +0000 Subject: made the times / rooms section on the course details page more accessible, closes #1244 Closes #1244 Merge request studip/studip!840 --- app/views/course/details/index.php | 4 +- lib/dates.inc.php | 3 +- lib/raumzeit/SingleDate.class.php | 6 +-- .../assets/javascripts/bootstrap/application.js | 13 ------- templates/dates/seminar_html_location.php | 44 +++++++++------------- 5 files changed, 22 insertions(+), 48 deletions(-) diff --git a/app/views/course/details/index.php b/app/views/course/details/index.php index 2e3a1a9..d508181 100644 --- a/app/views/course/details/index.php +++ b/app/views/course/details/index.php @@ -310,12 +310,12 @@
-

/

+

getDatesTemplate( 'dates/seminar_html_location', - ['ort' => $course->ort, 'disable_list_shrinking' => true, 'show_room' => false] + ['ort' => $course->ort] ) ?>
diff --git a/lib/dates.inc.php b/lib/dates.inc.php index e9f0841..8538d24 100644 --- a/lib/dates.inc.php +++ b/lib/dates.inc.php @@ -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"])) { diff --git a/lib/raumzeit/SingleDate.class.php b/lib/raumzeit/SingleDate.class.php index 6740731..8909983 100644 --- a/lib/raumzeit/SingleDate.class.php +++ b/lib/raumzeit/SingleDate.class.php @@ -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)); } } diff --git a/resources/assets/javascripts/bootstrap/application.js b/resources/assets/javascripts/bootstrap/application.js index cafd07e..a7101fa 100644 --- a/resources/assets/javascripts/bootstrap/application.js +++ b/resources/assets/javascripts/bootstrap/application.js @@ -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)); /* ------------------------------------------------------------------------ diff --git a/templates/dates/seminar_html_location.php b/templates/dates/seminar_html_location.php index 976edbf..1c74444 100644 --- a/templates/dates/seminar_html_location.php +++ b/templates/dates/seminar_html_location.php @@ -23,8 +23,9 @@ if (is_array($dates['regular']['turnus_data'])) foreach ($dates['regular']['turn if ($link) { $output[ '' - . htmlReady($room_obj->name) . '' - ][] = $cycle['tostring_short'] .' ('. $count .'x)'; + . htmlReady($room_obj->name) + . '' + ][] = $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[ '' - . htmlReady($room_obj->name) . '' + . htmlReady($room_obj->name) + . '' ][] = implode('
', shrink_dates($dates)); } else { $output[htmlReady($room_obj->name)][] = implode('
', shrink_dates($dates)); @@ -71,35 +73,23 @@ foreach ($output_dates as $dates) : elseif (isset($dates[0]['raum'])) : $output['(' . htmlReady($dates[0]['raum']) . ')'][] = implode('
', shrink_dates($dates)); else : - $output[_('k.A.')][] = implode('
', $dates); + $output[_('Keine Raumangabe')][] = implode('
', $dates); endif; endforeach; ?> - + - - $dates) : ?> - - - +
+ $dates) : ?> +
+ +
+ +
+
- ', $dates) ?> - - 222 && !$disable_list_shrinking) : ?> - - -
- ... - (mehr) -
- - - -
-- cgit v1.0