crud style, history table

This commit is contained in:
ty kayn 2019-06-12 14:52:58 +02:00
parent 892f52e49a
commit bb7f8680fc
9 changed files with 120 additions and 70 deletions

View File

@ -1,5 +1,4 @@
<footer class="big-footer text-center navbar-inverse navbar-footer "> <footer class="big-footer text-center navbar-inverse navbar-footer ">
<div class="container">
<sub class="footer-note text-center"> <sub class="footer-note text-center">
{% trans %}global.made_by{% endtrans %} Tykayn / {% trans %}global.made_by{% endtrans %} Tykayn /
<a href="http://www.cipherbliss.com"> <a href="http://www.cipherbliss.com">
@ -11,5 +10,4 @@
contact contact
</a> </a>
</sub> </sub>
</div>
</footer> </footer>

View File

@ -26,8 +26,8 @@
<div class="row"> <div class="row">
<div class=" padded text-right"> <div class=" padded text-right">
<a class="btn btn-primary" <a class="btn btn-primary"
href="{{ path('fos_user_security_login') }}" href="{{ path('fos_user_security_login') }}"
class="btn btn-primary"> class="btn btn-primary">
{% trans %}home.try{% endtrans %} {% trans %}home.try{% endtrans %}
</a> </a>
</div> </div>
@ -82,10 +82,14 @@
<i class="fa fa-envelope-open-o"></i> <i class="fa fa-envelope-open-o"></i>
contactez-moi pour tout renseignement: contactez-moi pour tout renseignement:
<a href="mailto:contact@cipherbliss.com"> par email</a> <a href="mailto:contact@cipherbliss.com"> par email</a>
, Telegram @tykayn, ou sur Mastodon , Telegram
<a href="https://mamot.fr/@tykayn"> <a href="https://t.me/tykayn">
@tykayn
</a>
, ou sur Mastodon
<a href="https://mastodon.cipherbliss.com/@tykayn">
<img src="https://en.gravatar.com/userimage/53061325/811d383aa2ebb8d2d83baab7da5f4a7b.jpeg" <img src="https://en.gravatar.com/userimage/53061325/811d383aa2ebb8d2d83baab7da5f4a7b.jpeg"
alt="avatar Mastodon" width="50" height="50"> @tykayn@mamot.fr alt="avatar Mastodon" width="50" height="50"> @tykayn
</a> </a>
</div> </div>

View File

@ -1,7 +1,7 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block body %} {% block body %}
<div class="row"> <div class="row heading-of-list">
<div class="col-xs-6"> <div class="col-xs-6">
<h1>Festivals</h1></div> <h1>Festivals</h1></div>
<div class="col-xs-6"> <div class="col-xs-6">
@ -62,7 +62,9 @@
<td>{{ festival.chiffreAffaire - (festival.fraisInscription + festival.fraisTransport + festival.fraisRepas + festival.fraisHebergement ) }}</td> <td>{{ festival.chiffreAffaire - (festival.fraisInscription + festival.fraisTransport + festival.fraisRepas + festival.fraisHebergement ) }}</td>
<td> <td>
{% if app.user.activeFestival and (app.user.activeFestival.id == festival.id) %} {% if app.user.activeFestival and (app.user.activeFestival.id == festival.id) %}
<span class="badge badge-success">
Actuel Actuel
</span>
{% else %} {% else %}
<a class="btn btn-success" href="{{ path('set_active_festival', { 'id': festival.id }) }}"> <a class="btn btn-success" href="{{ path('set_active_festival', { 'id': festival.id }) }}">
choisir comme actuel choisir comme actuel

View File

