WIP: Implement admin CRUD

This commit is contained in:
Björn Fromme
2023-09-26 17:44:01 +02:00
parent 3e0353c79b
commit c55fd85314
63 changed files with 1367 additions and 532 deletions
+4 -4
View File
@@ -1,9 +1,9 @@
{% extends 'layout.html.twig' %}
{% block header_menu %}
{{ knp_menu_render(knp_menu_get('admin_header'), { 'firstClass': null, 'lastClass': null, 'ancestorClass': 'active', 'compressed': true }) }}
{% block main_menu %}
{{ knp_menu_render(knp_menu_get('admin_main')) }}
{% endblock %}
{% block mobile_menu %}
{{ knp_menu_render(knp_menu_get('admin_mobile'), { 'firstClass': null, 'lastClass': null, 'ancestorClass': 'active', 'compressed': true }) }}
{% endblock %}
{{ knp_menu_render(knp_menu_get('admin_main')) }}
{% endblock %}
+8 -3
View File
@@ -3,8 +3,13 @@
{{ form_row(form.name) }}
{{ form_row(form.value) }}
</div>
<button type="submit" class="btn">
Speichern
</button>
<div class="flex items-center space-x-2">
<button type="submit" class="btn">
Speichern
</button>
<a href="{{ path('app_admin_system_fee_index') }}" class="btn btn--secondary">
Abbrechen
</a>
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
+7 -16
View File
@@ -1,21 +1,12 @@
{% extends 'layout.html.twig' %}
{% extends 'admin/layout.html.twig' %}
{% block title %}Honorare{% endblock %}
{% block title %}Einstellungen - Honorar anlegen{% endblock %}
{% block content %}
<div class="grid lg:grid-cols-3 gap-y-8 lg:gap-y-0 lg:gap-x-16">
<div class="flex flex-col space-y-2">
<a href="{{ path('app_admin_system_fee_index') }}" class="btn btn--secondary">
Abbrechen
</a>
</div>
<div class="lg:col-span-2">
<div class="pb-8 max-w-screen-md mx-auto">
<h1 class="text-2xl font-bold pb-8">
Honorar anlegen
</h1>
{% include 'admin/system/fee/_form.html.twig' %}
</div>
</div>
<div class="max-w-screen-sm">
<h1 class="text-2xl font-bold pb-8">
Honorar anlegen
</h1>
{% include 'admin/system/fee/_form.html.twig' %}
</div>
{% endblock %}
+7 -16
View File
@@ -1,21 +1,12 @@
{% extends 'layout.html.twig' %}
{% extends 'admin/layout.html.twig' %}
{% block title %}Honorare{% endblock %}
{% block title %}Einstellungen - Honorar bearbeiten{% endblock %}
{% block content %}
<div class="grid lg:grid-cols-3 gap-y-8 lg:gap-y-0 lg:gap-x-16">
<div class="flex flex-col space-y-2">
<a href="{{ path('app_admin_system_fee_index') }}" class="btn btn--secondary">
Abbrechen
</a>
</div>
<div class="lg:col-span-2">
<div class="pb-8 max-w-screen-md mx-auto">
<h1 class="text-2xl font-bold pb-8">
Honorar bearbeiten
</h1>
{% include 'admin/system/fee/_form.html.twig' %}
</div>
</div>
<div class="max-w-screen-sm">
<h1 class="text-2xl font-bold pb-8">
Honorar bearbeiten
</h1>
{% include 'admin/system/fee/_form.html.twig' %}
</div>
{% endblock %}
+58 -41
View File
@@ -1,47 +1,64 @@
{% extends 'layout.html.twig' %}
{% extends 'admin/layout.html.twig' %}
{% block title %}Honorare{% endblock %}
{% block title %}Einstellungen - Honorare{% endblock %}
{% block content %}
<div class="grid lg:grid-cols-3 gap-y-8 lg:gap-y-0 lg:gap-x-16">
<div class="flex flex-col space-y-2">
<a href="{{ path('app_admin_system_fee_create') }}" class="btn">
Neu
</a>
</div>
<div class="lg:col-span-2">
<h1 class="text-2xl font-bold pb-8">
Honorare
</h1>
<div class="flex flex-col space-y-2">
{% for fee in fees %}
<div class="grid grid-cols-3 items-center py-2 px-4 bg-gray-200 rounded-md">
<div>
{{ fee.name }}
</div>
<div>
{{ fee.value|format_money }}
</div>
<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 das Honorar wirklich löschen?',
'target-url': path('app_admin_system_fee_delete', { 'id': fee.id })
}) }}>
{{ icon('delete') }}
</button>
<a href="{{ path('app_admin_system_fee_edit', { 'id': fee.id }) }}">
{{ icon('edit') }}
</a>
</div>
</div>
{% else %}
<div class="text-sm">Keine Daten...</div>
{% endfor %}
<h1 class="text-2xl font-bold pb-8">
Honorare
</h1>
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th>
Bezeichnung
</th>
<th>
Wert
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for fee in fees %}
<tr>
<td>
{{ fee.name }}
</td>
<td>
{{ fee.value|format_money }}
</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 das Honorar wirklich löschen?',
'target-url': path('app_admin_system_fee_delete', { 'id': fee.id })
}) }}>
{{ icon('delete') }}
</button>
<a href="{{ path('app_admin_system_fee_edit', { 'id': fee.id }) }}">
{{ icon('edit') }}
</a>
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="3">
<div class="text-sm">Keine Daten...</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<a href="{{ path('app_admin_system_fee_create') }}" class="btn">
Neu
</a>
{% endblock %}
@@ -0,0 +1,16 @@
{{ form_start(form) }}
<div class="flex flex-col space-y-4 pb-8">
{{ form_row(form.name) }}
{{ form_row(form.requiredTraining) }}
{{ form_widget(form.requiredLicenses) }}
</div>
<div class="flex items-center space-x-2">
<button type="submit" class="btn">
Speichern
</button>
<a href="{{ path('app_admin_system_job_profile_index') }}" class="btn btn--secondary">
Abbrechen
</a>
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
@@ -0,0 +1,12 @@
{% extends 'admin/layout.html.twig' %}
{% block title %}Einstellungen - Job-Profil anlegen{% endblock %}
{% block content %}
<div class="max-w-screen-sm">
<h1 class="text-2xl font-bold pb-8">
Job-Profil anlegen
</h1>
{% include 'admin/system/job_profile/_form.html.twig' %}
</div>
{% endblock %}
@@ -0,0 +1,57 @@
{% extends 'admin/layout.html.twig' %}
{% block title %}Einstellungen - Jobprofile{% endblock %}
{% block content %}
<h1 class="text-2xl font-bold pb-8">
Job-Profile
</h1>
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th>
Bezeichnung
</th>
<th>
Fortbildung
</th>
<th>
Lizenzen
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for jobProfile in jobProfiles %}
<tr>
<td>
{{ jobProfile.name }}
</td>
<td>
{{ jobProfile.requiredTraining|default('-') }}
</td>
<td>
{{ jobProfile.requiredLicenses|join(', ') }}
</td>
<td>
<div class="flex items-center space-x-2 justify-end">
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">
<div class="text-sm">Keine Daten...</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<a href="{{ path('app_admin_system_job_profile_create') }}" class="btn">
Neu
</a>
{% endblock %}
@@ -0,0 +1,14 @@
{{ form_start(form) }}
<div class="flex flex-col space-y-4 pb-8">
{{ form_row(form.name) }}
</div>
<div class="flex items-center space-x-2">
<button type="submit" class="btn">
Speichern
</button>
<a href="{{ path('app_admin_system_training_index') }}" class="btn btn--secondary">
Abbrechen
</a>
</div>
{{ form_rest(form) }}
{{ form_end(form) }}
@@ -0,0 +1,12 @@
{% extends 'admin/layout.html.twig' %}
{% block title %}Einstellungen - Fortbildung anlegen{% endblock %}
{% block content %}
<div class="max-w-screen-sm">
<h1 class="text-2xl font-bold pb-8">
Fortbildung anlegen
</h1>
{% include 'admin/system/training/_form.html.twig' %}
</div>
{% endblock %}
@@ -0,0 +1,12 @@
{% extends 'admin/layout.html.twig' %}
{% block title %}Einstellungen - Fortbildung bearbeiten{% endblock %}
{% block content %}
<div class="max-w-screen-sm">
<h1 class="text-2xl font-bold pb-8">
Fortbildung bearbeiten
</h1>
{% include 'admin/system/training/_form.html.twig' %}
</div>
{% endblock %}
@@ -0,0 +1,51 @@
{% extends 'admin/layout.html.twig' %}
{% block title %}Einstellungen - Fortbildungen{% endblock %}
{% block content %}
<h1 class="text-2xl font-bold pb-8">
Fortbildungen
</h1>
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th>
Bezeichnung
</th>
<th>
Teilnahmen
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for training in trainings %}
<tr>
<td>
{{ training.name }}
</td>
<td>
{{ training.trainingAttendances|length|default('-') }}
</td>
<td>
<div class="flex items-center space-x-2 justify-end">
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="3">
<div class="text-sm">Keine Daten...</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
<a href="{{ path('app_admin_system_training_create') }}" class="btn">
Neu
</a>
{% endblock %}
+69
View File
@@ -0,0 +1,69 @@
{% extends 'admin/layout.html.twig' %}
{% block title %}Teamerübersicht{% endblock %}
{% block content %}
<h1 class="text-2xl font-bold pb-8">
Teamerübersicht
</h1>
<div class="data-table-wrapper">
<div class="data-table-wrapper__inner">
<table class="data-table">
<thead>
<tr>
<th>
{{ knp_pagination_sortable(pagination, 'Name', 'teamer.lastName') }}
</th>
<th>
Vorname
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Status', 'teamer.status') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'E-Mail', 'teamer.communication.email') }}
</th>
<th>
{{ knp_pagination_sortable(pagination, 'Letzter Login', 'teamer.lastLoginAt') }}
</th>
<th></th>
</tr>
</thead>
<tbody>
{% for teamer in pagination %}
<tr>
<td>
<a href="#" class="whitespace-nowrap">
{{ teamer.lastName }}
</a>
</td>
<td>
<a href="#" class="whitespace-nowrap">
{{ teamer.firstName }}
</a>
</td>
<td>
{{ teamer.status }}
</td>
<td>
{{ teamer.communication.email }}
</td>
<td>
{% if teamer.user.lastLoginAt is not null %}
{{ teamer.user.lastLoginAt | date('d.m.Y') }}
{% else %}
-
{% endif %}
</td>
<td>
<div class="flex items-center space-x-1 justify-end">
</div>
</td>
</tr>
{% endfor %}
</tbody>
</table>
{{ knp_pagination_render(pagination) }}
</div>
</div>
{% endblock %}