WIP: Implement profile editing

This commit is contained in:
Björn Fromme
2023-10-02 12:39:52 +02:00
parent d776d37cd5
commit 953aa9c8e0
27 changed files with 598 additions and 43 deletions
+5 -21
View File
@@ -2,23 +2,6 @@
{% block title %}Mein Profil{% endblock %}
{% macro formErrors(form) %}
<ul>
{% for child in form.children %}
{% for error in child.vars.errors %}
<li>
{{ error.message }}
</li>
{% endfor %}
{%endfor%}
{% for error in form.vars.errors %}
<li>
{{ error.message }}
</li>
{% endfor %}
</ul>
{% endmacro %}
{% macro collectionRow(form) %}
<div {{ stimulus_target('form-collection', 'field') }}>
<div class="flex items-center space-x-4">
@@ -71,10 +54,10 @@
<div class="lg:col-span-2">
{% if not form.vars.valid %}
<div class="border border-red-500 rounded-md p-4 text-red-500 mb-8">
{{ _self.formErrors(form) }}
{{ _self.formErrors(form.address) }}
{{ _self.formErrors(form.communication) }}
{{ _self.formErrors(form.bankAccount) }}
{% include '_partials/_form_errors.html.twig' with { 'form': form } %}
{% include '_partials/_form_errors.html.twig' with { 'form': form.address } %}
{% include '_partials/_form_errors.html.twig' with { 'form': form.communication } %}
{% include '_partials/_form_errors.html.twig' with { 'form': form.bankAccount } %}
</div>
{% elseif errors|length > 0 %}
<div class="border border-red-500 rounded-md p-4 text-red-500 mb-8">
@@ -183,6 +166,7 @@
{% include '_partials/_upload_collection_form.html.twig' with {
'endpoint_upload': path('_uploader_upload_photo'),
'upload_session_params': form.vars.upload_session_params,
'accepted_files': 'image/jpg,image/jpeg',
} %}
</div>