creation of new entity's from overview pages (+ sign)

This commit is contained in:
Xu 2023-10-24 14:01:46 +02:00 committed by Igor Scheller
parent 89321306bc
commit 1397fe90ce
6 changed files with 37 additions and 40 deletions

View File

@ -289,11 +289,14 @@ function view_user_shifts()
return Carbon::make($value)->format(__('Y-m-d')); return Carbon::make($value)->format(__('Y-m-d'));
})->toArray(); })->toArray();
$link = button(page_link_to('admin-shifts'), icon('plus-lg'), 'add');
return page([ return page([
div('col-md-12', [ div('col-md-12', [
msg(), msg(),
view(__DIR__ . '/../../resources/views/pages/user-shifts.html', [ view(__DIR__ . '/../../resources/views/pages/user-shifts.html', [
'title' => shifts_title(), 'title' => shifts_title(),
'add_link' => auth()->can('admin_shifts') ? $link : '',
'room_select' => make_select( 'room_select' => make_select(
$rooms, $rooms,
$shiftsFilter->getRooms(), $shiftsFilter->getRooms(),

View File

@ -589,20 +589,22 @@ function AngelTypes_render_contact_info(AngelType $angeltype)
*/ */
function AngelTypes_list_view($angeltypes, bool $admin_angeltypes) function AngelTypes_list_view($angeltypes, bool $admin_angeltypes)
{ {
return page_with_title(angeltypes_title(), [ $link = button(page_link_to('angeltypes', ['action' => 'edit']), icon('plus-lg'), 'add');
msg(), return page_with_title(
buttons([ angeltypes_title() . ' ' . ($admin_angeltypes ? $link : ''),
$admin_angeltypes [
? button(page_link_to('angeltypes', ['action' => 'edit']), __('New angeltype'), 'add') msg(),
: '', buttons([
button(url('/angeltypes/about'), __('angeltypes.about')), button(url('/angeltypes/about'), __('angeltypes.about')),
]), ]),
table([ table([
'name' => __('general.name'), 'name' => __('general.name'),
'is_restricted' => icon('mortarboard-fill') . __('angeltypes.restricted'), 'is_restricted' => icon('mortarboard-fill') . __('angeltypes.restricted'),
'shift_self_signup_allowed' => icon('pencil-square') . __('shift.self_signup.allowed'), 'shift_self_signup_allowed' => icon('pencil-square') . __('shift.self_signup.allowed'),
'membership' => __('Membership'), 'membership' => __('Membership'),
'actions' => '', 'actions' => '',
], $angeltypes), ], $angeltypes),
], true); ],
true,
);
} }

View File

@ -124,14 +124,17 @@ function ShiftTypes_list_view($shifttypes)
]); ]);
} }
return page_with_title(shifttypes_title(), [ $link = button(page_link_to('shifttypes', ['action' => 'edit']), icon('plus-lg'), 'add');
msg(), return page_with_title(
buttons([ shifttypes_title() . ' ' . $link,
button(page_link_to('shifttypes', ['action' => 'edit']), __('New shifttype'), 'add'), [
]), msg(),
table([
'name' => __('general.name'), table([
'actions' => '', 'name' => __('general.name'),
], $shifttypes), 'actions' => '',
], true); ], $shifttypes),
],
true,
);
} }

View File

@ -174,11 +174,9 @@ function Users_view(
unset($user_table_headers[$key]); unset($user_table_headers[$key]);
} }
return page_with_title(__('All users'), [ $link = button(page_link_to('sign-up'), icon('plus-lg'), 'add');
return page_with_title(__('All users') . ' ' . $link, [
msg(), msg(),
buttons([
button(page_link_to('sign-up'), icon('plus-lg') . __('New user')),
]),
table($user_table_headers, $usersList), table($user_table_headers, $usersList),
]); ]);
} }

View File

@ -1048,9 +1048,6 @@ msgstr "Alle bestätigen"
msgid "deny all" msgid "deny all"
msgstr "Alle ablehnen" msgstr "Alle ablehnen"
msgid "New angeltype"
msgstr "Neuer Engeltyp"
msgid "Membership" msgid "Membership"
msgstr "Mitgliedschaft" msgstr "Mitgliedschaft"
@ -1203,9 +1200,6 @@ msgstr "Schichttyp bearbeiten"
msgid "Create shifttype" msgid "Create shifttype"
msgstr "Schichttyp erstellen" msgstr "Schichttyp erstellen"
msgid "New shifttype"
msgstr "Neuer Schichttyp"
msgid "Location" msgid "Location"
msgstr "Ort" msgstr "Ort"
@ -1297,9 +1291,6 @@ msgstr "T-Shirt"
msgid "Last login" msgid "Last login"
msgstr "Letzter Login" msgstr "Letzter Login"
msgid "New user"
msgstr "Neuer User"
msgid "Next shift %c" msgid "Next shift %c"
msgstr "Nächste Schicht %c" msgstr "Nächste Schicht %c"

View File

@ -2,7 +2,7 @@
<input type="hidden" name="p" value="user_shifts"> <input type="hidden" name="p" value="user_shifts">
<div class="row"> <div class="row">
<div class="col-md-6"> <div class="col-md-6">
<h1>%title%</h1> <h1>%title% %add_link%</h1>
<div class="row align-items-center"> <div class="row align-items-center">
<div class="col-12 col-xxl-5 row pe-xxl-0"> <div class="col-12 col-xxl-5 row pe-xxl-0">
<div class="col-6 pe-xxl-0">%start_select%</div> <div class="col-6 pe-xxl-0">%start_select%</div>