WIP: Implement Admin CRUD
This commit is contained in:
@@ -15,8 +15,8 @@
|
||||
</div>
|
||||
<form method="post" {{ stimulus_target('confirmation-modal', 'form') }}>
|
||||
<div {{ stimulus_target('confirmation-modal', 'content') }}></div>
|
||||
<div class="mt-6 flex justify-between">
|
||||
<button type="submit" class="btn btn--warning">
|
||||
<div class="mt-6 flex items-center space-x-8">
|
||||
<button type="submit" class="btn">
|
||||
Ja
|
||||
</button>
|
||||
<button type="button" class="btn btn--secondary" {{ stimulus_action('confirmation-modal', 'hide') }}>
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
{{ form_start(form) }}
|
||||
<div class="flex flex-col space-y-4 pb-8">
|
||||
{{ form_row(form.name) }}
|
||||
{{ form_row(form.value) }}
|
||||
</div>
|
||||
<button type="submit" class="btn">
|
||||
Speichern
|
||||
</button>
|
||||
{{ form_rest(form) }}
|
||||
{{ form_end(form) }}
|
||||
@@ -0,0 +1,21 @@
|
||||
{% extends 'layout.html.twig' %}
|
||||
|
||||
{% block title %}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_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>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,21 @@
|
||||
{% extends 'layout.html.twig' %}
|
||||
|
||||
{% block title %}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_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>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,47 @@
|
||||
{% extends 'layout.html.twig' %}
|
||||
|
||||
{% block title %}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 %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -89,4 +89,17 @@
|
||||
{{ form_widget(form.children['month']) }}
|
||||
{{ form_widget(form.children['year']) }}
|
||||
</div>
|
||||
{%- endblock -%}
|
||||
{%- endblock -%}
|
||||
|
||||
{%- block money_widget -%}
|
||||
{% set currency_class = 'absolute top-1/2 transform -translate-y-1/2 right-0 mr-2' %}
|
||||
{% if errors|length %}
|
||||
{% set currency_class = currency_class ~ ' text-red-500' %}
|
||||
{% else %}
|
||||
{% set currency_class = currency_class ~ ' text-gray-600' %}
|
||||
{% endif %}
|
||||
<div class="relative">
|
||||
{{ block('form_widget_simple') }}
|
||||
<span class="{{ currency_class }}">€</span>
|
||||
</div>
|
||||
{%- endblock money_widget -%}
|
||||
|
||||
Reference in New Issue
Block a user