Fixed shifts filter toggle and "hide on print" classes

This commit is contained in:
Igor Scheller 2021-07-24 17:04:45 +02:00 committed by Michael Weimann
parent 4428266488
commit 08188fa32a
No known key found for this signature in database
GPG Key ID: 34F0524D4DA694A1
7 changed files with 30 additions and 23 deletions

View File

@ -264,7 +264,7 @@ function view_user_shifts()
button( button(
'javascript: checkOwnTypes(\'selection_types\', ' . json_encode($ownTypes) . ')', 'javascript: checkOwnTypes(\'selection_types\', ' . json_encode($ownTypes) . ')',
__('Own'), __('Own'),
'hidden-print' 'd-print-none'
), ),
] ]
), ),
@ -278,6 +278,7 @@ function view_user_shifts()
'shifts_table' => msg() . $shiftCalendarRenderer->render(), 'shifts_table' => msg() . $shiftCalendarRenderer->render(),
'ical_text' => ical_hint(), 'ical_text' => ical_hint(),
'filter' => __('Filter'), 'filter' => __('Filter'),
'filter_toggle' => __('shifts.filter.toggle'),
'set_yesterday' => __('Yesterday'), 'set_yesterday' => __('Yesterday'),
'set_today' => __('Today'), 'set_today' => __('Today'),
'set_tomorrow' => __('Tomorrow'), 'set_tomorrow' => __('Tomorrow'),
@ -346,8 +347,8 @@ function make_select($items, $selected, $name, $title = null, $additionalButtons
} }
$buttons = []; $buttons = [];
$buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', true)', __('All'), 'hidden-print'); $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', true)', __('All'), 'd-print-none');
$buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', false)', __('None'), 'hidden-print'); $buttons[] = button('javascript: checkAll(\'selection_' . $name . '\', false)', __('None'), 'd-print-none');
$buttons = array_merge($buttons, $additionalButtons); $buttons = array_merge($buttons, $additionalButtons);
$html .= buttons($buttons); $html .= buttons($buttons);

View File

