back buttons on edit and deletion pages
This commit is contained in:
parent
185b7e3fb6
commit
89321306bc
|
@ -199,8 +199,9 @@ function shift_edit_controller()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$link = button(page_link_to('user-shifts'), icon('chevron-left'), 'btn-sm');
|
||||||
return page_with_title(
|
return page_with_title(
|
||||||
shifts_title(),
|
$link . ' ' . shifts_title(),
|
||||||
[
|
[
|
||||||
msg(),
|
msg(),
|
||||||
'<noscript>'
|
'<noscript>'
|
||||||
|
@ -270,7 +271,10 @@ function shift_delete_controller()
|
||||||
throw_redirect(page_link_to('user_shifts'));
|
throw_redirect(page_link_to('user_shifts'));
|
||||||
}
|
}
|
||||||
|
|
||||||
return page_with_title(shifts_title(), [
|
$link = button(page_link_to('user-shifts'), icon('chevron-left'), 'btn-sm');
|
||||||
|
return page_with_title(
|
||||||
|
$link . ' ' . shifts_title(),
|
||||||
|
[
|
||||||
error(sprintf(
|
error(sprintf(
|
||||||
__('Do you want to delete the shift %s from %s to %s?'),
|
__('Do you want to delete the shift %s from %s to %s?'),
|
||||||
$shift->shiftType->name,
|
$shift->shiftType->name,
|
||||||
|
@ -281,7 +285,8 @@ function shift_delete_controller()
|
||||||
form_hidden('delete_shift', $shift->id),
|
form_hidden('delete_shift', $shift->id),
|
||||||
form_submit('delete', __('delete')),
|
form_submit('delete', __('delete')),
|
||||||
]),
|
]),
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -453,8 +453,9 @@ function admin_shifts()
|
||||||
. '</div>';
|
. '</div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$link = button(page_link_to('user-shifts'), icon('chevron-left'), 'btn-sm');
|
||||||
return page_with_title(
|
return page_with_title(
|
||||||
admin_shifts_title() . ' ' . sprintf(
|
$link . ' ' . admin_shifts_title() . ' ' . sprintf(
|
||||||
'<a href="%s">%s</a>',
|
'<a href="%s">%s</a>',
|
||||||
page_link_to('admin_shifts_history'),
|
page_link_to('admin_shifts_history'),
|
||||||
icon('clock-history')
|
icon('clock-history')
|
||||||
|
|
|
@ -303,9 +303,13 @@ function admin_user()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return page_with_title(__('Edit user'), [
|
$link = button(page_link_to('users', ['action' => 'view', 'user_id' => $user_id]), icon('chevron-left'), 'btn-sm');
|
||||||
|
return page_with_title(
|
||||||
|
$link . ' ' . __('Edit user'),
|
||||||
|
[
|
||||||
$html,
|
$html,
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -80,7 +80,12 @@ function AngelType_delete_view(AngelType $angeltype)
|
||||||
*/
|
*/
|
||||||
function AngelType_edit_view(AngelType $angeltype, bool $supporter_mode)
|
function AngelType_edit_view(AngelType $angeltype, bool $supporter_mode)
|
||||||
{
|
{
|
||||||
return page_with_title(sprintf(__('Edit %s'), $angeltype->name), [
|
$link = button($angeltype->id
|
||||||
|
? page_link_to('angeltypes', ['action' => 'view', 'angeltype_id' => $angeltype->id])
|
||||||
|
: page_link_to('angeltypes'), icon('chevron-left'), 'btn-sm');
|
||||||
|
return page_with_title(
|
||||||
|
$link . ' ' . sprintf(__('Edit %s'), $angeltype->name),
|
||||||
|
[
|
||||||
buttons([
|
buttons([
|
||||||
button(page_link_to('angeltypes'), icon('person-lines-fill') . __('angeltypes.angeltypes'), 'back'),
|
button(page_link_to('angeltypes'), icon('person-lines-fill') . __('angeltypes.angeltypes'), 'back'),
|
||||||
]),
|
]),
|
||||||
|
@ -158,7 +163,8 @@ function AngelType_edit_view(AngelType $angeltype, bool $supporter_mode)
|
||||||
form_text('contact_email', __('general.email'), $angeltype->contact_email),
|
form_text('contact_email', __('general.email'), $angeltype->contact_email),
|
||||||
form_submit('submit', __('form.save')),
|
form_submit('submit', __('form.save')),
|
||||||
]),
|
]),
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -422,7 +428,9 @@ function AngelType_view(
|
||||||
ShiftCalendarRenderer $shiftCalendarRenderer,
|
ShiftCalendarRenderer $shiftCalendarRenderer,
|
||||||
$tab
|
$tab
|
||||||
) {
|
) {
|
||||||
return page_with_title(sprintf(__('Team %s'), $angeltype->name), [
|
return page_with_title(
|
||||||
|
sprintf(__('Team %s'), $angeltype->name),
|
||||||
|
[
|
||||||
AngelType_view_buttons($angeltype, $user_angeltype, $admin_angeltypes, $supporter, $user_driver_license, $user),
|
AngelType_view_buttons($angeltype, $user_angeltype, $admin_angeltypes, $supporter, $user_driver_license, $user),
|
||||||
msg(),
|
msg(),
|
||||||
tabs([
|
tabs([
|
||||||
|
@ -439,7 +447,9 @@ function AngelType_view(
|
||||||
$shiftCalendarRenderer
|
$shiftCalendarRenderer
|
||||||
),
|
),
|
||||||
], $tab),
|
], $tab),
|
||||||
], true);
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -213,7 +213,14 @@ function ShiftEntry_edit_view(
|
||||||
$comment = '';
|
$comment = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return page_with_title(__('Edit shift entry'), [
|
$link = button(
|
||||||
|
page_link_to('users', ['action' => 'view', 'user_id' => $angel->id]),
|
||||||
|
icon('chevron-left'),
|
||||||
|
'btn-sm'
|
||||||
|
);
|
||||||
|
return page_with_title(
|
||||||
|
$link . ' ' . __('Edit shift entry'),
|
||||||
|
[
|
||||||
msg(),
|
msg(),
|
||||||
form([
|
form([
|
||||||
form_info(__('Angel:'), User_Nick_render($angel)),
|
form_info(__('Angel:'), User_Nick_render($angel)),
|
||||||
|
@ -225,5 +232,6 @@ function ShiftEntry_edit_view(
|
||||||
join('', $freeload_form),
|
join('', $freeload_form),
|
||||||
form_submit('submit', __('form.save')),
|
form_submit('submit', __('form.save')),
|
||||||
]),
|
]),
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,15 @@ function ShiftType_delete_view(ShiftType $shifttype)
|
||||||
*/
|
*/
|
||||||
function ShiftType_edit_view($name, $description, $shifttype_id)
|
function ShiftType_edit_view($name, $description, $shifttype_id)
|
||||||
{
|
{
|
||||||
return page_with_title($shifttype_id ? __('Edit shifttype') : __('Create shifttype'), [
|
return page_with_title(
|
||||||
|
$shifttype_id
|
||||||
|
? (button(
|
||||||
|
page_link_to('shifttypes', ['action' => 'view', 'shifttype_id' => $shifttype_id]),
|
||||||
|
icon('chevron-left'),
|
||||||
|
'btn-sm'
|
||||||
|
) . ' ' . __('Edit shifttype'))
|
||||||
|
: (button(page_link_to('shifttypes'), icon('chevron-left'), 'btn-sm') . ' ' . __('Create shifttype')),
|
||||||
|
[
|
||||||
msg(),
|
msg(),
|
||||||
buttons([
|
buttons([
|
||||||
button(page_link_to('shifttypes'), shifttypes_title(), 'back'),
|
button(page_link_to('shifttypes'), shifttypes_title(), 'back'),
|
||||||
|
@ -56,7 +64,9 @@ function ShiftType_edit_view($name, $description, $shifttype_id)
|
||||||
form_info('', __('Please use markdown for the description.')),
|
form_info('', __('Please use markdown for the description.')),
|
||||||
form_submit('submit', __('form.save')),
|
form_submit('submit', __('form.save')),
|
||||||
]),
|
]),
|
||||||
], true);
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -12,10 +12,10 @@ use Engelsystem\Models\User\User;
|
||||||
*/
|
*/
|
||||||
function UserDriverLicense_edit_view($user_source, $user_driver_license)
|
function UserDriverLicense_edit_view($user_source, $user_driver_license)
|
||||||
{
|
{
|
||||||
return page_with_title(sprintf(__('Edit %s driving license information'), User_Nick_render($user_source)), [
|
$link = button(user_link($user_source->id), icon('chevron-left'), 'btn-sm');
|
||||||
buttons([
|
return page_with_title(
|
||||||
button(user_link($user_source->id), __('Back to profile'), 'back'),
|
$link . ' ' . sprintf(__('Edit %s driving license information'), User_Nick_render($user_source)),
|
||||||
]),
|
[
|
||||||
msg(),
|
msg(),
|
||||||
form([
|
form([
|
||||||
form_info(__('Privacy'), __('Your driving license information is only visible for supporters and admins.')),
|
form_info(__('Privacy'), __('Your driving license information is only visible for supporters and admins.')),
|
||||||
|
@ -51,5 +51,7 @@ function UserDriverLicense_edit_view($user_source, $user_driver_license)
|
||||||
], 'driving_license'),
|
], 'driving_license'),
|
||||||
form_submit('submit', __('form.save')),
|
form_submit('submit', __('form.save')),
|
||||||
]),
|
]),
|
||||||
], true);
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,11 +43,11 @@ function User_delete_view($user)
|
||||||
*/
|
*/
|
||||||
function User_edit_vouchers_view($user)
|
function User_edit_vouchers_view($user)
|
||||||
{
|
{
|
||||||
return page_with_title(sprintf(__('%s\'s vouchers'), User_Nick_render($user)), [
|
$link = button(user_link($user->id), icon('chevron-left'), 'btn-sm');
|
||||||
|
return page_with_title(
|
||||||
|
$link . ' ' . sprintf(__('%s\'s vouchers'), User_Nick_render($user)),
|
||||||
|
[
|
||||||
msg(),
|
msg(),
|
||||||
buttons([
|
|
||||||
button(user_link($user->id), icon('chevron-left') . __('back')),
|
|
||||||
]),
|
|
||||||
info(sprintf(
|
info(sprintf(
|
||||||
$user->state->force_active
|
$user->state->force_active
|
||||||
? __('Angel can receive another %d vouchers and is FA.')
|
? __('Angel can receive another %d vouchers and is FA.')
|
||||||
|
@ -61,7 +61,8 @@ function User_edit_vouchers_view($user)
|
||||||
],
|
],
|
||||||
page_link_to('users', ['action' => 'edit_vouchers', 'user_id' => $user->id])
|
page_link_to('users', ['action' => 'edit_vouchers', 'user_id' => $user->id])
|
||||||
),
|
),
|
||||||
]);
|
]
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -7,6 +7,10 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>
|
<h1>
|
||||||
|
{% if not is_index|default(false) %}
|
||||||
|
{{ m.button(m.icon('chevron-left'), room ? url('/rooms', {'action': 'view', 'room_id': room.id}) : url('/admin/rooms'), 'secondary', 'sm') }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{{ block('title') }}
|
{{ block('title') }}
|
||||||
|
|
||||||
{% if is_index|default(false) %}
|
{% if is_index|default(false) %}
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>{{ block('title') }}: <small>{{ m.user(userdata) }}</small></h1>
|
<h1>
|
||||||
|
{{ m.button(m.icon('chevron-left'), url('/admin-active'), null, 'sm') }}
|
||||||
|
{{ block('title') }}: <small>{{ m.user(userdata) }}</small>
|
||||||
|
</h1>
|
||||||
|
|
||||||
{% include 'layouts/parts/messages.twig' %}
|
{% include 'layouts/parts/messages.twig' %}
|
||||||
|
|
||||||
|
|
|
@ -6,16 +6,16 @@
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>{{ block('title') }}</h1>
|
<h1>
|
||||||
|
{{ m.button(m.icon('chevron-left'), url('/users', {action: 'view', user_id: user.id}), null, 'sm') }}
|
||||||
|
{{ block('title') }}
|
||||||
|
</h1>
|
||||||
|
|
||||||
{% include 'layouts/parts/messages.twig' %}
|
{% include 'layouts/parts/messages.twig' %}
|
||||||
|
|
||||||
<form method="post">
|
<form method="post">
|
||||||
{{ csrf() }}
|
{{ csrf() }}
|
||||||
<div class="row g-2">
|
<div class="row g-2">
|
||||||
<div class="col-12">
|
|
||||||
{{ m.button(__('back'), url('/users', {action: 'view', user_id: user.id})) }}
|
|
||||||
</div>
|
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div>
|
<div>
|
||||||
<label class="form-label">{{ __('User') }}</label>
|
<label class="form-label">{{ __('User') }}</label>
|
||||||
|
|
|
@ -6,7 +6,10 @@
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>{{ block('title') }}</h1>
|
<h1>
|
||||||
|
{{ m.button(m.icon('chevron-left'), url('/faq'), 'secondary', 'sm') }}
|
||||||
|
{{ block('title') }}
|
||||||
|
</h1>
|
||||||
|
|
||||||
{% include 'layouts/parts/messages.twig' %}
|
{% include 'layouts/parts/messages.twig' %}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,10 @@
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>{{ block('title') }}</h1>
|
<h1>
|
||||||
|
{{ m.button(m.icon('chevron-left'), url('/news'), null, 'sm') }}
|
||||||
|
{{ block('title') }}
|
||||||
|
</h1>
|
||||||
|
|
||||||
{% include 'layouts/parts/messages.twig' %}
|
{% include 'layouts/parts/messages.twig' %}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,10 @@
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1>{{ block('title') }}</h1>
|
<h1>
|
||||||
|
{{ m.button(m.icon('chevron-left'), url('/questions'), null, 'sm') }}
|
||||||
|
{{ block('title') }}
|
||||||
|
</h1>
|
||||||
|
|
||||||
{% include 'layouts/parts/messages.twig' %}
|
{% include 'layouts/parts/messages.twig' %}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,13 @@
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="mb-5">
|
<div class="mb-5">
|
||||||
<h1>{{ __('page.sign-up.title') }}</h1>
|
<h1>
|
||||||
|
{{ has_permission_to('admin_user')
|
||||||
|
? m.button(m.icon('chevron-left'), url('/users'), null, 'sm')
|
||||||
|
: ''
|
||||||
|
}}
|
||||||
|
{{ __('page.sign-up.title') }}
|
||||||
|
</h1>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% include 'layouts/parts/messages.twig' %}
|
{% include 'layouts/parts/messages.twig' %}
|
||||||
|
|
Loading…
Reference in New Issue