Feat: Add contacts

This commit is contained in:
Björn Fromme
2023-10-16 12:05:18 +02:00
parent f5fee787a0
commit 3fd4c6ca54
19 changed files with 658 additions and 2 deletions
@@ -0,0 +1,23 @@
{{ form_start(form) }}
<div class="flex flex-col space-y-4 pb-4">
{{ form_row(form.name) }}
{{ form_row(form.email) }}
{{ form_row(form.destination) }}
<div>
<h4 class="font-bold pb-2">
Foto
</h4>
{% include '_partials/_upload_collection_form.html.twig' with {
'endpoint_upload': path('_uploader_upload_photo'),
'max_filesize': 5,
'max_files': 1,
'accepted_files': 'image/jpg,image/jpeg',
} %}
{{ form_errors(form) }}
</div>
</div>
<button type="submit" class="btn">
speichern
</button>
{{ form_rest(form) }}
{{ form_end(form) }}
@@ -0,0 +1 @@
{% include 'admin/system/contact/_form.html.twig' %}
@@ -0,0 +1 @@
{% include 'admin/system/contact/_form.html.twig' %}
@@ -0,0 +1,81 @@
{% extends 'admin/layout.html.twig' %}
{% block title %}Ansprechpartner{% endblock %}
{% block content %}
<h1 class="text-2xl font-bold pb-8">
Ansprechpartner
</h1>
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th>
Name
</th>
<th>
E-Mail
</th>
<th>
Destination
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for contact in contacts %}
<tr>
<td>
{{ contact.name }}
</td>
<td>
{{ contact.email }}
</td>
<td>
{{ contact.destination|default('-') }}
</td>
<td>
<div class="flex items-center space-x-2 justify-end">
<button type="button"
class="text-red-500"
{{ stimulus_controller('modal-button', [], [], {'confirmation-modal': '#confirmation-modal'}) }}
{{ stimulus_action('modal-button', 'confirmation', null, {
'title': 'Bist du sicher?',
'content': 'Möchtest du den Ansprechpartner wirklich löschen?',
'target-url': path('app_admin_system_contact_delete', { 'id': contact.id })
}) }}>
{{ icon('delete') }}
</button>
<button type="button"
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
{{ stimulus_action('modal-button', 'ajax', null, {
'title': 'Ansprechpartner bearbeiten',
'url': path('app_admin_system_contact_edit', { 'id': contact.id })
}) }}>
{{ icon('edit') }}
</button>
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="7">
Keine Daten...
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<button type="button"
class="btn"
{{ stimulus_controller('modal-button', [], [], {'ajax-modal': '#ajax-modal'}) }}
{{ stimulus_action('modal-button', 'ajax', null, {
'title': 'Ansprechpartner hinzufügen',
'url': path('app_admin_system_contact_create')
}) }}>
Neu
</button>
{% endblock %}
@@ -85,6 +85,7 @@
{% endfor %}
</tbody>
</table>
{{ knp_pagination_render(pagination) }}
</div>
</div>
<button type="button"