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'));
})->toArray();
$link = button(page_link_to('admin-shifts'), icon('plus-lg'), 'add');
return page([
div('col-md-12', [
msg(),
view(__DIR__ . '/../../resources/views/pages/user-shifts.html', [
'title' => shifts_title(),
'add_link' => auth()->can('admin_shifts') ? $link : '',
'room_select' => make_select(
$rooms,
$shiftsFilter->getRooms(),

View File

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

View File

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

View File

@ -174,11 +174,9 @@ function Users_view(
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(),
buttons([
button(page_link_to('sign-up'), icon('plus-lg') . __('New user')),
]),
table($user_table_headers, $usersList),
]);
}

View File

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

View File

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