@ -193,7 +193,7 @@ class ShiftCalendarShiftRenderer
. '</a> ' . '</a> '
. button( . button(
shift_entry_create_link($shift, $angeltype), shift_entry_create_link($shift, $angeltype),
__('Sign up'), 'btn-sm btn-primary hidden-print' __('Sign up'), 'btn-sm btn-primary d-print-none'
); );
break; break;
@ -261,7 +261,7 @@ class ShiftCalendarShiftRenderer
{ {
$header_buttons = ''; $header_buttons = '';
if (auth()->can('admin_shifts')) { if (auth()->can('admin_shifts')) {
$header_buttons = '<div class="pull-right hidden-print">' . table_buttons([ $header_buttons = '<div class="pull-right d-print-none">' . table_buttons([
button( button(
page_link_to('user_shifts', ['edit_shift' => $shift['SID']]), page_link_to('user_shifts', ['edit_shift' => $shift['SID']]),
icon('pencil'), icon('pencil'),

View File

@ -204,7 +204,7 @@ window.addEventListener('DOMContentLoaded', () => {
return; return;
} }
filter.classList.remove('in'); filter.classList.remove('show');
}); });
$(() => { $(() => {
if (typeof (localStorage) === 'undefined') { if (typeof (localStorage) === 'undefined') {

View File

@ -53,6 +53,9 @@ msgstr "Der Schichttyp konnte nicht gefunden werden."
msgid "schedule.import.success" msgid "schedule.import.success"
msgstr "Das Programm wurde erfolgreich importiert." msgstr "Das Programm wurde erfolgreich importiert."
msgid "shifts.filter.toggle"
msgstr "Filter verstecken/anzeigen"
msgid "validation.schedule-url.required" msgid "validation.schedule-url.required"
msgstr "Bitte gib eine Programm URL an." msgstr "Bitte gib eine Programm URL an."

View File

@ -51,6 +51,9 @@ msgstr "The shift type can't not be found."
msgid "schedule.import.success" msgid "schedule.import.success"
msgstr "Schedule import successful." msgstr "Schedule import successful."
msgid "shifts.filter.toggle"
msgstr "collapse/show filters"
msgid "validation.schedule-url.required" msgid "validation.schedule-url.required"
msgstr "The schedule URL is required." msgstr "The schedule URL is required."

View File

@ -44,8 +44,8 @@
{%- endif %} {%- endif %}
<tr> <tr>
<td class="{{ td_type }}">{{ entry.created_at.format(__('Y-m-d H:i')) }}</td> <td class="table-{{ td_type }}">{{ entry.created_at.format(__('Y-m-d H:i')) }}</td>
<td class="{{ td_type }}"> <td class="table-{{ td_type }}">
<span class="badge bg-{{ type }}">{{ entry.level|capitalize }}</span> <!-- //todo bs5 --> <span class="badge bg-{{ type }}">{{ entry.level|capitalize }}</span> <!-- //todo bs5 -->
</td> </td>
<td>{{ entry.message|nl2br }}</td> <td>{{ entry.message|nl2br }}</td>

View File

@ -32,7 +32,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="form-group hidden-print" style="margin-top: .5em"> <div class="form-group d-print-none" style="margin-top: .5em">
<div class="btn-group"> <div class="btn-group">
<a href="javascript:setDay(-1)" class="btn btn-secondary ">%set_yesterday%</a> <a href="javascript:setDay(-1)" class="btn btn-secondary ">%set_yesterday%</a>
<a href="javascript:setDay()" class="btn btn-secondary ">%set_today%</a> <a href="javascript:setDay()" class="btn btn-secondary ">%set_today%</a>
@ -45,33 +45,33 @@
<a href="javascript:setHours(8)" class="btn btn-secondary ">%set_next_8h%</a> <a href="javascript:setHours(8)" class="btn btn-secondary ">%set_next_8h%</a>
</div> </div>
</div> </div>
<div class="form-group hidden-print" style="margin-top: .5em"> <div class="form-group d-print-none" style="margin-top: .5em">
<div class="btn-group"> <div class="btn-group">
%buttons% %buttons%
</div> </div>
</div> </div>
<div class="row hidden-print"> <div class="row d-print-none">
<div class="col-md-12"> <div class="col-md-12">
<input class="btn btn-primary" type="submit" style="width:100%; margin: 1em 0" value="%filter%"> <input class="btn btn-primary" type="submit" style="width:100%; margin: 1em 0" value="%filter%">
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<button class="btn btn-info btn-sm hidden-print" style="margin-top: 20px; margin-bottom:10px" type="button" <button class="btn btn-info btn-sm mb-3 d-print-none" type="button"
data-toggle="collapse" data-bs-toggle="collapse" data-bs-target="#collapseShiftsFilterSelect"
data-target="#collapseShiftsFilterSelect" aria-expanded="true" aria-expanded="true" aria-controls="collapseShiftsFilterSelect"
aria-controls="collapseShiftsFilterSelect"
> >
collapse/show filters %filter_toggle%
</button> </button>
<div class="collapse in" id="collapseShiftsFilterSelect">
<div class="collapse show d-print-none" id="collapseShiftsFilterSelect">
<div class="row"> <div class="row">
<div class="col-xs-4 col-xxs-12">%room_select%</div> <div class="col col-xs-4 col-xxs-12">%room_select%</div>
<div class="col-xs-4 col-xxs-12">%type_select%</div> <div class="col col-xs-4 col-xxs-12">%type_select%</div>
<div class="col-xs-4 col-xxs-12">%filled_select%</div> <div class="col col-xs-4 col-xxs-12">%filled_select%</div>
</div> </div>
<div class="row hidden-print"> <div class="row">
<div class="col-md-12" style="margin: 1em 0"> <div class="col col-md-12 m-1">
<p>%task_notice%</p> <p>%task_notice%</p>
</div> </div>
</div> </div>
@ -82,6 +82,6 @@
%shifts_table% %shifts_table%
<div class="hidden-print"> <div class="d-print-none">
%ical_text% %ical_text%
</div> </div>