add order
All checks were successful
/ ls (pull_request) Successful in 27s
/ ls (push) Successful in 27s

This commit is contained in:
lubiana 2024-06-14 17:41:00 +02:00
parent 7663f684a4
commit 1dc5306967
No known key found for this signature in database
37 changed files with 1060 additions and 113 deletions

View file

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}

View file

@ -4,9 +4,19 @@
<meta charset="UTF-8">
<title>{% block title %}Welcome!{% endblock %}</title>
<link rel="icon" href="data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 128 128%22><text y=%221.2em%22 font-size=%2296%22>⚫️</text><text y=%221.3em%22 x=%220.2em%22 font-size=%2276%22 fill=%22%23fff%22>sf</text></svg>">
<link rel="stylesheet" href="/static/css/water.min.css">
<link rel="stylesheet" href="/static/css/simple.min.css">
<script src="/static/js/htmx.min.js"></script>
</head>
<body>
<header>
<nav>
<a href="{{ path('app_food_order_index') }}">Orders</a>
<a href="{{ path('app_food_vendor_index') }}">Vendors</a>
</nav>
</header>
<main>
{% block body %}{% endblock %}
</body>
</main>
</html>

View file

@ -0,0 +1,12 @@
{% extends 'base.html.twig' %}
{% block title %}Edit FoodOrder{% endblock %}
{% block body %}
<h1>Edit FoodOrder</h1>
{{ include('_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_food_order_index') }}">back to list</a>
{% endblock %}

View file

@ -0,0 +1,34 @@
{% extends 'base.html.twig' %}
{% block title %}FoodOrder index{% endblock %}
{% block body %}
<h1>FoodOrder index</h1>
<table class="table">
<thead>
<tr>
<th>Vendor</th>
<th>CreatedAt</th>
<th>ClosedAt</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for food_order in food_orders %}
{{ include('food_order/table_row.html.twig') }}
{% else %}
<tr>
<td colspan="4">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<div>
<button
hx-get="{{ path('app_food_order_new') }}"
hx-trigger="click"
hx-target="closest div"
>Create new</button>
</div>
{% endblock %}

View file

@ -0,0 +1,2 @@
{{ include('_form.html.twig') }}

View file

@ -0,0 +1,31 @@
{% extends 'base.html.twig' %}
{% block title %}FoodOrder{% endblock %}
{% block body %}
<h1>FoodOrder</h1>
<table class="table">
<tbody>
<tr>
<th>Vendor</th>
<td>{{ food_order.foodVendor.name }}</td>
</tr>
<tr>
<th>CreatedAt</th>
<td>{{ food_order.createdAt ? food_order.createdAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
<tr>
<th>ClosedAt</th>
<td>{{ food_order.closedAt ? food_order.closedAt|date('Y-m-d H:i:s') : '' }}</td>
</tr>
</tbody>
</table>
<a class="button" href="{{ path('app_food_order_index') }}">back to list</a>
{% if(food_order.isClosed) %}
<a class="button" href="{{ path('app_food_order_open', {'id': food_order.id}) }}">reopen</a>
{% else %}
<a class="button" href="{{ path('app_food_order_close', {'id': food_order.id}) }}">close</a>
{% endif %}
{% endblock %}

View file

@ -0,0 +1,8 @@
<tr>
<td>{{ food_order.foodVendor.name }}</td>
<td>{{ food_order.createdAt ? food_order.createdAt|date('Y-m-d H:i:s') : '' }}</td>
<td>{{ food_order.closedAt ? food_order.closedAt|date('Y-m-d H:i:s') : '' }}</td>
<td>
<a href="{{ path('app_food_order_show', {'id': food_order.id}) }}">show</a>
</td>
</tr>

View file

@ -1,4 +0,0 @@
<form method="post" action="{{ path('app_food_vendor_delete', {'id': food_vendor.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ food_vendor.id) }}">
<button class="btn">Delete</button>
</form>

View file

@ -21,6 +21,4 @@
<a href="{{ path('app_food_vendor_index') }}">back to list</a>
<a href="{{ path('app_food_vendor_edit', {'id': food_vendor.id}) }}">edit</a>
{{ include('food_vendor/_delete_form.html.twig') }}
{% endblock %}

View file

@ -0,0 +1,4 @@
<form method="post" action="{{ path('app_order_item_delete', {'id': order_item.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ order_item.id) }}">
<button class="btn">Delete</button>
</form>

View file

@ -0,0 +1,4 @@
{{ form_start(form) }}
{{ form_widget(form) }}
<button class="btn">{{ button_label|default('Save') }}</button>
{{ form_end(form) }}

View file

@ -0,0 +1,13 @@
{% extends 'base.html.twig' %}
{% block title %}Edit OrderItem{% endblock %}
{% block body %}
<h1>Edit OrderItem</h1>
{{ include('order_item/_form.html.twig', {'button_label': 'Update'}) }}
<a href="{{ path('app_order_item_index') }}">back to list</a>
{{ include('order_item/_delete_form.html.twig') }}
{% endblock %}

View file

@ -0,0 +1,37 @@
{% extends 'base.html.twig' %}
{% block title %}OrderItem index{% endblock %}
{% block body %}
<h1>OrderItem index</h1>
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Extras</th>
<th>actions</th>
</tr>
</thead>
<tbody>
{% for order_item in order_items %}
<tr>
<td>{{ order_item.id }}</td>
<td>{{ order_item.name }}</td>
<td>{{ order_item.extras }}</td>
<td>
<a href="{{ path('app_order_item_show', {'id': order_item.id}) }}">show</a>
<a href="{{ path('app_order_item_edit', {'id': order_item.id}) }}">edit</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="4">no records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<a href="{{ path('app_order_item_new') }}">Create new</a>
{% endblock %}

View file

@ -0,0 +1,11 @@
{% extends 'base.html.twig' %}
{% block title %}New OrderItem{% endblock %}
{% block body %}
<h1>Create new OrderItem</h1>
{{ include('order_item/_form.html.twig') }}
<a href="{{ path('app_order_item_index') }}">back to list</a>
{% endblock %}

View file

@ -0,0 +1,30 @@
{% extends 'base.html.twig' %}
{% block title %}OrderItem{% endblock %}
{% block body %}
<h1>OrderItem</h1>
<table class="table">
<tbody>
<tr>
<th>Id</th>
<td>{{ order_item.id }}</td>
</tr>
<tr>
<th>Name</th>
<td>{{ order_item.name }}</td>
</tr>
<tr>
<th>Extras</th>
<td>{{ order_item.extras }}</td>
</tr>
</tbody>
</table>
<a href="{{ path('app_order_item_index') }}">back to list</a>
<a href="{{ path('app_order_item_edit', {'id': order_item.id}) }}">edit</a>
{{ include('order_item/_delete_form.html.twig') }}
{% endblock %}