improv
This commit is contained in:
parent
66c4c1fe4f
commit
2c2e34b71e
42 changed files with 910 additions and 939 deletions
4
templates/order/_delete_form.html.twig
Normal file
4
templates/order/_delete_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
<form method="post" action="{{ path('app_order_delete', {'id': order.id}) }}" onsubmit="return confirm('Are you sure you want to delete this item?');">
|
||||
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ order.id) }}">
|
||||
<button class="btn">Delete</button>
|
||||
</form>
|
4
templates/order/_form.html.twig
Normal file
4
templates/order/_form.html.twig
Normal file
|
@ -0,0 +1,4 @@
|
|||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button class="btn">{{ button_label|default('Save') }}</button>
|
||||
{{ form_end(form) }}
|
13
templates/order/edit.html.twig
Normal file
13
templates/order/edit.html.twig
Normal file
|
@ -0,0 +1,13 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Edit Order{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Edit Order</h1>
|
||||
|
||||
{{ include('order/_form.html.twig', {'button_label': 'Update'}) }}
|
||||
|
||||
<a href="{{ path('app_order_index') }}">back to list</a>
|
||||
|
||||
{{ include('order/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
39
templates/order/index.html.twig
Normal file
39
templates/order/index.html.twig
Normal file
|
@ -0,0 +1,39 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Order index{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Order index</h1>
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>CreatedAt</th>
|
||||
<th>UpdatedAt</th>
|
||||
<th>Status</th>
|
||||
<th>actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for order in orders %}
|
||||
<tr>
|
||||
<td>{{ order.id }}</td>
|
||||
<td>{{ order.createdAt ? order.createdAt|date('Y-m-d H:i:s') : '' }}</td>
|
||||
<td>{{ order.updatedAt ? order.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
|
||||
<td>{{ order.status }}</td>
|
||||
<td>
|
||||
<a href="{{ path('app_order_show', {'id': order.id}) }}">show</a>
|
||||
<a href="{{ path('app_order_edit', {'id': order.id}) }}">edit</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr>
|
||||
<td colspan="5">no records found</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_order_new') }}">Create new</a>
|
||||
{% endblock %}
|
11
templates/order/new.html.twig
Normal file
11
templates/order/new.html.twig
Normal file
|
@ -0,0 +1,11 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}New Order{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Create new Order</h1>
|
||||
|
||||
{{ include('order/_form.html.twig') }}
|
||||
|
||||
<a href="{{ path('app_order_index') }}">back to list</a>
|
||||
{% endblock %}
|
34
templates/order/show.html.twig
Normal file
34
templates/order/show.html.twig
Normal file
|
@ -0,0 +1,34 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block title %}Order{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Order</h1>
|
||||
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ order.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>CreatedAt</th>
|
||||
<td>{{ order.createdAt ? order.createdAt|date('Y-m-d H:i:s') : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>UpdatedAt</th>
|
||||
<td>{{ order.updatedAt ? order.updatedAt|date('Y-m-d H:i:s') : '' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Status</th>
|
||||
<td>{{ order.status }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a href="{{ path('app_order_index') }}">back to list</a>
|
||||
|
||||
<a href="{{ path('app_order_edit', {'id': order.id}) }}">edit</a>
|
||||
|
||||
{{ include('order/_delete_form.html.twig') }}
|
||||
{% endblock %}
|
Loading…
Add table
Add a link
Reference in a new issue