@ -14,7 +14,7 @@
<h2> <h2>
<i class="fa fa-users"></i> <i class="fa fa-users"></i>
<span class="chiffre key-figure"> <span class="chiffre key-figure">
{{ allSellings |length }} {{ allSellings }}
</span> </span>
Clients Clients
</h2> </h2>
@ -34,7 +34,7 @@
<i class="fa fa-shopping-cart"></i> <i class="fa fa-shopping-cart"></i>
<span class="chiffre key-figure"> <span class="chiffre key-figure">
{% if allSellings %} {% if allSellings %}
{{ (chiffreAffaires / (allSellings |length))|round }} {{ (chiffreAffaires / (allSellings))|round }}
{% else %} {% else %}
? ?
{% endif %} {% endif %}
@ -72,53 +72,65 @@
</div> </div>
</div> <hr>
<div id="last-sellings">
<h2>
{{ recentSells |length }} Dernières ventes
</h2>
<div class="table">
<div class="row">
<div class="col-xs-3">
date
</div>
<div class="col-xs-3">
commentaire
</div>
<div class="col-xs-3">
produits
</div>
<div class="col-xs-3">
montant
</div>
</div>
</div>
{% for vente in recentSells %}
<div class="row"> <div id="last-sellings">
<div class="col-xs-3"> <div class="row">
{{ vente.date |date('Y-m-d H:i:s') }} <div class="col-xs-12">
</div>
<div class="col-xs-3">
{{ vente.comment }}
</div>
<div class="col-xs-3">
{{ vente.productsSold |length }}
</div>
<div class="col-xs-3">
{{ vente.amount }}
<a href="{{ path('sellrecord_delete',{id: vente.id }) }}" <div class="table">
class="btn btn-warning pull-right"> <div class="row-fluid">
<i class="fa fa-trash"></i> <div class="col-xs-12">
</a> <h2>
{{ recentSells |length }} Dernières ventes
</h2>
</div>
</div>
<table class="table table-striped">
<thead>
<tr>
<td>date</td>
<td>commentaire</td>
<td>produits</td>
<td>montant</td>
<td>Actions</td>
</tr>
</thead>
<tbody>
{% for vente in recentSells %}
<tr>
<td> {{ vente.date |date('Y-m-d H:i:s') }}</td>
<td>{{ vente.comment }}</td>
<td class="text-right">{{ vente.productsSold |length }}</td>
<td class="text-right">
{{ vente.amount }}
</td>
<td>
<a href="{{ path('sellrecord_delete',{id: vente.id }) }}"
class="btn btn-warning pull-right">
<i class="fa fa-trash"></i>
</a>
</td>
</tr> {% endfor %}
</tbody>
</table>
</div>
</div>
</div> </div>
</div> </div>
{% endfor %}
</div> {% include ':logged:history-script.html.twig' %}
{% include ':logged:history-script.html.twig' %} </div>
{% endblock %} {% endblock %}

View File

@ -1,17 +1,20 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block body %} {% block body %}
<div class="row"> <div class="row heading-of-list">
<div class="col-xs-6"> <div class="col-xs-6">
<h1>Produits</h1></div> <h1>Produits</h1></div>
<div class="col-xs-6"> <div class="col-xs-6">
<a class="btn btn-primary pull-right" href="{{ path('product_new') }}">Nouveau produit</a> <a class="btn btn-primary pull-right" href="{{ path('product_new') }}">Nouveau produit</a>
<span class="alert alert-info pull-right"> <span class="hint alert alert-info pull-right">
astuce: Utilisez astuce: Utilisez
<strong>
<a href="{{ path('import') }}"> <a href="{{ path('import') }}">
l'import de masse l'import de masse
</a> </a>
</strong>
pour créer plusieurs produits et catégories à la fois pour créer plusieurs produits et catégories à la fois
</span> </span>
</div> </div>
@ -27,6 +30,7 @@
<th>Image</th> <th>Image</th>
<th>Price</th> <th>Price</th>
<th>Stocks</th> <th>Stocks</th>
<th>Vendus</th>
<th>Comment</th> <th>Comment</th>
<th>Actions</th> <th>Actions</th>
</tr> </tr>
@ -54,6 +58,7 @@
<td>{{ product.image }}</td> <td>{{ product.image }}</td>
<td>{{ product.price }}</td> <td>{{ product.price }}</td>
<td>{{ product.stockCount }}</td> <td>{{ product.stockCount }}</td>
<td>{{ product.productsSold | length }}</td>
<td>{{ product.comment }}</td> <td>{{ product.comment }}</td>
<td> <td>
<a class="btn btn-default" href="{{ path('product_edit', { 'id': product.id }) }}"> <a class="btn btn-default" href="{{ path('product_edit', { 'id': product.id }) }}">

