From b461f2bbf09c314e14bec34276647777da0063b4 Mon Sep 17 00:00:00 2001
From: Moritz Strohm <strohm@data-quest.de>
Date: Mon, 2 Dec 2024 09:49:40 +0000
Subject: [PATCH] Polishing-TIC 3692, closes #3692

Closes #3692

Merge request studip/studip!3570
---
 app/controllers/calendar/calendar.php         |  2 +-
 app/views/calendar/calendar/import.php        |  6 ++-
 app/views/calendar/date/_add_edit_form.php    |  6 +--
 app/views/messages/write.php                  |  2 +-
 app/views/settings/calendar.php               | 45 ++++++++++---------
 lib/navigation/CalendarNavigation.php         |  3 +-
 .../assets/javascripts/lib/fullcalendar.js    |  5 +++
 .../form_inputs/RepetitionInput.vue           |  4 +-
 8 files changed, 41 insertions(+), 32 deletions(-)

diff --git a/app/controllers/calendar/calendar.php b/app/controllers/calendar/calendar.php
index e902c9336c2..7c9947a56f8 100644
--- a/app/controllers/calendar/calendar.php
+++ b/app/controllers/calendar/calendar.php
@@ -69,7 +69,7 @@ class Calendar_CalendarController extends AuthenticatedController
             $actions->addLink(
                 _('Veranstaltung auswählen'),
                 $this->url_for('calendar/calendar/add_courses'),
-                Icon::create('add'),
+                Icon::create('seminar'),
                 ['data-dialog' => 'size=medium']
             );
         }
diff --git a/app/views/calendar/calendar/import.php b/app/views/calendar/calendar/import.php
index d91025a6078..cb0a0454599 100644
--- a/app/views/calendar/calendar/import.php
+++ b/app/views/calendar/calendar/import.php
@@ -18,9 +18,11 @@
             <input type="checkbox" name="import_privat" value="1" checked>
             <?= _('Öffentliche Termine als "privat" importieren') ?>
         </label>
-        <label>
+        <label style="cursor: pointer;">
+            <input required type="file" id="fileupload" name="importfile" accept=".ics,.ifb,.iCal,.iFBf"
+                   style="display: none">
+            <?= Icon::create('upload', Icon::ROLE_CLICKABLE, ['title' => _('Datei hochladen'), 'class' => 'text-bottom']) ?>
             <span class="required"><?= _('Datei zum Importieren wählen') ?></span>
-            <input required type="file" name="importfile" accept=".ics,.ifb,.iCal,.iFBf">
         </label>
     </fieldset>
     <footer data-dialog-button>
diff --git a/app/views/calendar/date/_add_edit_form.php b/app/views/calendar/date/_add_edit_form.php
index 08f379011c0..6596a388fda 100644
--- a/app/views/calendar/date/_add_edit_form.php
+++ b/app/views/calendar/date/_add_edit_form.php
@@ -85,6 +85,9 @@
         </label>
         <label>
             <?= _('Zugriff') ?>
+            <?= tooltipIcon(
+                _('Öffentliche Termine sind systemweit sichtbar. Private Termine sind für Personen, denen der Kalender freigegeben wurde, sichtbar. Vertrauliche Termine sind hingegen nur für einen selbst sichtbar.')
+            ) ?>
             <div class="flex-row">
                 <select name="access">
                     <option value="PUBLIC" <?= $date->access === 'PUBLIC' ? 'selected' : '' ?>>
@@ -97,9 +100,6 @@
                         <?= _('Vertraulich') ?>
                     </option>
                 </select>
-                <?= tooltipIcon(
-                    _('Öffentliche Termine sind systemweit sichtbar. Private Termine sind für Personen, denen der Kalender freigegeben wurde, sichtbar. Vertrauliche Termine sind hingegen nur für einen selbst sichtbar.')
-                ) ?>
             </div>
         </label>
         <label>
diff --git a/app/views/messages/write.php b/app/views/messages/write.php
index 2c38d37ee7b..8bf05f61190 100644
--- a/app/views/messages/write.php
+++ b/app/views/messages/write.php
@@ -145,7 +145,7 @@
                     <div class="progresstext">0%</div>
                 </div>
             </div>
-            <label style="cursor: pointer;">
+            <label >
                 <input type="file" id="fileupload" multiple onChange="STUDIP.Messages.upload_from_input(this);" style="display: none;">
                 <?= Icon::create('upload')->asImg(['title' => _('Datei hochladen'), 'class' => 'text-bottom']) ?>
                 <?= _("Datei hochladen") ?>
