mirror of
https://forge.chapril.org/tykayn/caisse-bliss
synced 2025-06-20 01:44:42 +02:00
add main routes and templates
This commit is contained in:
parent
6df4488b5c
commit
71bce538af
56 changed files with 2288 additions and 24 deletions
24
templates/product/edit.html.twig
Executable file
24
templates/product/edit.html.twig
Executable file
|
@ -0,0 +1,24 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Product edit</h1>
|
||||
|
||||
{{ form_start(edit_form) }}
|
||||
{{ form_widget(edit_form) }}
|
||||
<input type="submit" value="Edit"/>
|
||||
{{ form_end(edit_form) }}
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('product_index') }}">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Retour à la liste
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_start(delete_form) }}
|
||||
<input type="submit" value="Delete">
|
||||
{{ form_end(delete_form) }}
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
74
templates/product/index.html.twig
Executable file
74
templates/product/index.html.twig
Executable file
|
@ -0,0 +1,74 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="row heading-of-list">
|
||||
<div class="col-xs-6">
|
||||
<h1>Produits</h1></div>
|
||||
<div class="col-xs-6">
|
||||
|
||||
<a class="btn btn-primary pull-right" href="{{ path('product_new') }}">Nouveau produit</a>
|
||||
<span class="hint alert alert-info pull-right">
|
||||
astuce: Utilisez
|
||||
<strong>
|
||||
|
||||
<a href="{{ path('import') }}">
|
||||
l'import de masse
|
||||
</a>
|
||||
</strong>
|
||||
pour créer plusieurs produits et catégories à la fois
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="table-responsive table-striped table table-bordered table-light">
|
||||
<thead class="bg-dark">
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>Category</th>
|
||||
<th>Name</th>
|
||||
<th>Image</th>
|
||||
<th>Price</th>
|
||||
<th>Stocks</th>
|
||||
<th>Vendus</th>
|
||||
<th>Comment</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for product in products %}
|
||||
<tr>
|
||||
<td>
|
||||
<a class="btn btn-primary btn-block"
|
||||
href="{{ path('product_show', { 'id': product.id }) }}">{{ product.id }}</a>
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-primary btn-block"
|
||||
href="{{ path('productcategory_edit', { 'id': product.category.id }) }}">
|
||||
{{ product.category.name }}
|
||||
</a>
|
||||
|
||||
|
||||
</td>
|
||||
<td>
|
||||
<a class="btn btn-default btn-block" href="{{ path('product_edit', { 'id': product.id }) }}">
|
||||
{{ product.name }}
|
||||
</a>
|
||||
</td>
|
||||
<td>{{ product.image }}</td>
|
||||
<td>{{ product.price }}</td>
|
||||
<td>{{ product.stockCount }}</td>
|
||||
<td>{{ product.productsSold | length }}</td>
|
||||
<td>{{ product.comment }}</td>
|
||||
<td>
|
||||
<a class="btn btn-default" href="{{ path('product_edit', { 'id': product.id }) }}">
|
||||
<i class="fa fa-pencil"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<a class="btn btn-primary" href="{{ path('product_new') }}">Nouveau produit</a>
|
||||
{% endblock %}
|
19
templates/product/new.html.twig
Executable file
19
templates/product/new.html.twig
Executable file
|
@ -0,0 +1,19 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Product creation</h1>
|
||||
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<input type="submit" class="btn btn-primary btn-block" value="Créer"/>
|
||||
{{ form_end(form) }}
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('product_index') }}">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Retour à la liste
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
47
templates/product/show.html.twig
Executable file
47
templates/product/show.html.twig
Executable file
|
@ -0,0 +1,47 @@
|
|||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Product</h1>
|
||||
|
||||
<table class="table-responsive table-striped table table-bordered table-light">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ product.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<td>{{ product.name }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Image</th>
|
||||
<td>{{ product.image }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Price</th>
|
||||
<td>{{ product.price }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Comment</th>
|
||||
<td>{{ product.comment }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('product_index') }}">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
Retour à la liste
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a class="btn btn-primary" href="{{ path('product_edit', { 'id': product.id }) }}">edit</a>
|
||||
</li>
|
||||
<li>
|
||||
{{ form_start(delete_form) }}
|
||||
<input type="submit" value="Delete">
|
||||
{{ form_end(delete_form) }}
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
1
templates/product/test.html.twig
Executable file
1
templates/product/test.html.twig
Executable file
|
@ -0,0 +1 @@
|
|||
essai qui marche
|
Loading…
Add table
Add a link
Reference in a new issue