engelsystem/resources/views/pages/settings/profile.twig

180 lines
7.7 KiB
Twig
Raw Normal View History

{% extends 'pages/settings/settings.twig' %}
{% import 'macros/form.twig' as f %}
{% import 'macros/base.twig' as m %}
{% block title %}{{ __('settings.profile') }}{% endblock %}
{% block row_content %}
<form action="" enctype="multipart/form-data" method="post">
{{ csrf() }}
<div class="row g-4">
2023-01-27 11:19:35 +01:00
<div class="col-12">
<strong class="help-block">
{{ f.entry_required() }} = {{ __('settings.profile.entry_required') }}
</strong>
</div>
2023-04-01 18:15:29 +02:00
</div>
<div class="row g-4">
2023-01-27 11:19:35 +01:00
<div class="col-lg-6">
2023-10-03 21:34:03 +02:00
{{ f.input('nick', __('general.nick'), {
'value': user.name,
'disabled': true,
}) }}
2023-01-27 11:19:35 +01:00
</div>
{% if config('enable_pronoun') %}
<div class="col-lg-6">
{{ f.input('pronoun', __('settings.profile.pronoun'), {
'value': user.personalData.pronoun,
'max_length': 15,
2023-11-03 15:15:44 +01:00
'required': isPronounRequired,
'required_icon': isPronounRequired,
}) }}
{{ m.info(__('settings.profile.pronoun.info')) }}
2023-01-27 11:19:35 +01:00
</div>
{% endif %}
2023-04-01 18:15:29 +02:00
</div>
{% if config('enable_user_name') %}
<div class="row g-4">
2023-01-27 11:19:35 +01:00
<div class="col-sm-6">
{{ f.input('first_name', __('settings.profile.firstname'), {
'value': user.personalData.first_name,
'max_length': 64,
2023-11-03 15:15:44 +01:00
'required': isFirstnameRequired,
'required_icon': isFirstnameRequired,
}) }}
2023-01-27 11:19:35 +01:00
</div>
<div class="col-sm-6">
{{ f.input('last_name', __('settings.profile.lastname'), {
'value': user.personalData.last_name,
'max_length': 64,
2023-11-03 15:15:44 +01:00
'required': isLastnameRequired,
'required_icon': isLastnameRequired,
}) }}
2023-01-27 11:19:35 +01:00
</div>
2023-04-01 18:15:29 +02:00
</div>
{% endif %}
2023-04-01 18:15:29 +02:00
{% if config('enable_planned_arrival') %}
<div class="row g-4">
2023-01-27 11:19:35 +01:00
<div class="col-sm-6">
{% set planned_arrival_date = user.personalData.planned_arrival_date %}
{{ f.input('planned_arrival_date', __('settings.profile.planned_arrival_date'), {
'type': 'date',
'value': planned_arrival_date ? planned_arrival_date.format('Y-m-d') : '',
'required': true,
'required_icon': true,
'min': config('buildup_start') ? config('buildup_start').format('Y-m-d') : '',
'max': config('teardown_end') ? config('teardown_end').format('Y-m-d') : '',
}) }}
2023-01-27 11:19:35 +01:00
</div>
<div class="col-sm-6">
{% set planned_departure_date = user.personalData.planned_departure_date %}
{{ f.input('planned_departure_date', __('settings.profile.planned_departure_date'), {
'type': 'date',
'value': planned_departure_date ? planned_departure_date.format('Y-m-d') : '',
'min': config('buildup_start') ? config('buildup_start').format('Y-m-d') : '',
'max': config('teardown_end') ? config('teardown_end').format('Y-m-d') : '',
}) }}
</div>
2023-04-01 18:15:29 +02:00
</div>
{% endif %}
2023-04-01 18:15:29 +02:00
<div class="row g-4">
2023-01-27 11:19:35 +01:00
{% if config('enable_dect') %}
<div class="col-md-6">
2023-10-02 16:15:25 +02:00
{{ f.input('dect', __('general.dect'), {
'value': user.contact.dect,
'max_length': 40,
2023-11-03 15:15:44 +01:00
'required': isDectRequired,
'required_icon': isDectRequired,
}) }}
2023-01-27 11:19:35 +01:00
</div>
{% endif %}
<div class="col-md-6">
{{ f.input('mobile', __('settings.profile.mobile'), {
'value': user.contact.mobile,
'max_length': 40,
2023-11-03 15:15:44 +01:00
'required': isMobileRequired,
'required_icon': isMobileRequired,
}) }}
{% if config('enable_mobile_show') %}
{{ f.checkbox('mobile_show', __('settings.profile.mobile_show'), {
'checked': user.settings.mobile_show,
}) }}
{% endif %}
2023-01-27 11:19:35 +01:00
</div>
2023-04-01 18:15:29 +02:00
</div>
<div class="row g-4">
2023-01-27 11:19:35 +01:00
<div class="col-md-6">
2023-10-03 21:34:03 +02:00
{{ f.input('email', __('general.email'), {
'type': 'email',
'value': user.email,
'max_length': 254,
'required': true,
'required_icon': true,
}) }}
</div>
2023-01-27 11:19:35 +01:00
<div class="col-md-6">
2023-04-01 14:23:52 +02:00
<label class="form-label">{{ __('settings.profile.email-preferences') }}</label>
{{ f.checkbox('email_shiftinfo', __('settings.profile.email_shiftinfo', [config('app_name')]), {
'checked': user.settings.email_shiftinfo,
}) }}
{{ f.checkbox('email_news', __('settings.profile.email_news'), {
'checked': user.settings.email_news,
}) }}
{{ f.checkbox('email_messages', __('settings.profile.email_messages'), {
'checked': user.settings.email_messages,
}) }}
{{ f.checkbox('email_human', __('settings.profile.email_by_human_allowed'), {
'checked': user.settings.email_human,
}) }}
{% if goodie_enabled %}
{% set privacy_email = config('privacy_email') %}
{% set email_goody_label = __('settings.profile.email_goody') ~
(privacy_email ? ' ' ~ __('settings.profile.privacy', [privacy_email]) : '')
%}
{{ f.checkbox('email_goody', email_goody_label, {
'checked': user.settings.email_goody,
'raw_label': true,
}) }}
{% endif %}
</div>
2023-04-01 18:15:29 +02:00
</div>
2023-04-01 18:15:29 +02:00
<div class="row g-4">
{% if goodie_tshirt %}
2023-01-27 11:19:35 +01:00
<div class="col-12">
{{ f.select('shirt_size', __('settings.profile.shirt_size'), config('tshirt_sizes'), {
'selected': user.personalData.shirt_size,
2023-11-03 15:15:44 +01:00
'required': isTShirtSizeRequired,
'required_icon': isTShirtSizeRequired,
'default_option': __('form.select_placeholder'),
'disabled': user.state.got_shirt,
'info': __('settings.profile.shirt_size.hint'),
'raw_form_text': true,
'form_text': (tShirtLink ? m.icon('info-circle')
~ ' <a href="'
~ tShirtLink|escape('html_attr')
2024-02-18 11:34:47 +01:00
~ '" target="_blank" rel="noopener">'
~ __('settings.profile.shirt.link')|e
~ '</a>' : ''),
}) }}
</div>
{% endif %}
2023-01-27 11:19:35 +01:00
<div class="col-12">
{{ m.info(__('settings.profile.angeltypes.info', [url('/angeltypes')]), true) }}
</div>
2023-01-27 11:19:35 +01:00
<div class="col-12">
{{ f.submit(__('form.save'), {'icon_left': 'save'}) }}
</div>
</div>
</form>
{% endblock %}