diff --git a/app/views/settings/calendar.php b/app/views/settings/calendar.php
index aecc23463ee..6772829c52e 100644
--- a/app/views/settings/calendar.php
+++ b/app/views/settings/calendar.php
@@ -64,27 +64,29 @@ $cal_step_weeks = [
             <?= _('Einzelterminkalender') ?>
         </legend>
 
-        <label>
-            <?= _('Startuhrzeit') ?>
-            <select name="cal_start" aria-label="<?= _('Startzeit der Tages- und Wochenansicht') ?>" class="size-s">
-                <? for ($i = 0; $i < 24; $i += 1): ?>
-                    <option value="<?= $i ?>" <? if ($start == $i) echo 'selected'; ?>>
-                        <?= sprintf(_('%02u:00 Uhr'), $i) ?>
-                    </option>
-                <? endfor; ?>
-            </select>
-        </label>
-
-        <label>
-            <?= _('Enduhrzeit') ?>
-            <select name="cal_end" aria-label="<?= _('Endzeit der Tages- und Wochenansicht') ?>" class="size-s">
-                <? for ($i = 1; $i < 25; $i += 1): ?>
-                    <option value="<?= $i ?>" <? if ($end == $i) echo 'selected'; ?>>
-                        <?= sprintf(_('%02u:00 Uhr'), $i) ?>
-                    </option>
-                <? endfor; ?>
-            </select>
-        </label>
+        <div class="hgroup">
+            <label>
+                <?= _('Startuhrzeit') ?>
+                <select name="cal_start" aria-label="<?= _('Startzeit der Tages- und Wochenansicht') ?>" class="size-s">
+                    <? for ($i = 0; $i < 24; $i += 1): ?>
+                        <option value="<?= $i ?>" <? if ($start == $i) echo 'selected'; ?>>
+                            <?= sprintf(_('%02u:00 Uhr'), $i) ?>
+                        </option>
+                    <? endfor; ?>
+                </select>
+            </label>
+
+            <label>
+                <?= _('Enduhrzeit') ?>
+                <select name="cal_end" aria-label="<?= _('Endzeit der Tages- und Wochenansicht') ?>" class="size-s">
+                    <? for ($i = 1; $i < 25; $i += 1): ?>
+                        <option value="<?= $i ?>" <? if ($end == $i) echo 'selected'; ?>>
+                            <?= sprintf(_('%02u:00 Uhr'), $i) ?>
+                        </option>
+                    <? endfor; ?>
+                </select>
+            </label>
+        </div>
 
         <label>
             <?= _('Zeitintervall der Tagesansicht') ?>
@@ -151,5 +153,6 @@ $cal_step_weeks = [
         <? endif ?>
         <input type="hidden" name="view" value="calendar">
         <?= Button::createAccept(_('Übernehmen'), ['title' => _('Änderungen übernehmen')]) ?>
+        <?= Button::createCancel(_('Abbrechen')) ?>
     </footer>
 </form>
diff --git a/lib/navigation/CalendarNavigation.php b/lib/navigation/CalendarNavigation.php
index 8df16b3c4b2..f307348aa7a 100644
--- a/lib/navigation/CalendarNavigation.php
+++ b/lib/navigation/CalendarNavigation.php
@@ -20,10 +20,9 @@ class CalendarNavigation extends Navigation
      */
     public function __construct()
     {
-        $title = _('Kalender');
+        $title = _('Planer');
         $main_url = URLHelper::getURL('dispatch.php/calendar/calendar', ['defaultDate' => date('Y-m-d')]);
         if (!$GLOBALS['perm']->have_perm('admin') && Config::get()->SCHEDULE_ENABLE) {
-            $title = _('Stundenplan');
             $main_url = URLHelper::getURL('dispatch.php/calendar/schedule/index');
         }
         parent::__construct($title, $main_url);
diff --git a/resources/assets/javascripts/lib/fullcalendar.js b/resources/assets/javascripts/lib/fullcalendar.js
index 615cb2d919e..17078929e8c 100644
--- a/resources/assets/javascripts/lib/fullcalendar.js
+++ b/resources/assets/javascripts/lib/fullcalendar.js
@@ -425,6 +425,11 @@ class Fullcalendar
             locales: [enLocale, deLocale ],
             locale:  String.locale === 'de-DE' ? 'de' : 'en-gb',
             timeFormat: 'H:mm',
+            slotLabelFormat: {
+                hour: 'numeric',
+                minute: '2-digit',
+                omitZeroMinute: false
+            },
             nowIndicator: true,
             timeZone: 'local',
             studip_functions: [],
diff --git a/resources/vue/components/form_inputs/RepetitionInput.vue b/resources/vue/components/form_inputs/RepetitionInput.vue
index 55654fd23fa..2a265b1d52c 100644
--- a/resources/vue/components/form_inputs/RepetitionInput.vue
+++ b/resources/vue/components/form_inputs/RepetitionInput.vue
@@ -164,14 +164,14 @@
         </section>
         <section v-if="repetition_type_value === 'MONTHLY' && repetition_month_type_value === 'dom'">
             <label>
-                {{ $gettext('Wiederholung am einem bestimmten Tag des Monats:') }}
+                {{ $gettext('Wiederholung am einem bestimmten Tag des Monats') }}
                 <input type="number" min="1" :name="name + '_dom'"
                        v-model="repetition_dom_value">
             </label>
         </section>
         <section v-if="['MONTHLY', 'YEARLY'].includes(repetition_type_value) && repetition_month_type_value === 'dow'">
             <label>
-                {{ $gettext('Wiederholung an einem bestimmten Wochentag:') }}
+                {{ $gettext('Wiederholung an einem bestimmten Wochentag') }}
                 <day-of-week-select :name="name + '_dow'" v-model="repetition_dow_value[0]"
                                     :with_indeterminate="true"></day-of-week-select>
             </label>
-- 
GitLab