From 08188fa32a8948d8d5763f0b3c6543401fc4ccf7 Mon Sep 17 00:00:00 2001 From: Igor Scheller Date: Sat, 24 Jul 2021 17:04:45 +0200 Subject: [PATCH] Fixed shifts filter toggle and "hide on print" classes --- includes/pages/user_shifts.php | 7 +++-- includes/view/ShiftCalendarShiftRenderer.php | 4 +-- resources/assets/js/forms.js | 2 +- resources/lang/de_DE/additional.po | 3 ++ resources/lang/en_US/additional.po | 3 ++ resources/views/admin/log.twig | 4 +-- resources/views/pages/user-shifts.html | 30 ++++++++++---------- 7 files changed, 30 insertions(+), 23 deletions(-) diff --git a/includes/pages/user_shifts.php b/includes/pages/user_shifts.php index e098eade..7751147d 100644 --- a/includes/pages/user_shifts.php +++ b/includes/pages/user_shifts.php @@ -264,7 +264,7 @@ function view_user_shifts() button( 'javascript: checkOwnTypes(\'selection_types\', ' . json_encode($ownTypes) . ')', __('Own'), - 'hidden-print' + 'd-print-none' ), ] ), @@ -278,6 +278,7 @@ function view_user_shifts() 'shifts_table' => msg() . $shiftCalendarRenderer->render(), 'ical_text' => ical_hint(), 'filter' => __('Filter'), + 'filter_toggle' => __('shifts.filter.toggle'), 'set_yesterday' => __('Yesterday'), 'set_today' => __('Today'), 'set_tomorrow' => __('Tomorrow'), @@ -346,8 +347,8 @@ function make_select($items, $selected, $name, $title = null, $additionalButtons } $buttons = []; - $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', true)', __('All'), 'hidden-print'); - $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', false)', __('None'), 'hidden-print'); + $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', true)', __('All'), 'd-print-none'); + $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', false)', __('None'), 'd-print-none'); $buttons = array_merge($buttons, $additionalButtons); $html .= buttons($buttons); diff --git a/includes/view/ShiftCalendarShiftRenderer.php b/includes/view/ShiftCalendarShiftRenderer.php index 210bcb7f..5235501e 100644 --- a/includes/view/ShiftCalendarShiftRenderer.php +++ b/includes/view/ShiftCalendarShiftRenderer.php @@ -193,7 +193,7 @@ class ShiftCalendarShiftRenderer . ' ' . button( shift_entry_create_link($shift, $angeltype), - __('Sign up'), 'btn-sm btn-primary hidden-print' + __('Sign up'), 'btn-sm btn-primary d-print-none' ); break; @@ -261,7 +261,7 @@ class ShiftCalendarShiftRenderer { $header_buttons = ''; if (auth()->can('admin_shifts')) { - $header_buttons = '
' . table_buttons([ + $header_buttons = '
' . table_buttons([ button( page_link_to('user_shifts', ['edit_shift' => $shift['SID']]), icon('pencil'), diff --git a/resources/assets/js/forms.js b/resources/assets/js/forms.js index b9fbcb0d..1d073041 100644 --- a/resources/assets/js/forms.js +++ b/resources/assets/js/forms.js @@ -204,7 +204,7 @@ window.addEventListener('DOMContentLoaded', () => { return; } - filter.classList.remove('in'); + filter.classList.remove('show'); }); $(() => { if (typeof (localStorage) === 'undefined') { diff --git a/resources/lang/de_DE/additional.po b/resources/lang/de_DE/additional.po index 875c7f0b..0917a424 100644 --- a/resources/lang/de_DE/additional.po +++ b/resources/lang/de_DE/additional.po @@ -53,6 +53,9 @@ msgstr "Der Schichttyp konnte nicht gefunden werden." msgid "schedule.import.success" msgstr "Das Programm wurde erfolgreich importiert." +msgid "shifts.filter.toggle" +msgstr "Filter verstecken/anzeigen" + msgid "validation.schedule-url.required" msgstr "Bitte gib eine Programm URL an." diff --git a/resources/lang/en_US/additional.po b/resources/lang/en_US/additional.po index db0e33ea..0597b662 100644 --- a/resources/lang/en_US/additional.po +++ b/resources/lang/en_US/additional.po @@ -51,6 +51,9 @@ msgstr "The shift type can't not be found." msgid "schedule.import.success" msgstr "Schedule import successful." +msgid "shifts.filter.toggle" +msgstr "collapse/show filters" + msgid "validation.schedule-url.required" msgstr "The schedule URL is required." diff --git a/resources/views/admin/log.twig b/resources/views/admin/log.twig index 4e746dce..59bec13d 100644 --- a/resources/views/admin/log.twig +++ b/resources/views/admin/log.twig @@ -44,8 +44,8 @@ {%- endif %} - {{ entry.created_at.format(__('Y-m-d H:i')) }} - + {{ entry.created_at.format(__('Y-m-d H:i')) }} + {{ entry.level|capitalize }} {{ entry.message|nl2br }} diff --git a/resources/views/pages/user-shifts.html b/resources/views/pages/user-shifts.html index de2b8d97..479aa823 100644 --- a/resources/views/pages/user-shifts.html +++ b/resources/views/pages/user-shifts.html @@ -32,7 +32,7 @@
-
+ -
+
%buttons%
-
+
- -
+ +
-
%room_select%
-
%type_select%
-
%filled_select%
+
%room_select%
+
%type_select%
+
%filled_select%
-
-
+
+

%task_notice%

@@ -82,6 +82,6 @@ %shifts_table% -
+
%ical_text%