View File

@ -1,7 +1,7 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block body %} {% block body %}
<div class="row"> <div class="row heading-of-list">
<div class="col-xs-6"> <div class="col-xs-6">
<h1>Catégorie de produit</h1></div> <h1>Catégorie de produit</h1></div>
<div class="col-xs-6"> <div class="col-xs-6">

View File

@ -1,7 +1,16 @@
{% extends 'base.html.twig' %} {% extends 'base.html.twig' %}
{% block body %} {% block body %}
<h1>Sellrecords list</h1> <div class="row heading-of-list">
<div class="col-xs-6">
<h1>Enregistrements de ventes</h1>
</div>
<div class="col-xs-6">
<a class="btn btn-primary" href="{{ path('sellrecord_new') }}">Nouvel enregistrement</a>
</div>
</div>
<table class="table-responsive table-striped table table-bordered table-light"> <table class="table-responsive table-striped table table-bordered table-light">
<thead> <thead>

View File

@ -64,6 +64,9 @@ body {
height: 4em; height: 4em;
padding: 1em; padding: 1em;
box-sizing: border-box; box-sizing: border-box;
position: absolute;
width: 100%;
bottom: 0;
} }
thead { thead {
@ -122,22 +125,11 @@ label {
.previsionnel { .previsionnel {
font-size: 1rem; font-size: 1rem;
//.config {
// font-size: 1.5rem;
//}
//thead {
// font-size: 1.5rem;
//}
label { label {
min-width: 220px; min-width: 220px;
} }
//.exepanse-table {
// font-size: 1.5rem;
//}
//.examples-depenses {
// font-size: 1.5rem;
//}
.big-number { .big-number {
font-size: 1.85rem; font-size: 1.85rem;
color: #2B2d42; color: #2B2d42;
@ -222,6 +214,20 @@ input {
font-weight: 800; font-weight: 800;
} }
tr {
&.bg-success {
td {
background: greenyellow;
}
}
}
.table {
> div{
&:hover{
background: #ccc;
}
}
}
.table > thead > tr > td, .table > thead > tr > td,
table td { table td {
padding: 0.5em; padding: 0.5em;
@ -257,12 +263,26 @@ table td {
.container { .container {
min-height: 100vh; min-height: 100vh;
} }
table {
margin-top: 2em;
}
} }
#menu_button{ #menu_button {
z-index: 10; z-index: 10;
position: absolute; position: absolute;
right: 1em; right: 1em;
top: -2px; top: -2px;
font-size: 1rem; font-size: 1rem;
} }
.heading-of-list {
a {
margin-top: 1em;
}
}
.hint {
margin-top: 1em;
}

View File

@ -377,7 +377,7 @@ class DefaultController extends Controller
'statisticsSoldProducts' => $statisticsSoldProducts, 'statisticsSoldProducts' => $statisticsSoldProducts,
'chiffreAffaires' => $chiffreAffaires, 'chiffreAffaires' => $chiffreAffaires,
'recentSells' => $mySellings, 'recentSells' => $mySellings,
'allSellings' => $allSellingList, 'allSellings' => count($mySellings),
'base_dir' => realpath($this->getParameter('kernel.project_dir')) . DIRECTORY_SEPARATOR, 'base_dir' => realpath($this->getParameter('kernel.project_dir')) . DIRECTORY_SEPARATOR,
]); ]);
} }