diff --git a/includes/view/User_view.php b/includes/view/User_view.php index 364c3f66..8975e682 100644 --- a/includes/view/User_view.php +++ b/includes/view/User_view.php @@ -4,6 +4,7 @@ use Carbon\Carbon; use Engelsystem\Models\Room; use Engelsystem\Models\User\User; use Engelsystem\Models\Worklog; +use Engelsystem\Renderer\Renderer; use Illuminate\Support\Collection; use Illuminate\Support\Str; @@ -37,81 +38,84 @@ function User_settings_view( $enable_dect = config('enable_dect'); $enable_planned_arrival = config('enable_planned_arrival'); - return page_with_title(settings_title(), [ - msg(), - div('row', [ - div('col-md-3 settings-menu', [ - '' - ]), - div('col-md-9', [ - heading(__('settings.profile'), 2), - form([ - form_info('', __('Here you can change your user details.')), - form_info(entry_required() . ' = ' . __('Entry required!')), - form_text('nick', __('Nick'), $user_source->name, true), - $enable_pronoun - ? form_text('pronoun', __('Pronoun'), $personalData->pronoun, false, 15) - . form_info('', __('Will be shown on your profile page and in angel lists.')) - : '', - $enable_user_name ? form_text('lastname', __('Last name'), $personalData->last_name) : '', - $enable_user_name ? form_text('prename', __('First name'), $personalData->first_name) : '', - $enable_planned_arrival ? form_date( - 'planned_arrival_date', - __('Planned date of arrival') . ' ' . entry_required(), - $personalData->planned_arrival_date ? $personalData->planned_arrival_date->getTimestamp() : '', - $buildup_start_date, - $teardown_end_date - ) : '', - $enable_planned_arrival ? form_date( - 'planned_departure_date', - __('Planned date of departure'), - $personalData->planned_departure_date ? $personalData->planned_departure_date->getTimestamp() : '', - $buildup_start_date, - $teardown_end_date - ) : '', - $enable_dect ? form_text('dect', __('DECT'), $user_source->contact->dect) : '', - form_text('mobile', __('Mobile'), $user_source->contact->mobile), - form_text('mail', __('E-Mail') . ' ' . entry_required(), $user_source->email), - form_checkbox( - 'email_shiftinfo', - __( - 'The %s is allowed to send me an email (e.g. when my shifts change)', - [config('app_name')] - ), - $user_source->settings->email_shiftinfo - ), - form_checkbox( - 'email_by_human_allowed', - __('Humans are allowed to send me an email (e.g. for ticket vouchers)'), - $user_source->settings->email_human - ), - $enable_tshirt_size ? form_select( - 'tshirt_size', - __('Shirt size'), - $tshirt_sizes, - $personalData->shirt_size, - __('Please select...') - ) : '', - form_info('', __('Please visit the angeltypes page to manage your angeltypes.')), - form_submit('submit', __('Save')) - ]), - form([ - form_info(__('Here you can choose your color settings:')), - form_select('theme', __('Color settings:'), $themes, $user_source->settings->theme), - form_submit('submit_theme', __('Save')) - ]), - form([ - form_info(__('Here you can choose your language:')), - form_select('language', __('Language:'), $locales, $user_source->settings->language), - form_submit('submit_language', __('Save')) - ]), - ]) - ]) - ], true); + /** @var Renderer $renderer */ + $renderer = app(Renderer::class); + return $renderer->render( + 'pages/settings/settings.twig', + [ + 'title' => 'settings.profile', + 'content' => + msg() + . div('row', [ + div('col-md-9', [ + form([ + form_info('', __('Here you can change your user details.')), + form_info(entry_required() . ' = ' . __('Entry required!')), + form_text('nick', __('Nick'), $user_source->name, true), + $enable_pronoun + ? form_text('pronoun', __('Pronoun'), $personalData->pronoun, false, 15) + . form_info('', __('Will be shown on your profile page and in angel lists.')) + : '', + $enable_user_name ? form_text('lastname', __('Last name'), $personalData->last_name) : '', + $enable_user_name ? form_text('prename', __('First name'), $personalData->first_name) : '', + $enable_planned_arrival ? form_date( + 'planned_arrival_date', + __('Planned date of arrival') . ' ' . entry_required(), + $personalData->planned_arrival_date + ? $personalData->planned_arrival_date->getTimestamp() + : '', + $buildup_start_date, + $teardown_end_date + ) : '', + $enable_planned_arrival ? form_date( + 'planned_departure_date', + __('Planned date of departure'), + $personalData->planned_departure_date + ? $personalData->planned_departure_date->getTimestamp() + : '', + $buildup_start_date, + $teardown_end_date + ) : '', + $enable_dect ? form_text('dect', __('DECT'), $user_source->contact->dect) : '', + form_text('mobile', __('Mobile'), $user_source->contact->mobile), + form_text('mail', __('E-Mail') . ' ' . entry_required(), $user_source->email), + form_checkbox( + 'email_shiftinfo', + __( + 'The %s is allowed to send me an email (e.g. when my shifts change)', + [config('app_name')] + ), + $user_source->settings->email_shiftinfo + ), + form_checkbox( + 'email_by_human_allowed', + __('Humans are allowed to send me an email (e.g. for ticket vouchers)'), + $user_source->settings->email_human + ), + $enable_tshirt_size ? form_select( + 'tshirt_size', + __('Shirt size'), + $tshirt_sizes, + $personalData->shirt_size, + __('Please select...') + ) : '', + form_info('', __('Please visit the angeltypes page to manage your angeltypes.')), + form_submit('submit', __('Save')) + ]), + form([ + form_info(__('Here you can choose your color settings:')), + form_select('theme', __('Color settings:'), $themes, $user_source->settings->theme), + form_submit('submit_theme', __('Save')) + ]), + form([ + form_info(__('Here you can choose your language:')), + form_select('language', __('Language:'), $locales, $user_source->settings->language), + form_submit('submit_language', __('Save')) + ]), + ]) + ]) + ] + ); } /** diff --git a/resources/views/pages/settings/oauth.twig b/resources/views/pages/settings/oauth.twig index 74514c00..13f07a72 100644 --- a/resources/views/pages/settings/oauth.twig +++ b/resources/views/pages/settings/oauth.twig @@ -4,7 +4,7 @@ {% block title %}{{ __('settings.oauth') }}{% endblock %} {% block container_title %} -

{{ block('title') }}

+

{{ __('settings.settings') }} {{ block('title') }}

{% endblock %} {% block row_content %} diff --git a/resources/views/pages/settings/settings.twig b/resources/views/pages/settings/settings.twig index 2fb47978..e66e82e8 100644 --- a/resources/views/pages/settings/settings.twig +++ b/resources/views/pages/settings/settings.twig @@ -1,11 +1,14 @@ {% extends 'layouts/app.twig' %} {% import 'macros/base.twig' as m %} -{% block title %}{{ __('settings') }}{% endblock %} +{% block title %}{{ __(title|default(__('settings.settings'))) }}{% endblock %} {% block content %}
-

{{ __('settings.settings') }}

+ {% block container_title %} +

{{ __('settings.settings') }} {{ block('title') }}

+ {% endblock %} +
- {% block container_title %} -

{{ block('title') }}

- {% endblock %} - {% include 'layouts/parts/messages.twig' %} {% block row_content %} + {{ content|raw }} {% endblock %}
diff --git a/src/Middleware/LegacyMiddleware.php b/src/Middleware/LegacyMiddleware.php index c3bceb53..b841e353 100644 --- a/src/Middleware/LegacyMiddleware.php +++ b/src/Middleware/LegacyMiddleware.php @@ -210,6 +210,10 @@ class LegacyMiddleware implements MiddlewareInterface return response($content, (int)$page); } + if (strpos($content, '