From 8ccd762bfc3d7da2716749d709cf5cc216882a23 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 10 Oct 2021 18:20:57 +0200 Subject: Search payments by categories explicitely It was already possible to search by categories in the full text input, but it could have matched other fields as well. Explicitely add a select to search by categories. Also put the search form in a left aside. The mobile view is not done for the moment. --- templates/payment/create.html | 93 ++++++++------- templates/payment/table.html | 259 +++++++++++++++++++++--------------------- templates/payment/update.html | 117 ++++++++++--------- 3 files changed, 240 insertions(+), 229 deletions(-) (limited to 'templates/payment') diff --git a/templates/payment/create.html b/templates/payment/create.html index 5bae767..8defad3 100644 --- a/templates/payment/create.html +++ b/templates/payment/create.html @@ -6,7 +6,7 @@ {% block main %} -
+

{{ error }}

{% endif %} - - + - - + {% set user_id = form.user_id | default(value="" ~ connected_user.id) %} - - + {% set category_id = form.category_id | default(value="") %} -
-
-
- {% if query.frequency == "Monthly" %} - - Ponctuels - - / - - Mensuels - - {% else %} - - Ponctuels - - / - - Mensuels - - {% endif %} + + +
+ {% if not payments %} + +
+ Aucun paiement ne correspond à votre recherche.
- {% if query.frequency != "Monthly" %} - - {% endif %} -
- - - Nouveau - -
- - {% if not payments %} - -
- Aucun paiement ne correspond à votre recherche. -
- - {% else %} - -
- {{ count | numeric }} paiement{{ count | pluralize }} comptabilisant {{ total_cost | euros() }}. -
- -
-
- Nom - Coût - Personne - Catégorie - {% if query.frequency != "Monthly" %} - Date - {% endif %} + + Nouveau + + + {% else %} + +
+ {{ count | numeric }} paiement{{ count | pluralize }} comptabilisant {{ total_cost | euros() }}.
- {% for payment in payments %} - - {{ payment.name }} - - {{ payment.cost | euros() }} - - {{ payment.user }} - - - {{ payment.category_name }} - - + + + Ajouter un paiement + + +
+
+ Nom + Coût + Personne + Catégorie {% if query.frequency != "Monthly" %} - - {{ payment.date }} - + Date {% endif %} - - {% endfor %} -
- - {{ paging::paging( - url="/" ~ payments_params( - search=query.search, - frequency=query.frequency, - category=query.category - ), - page=page, - max_page=max_page - ) }} - - {% endif %} +
+ {% for payment in payments %} + + {{ payment.name }} + + {{ payment.cost | euros() }} + + {{ payment.user }} + + + {{ payment.category_name }} + + + {% if query.frequency != "Monthly" %} + + {{ payment.date }} + + {% endif %} + + {% endfor %} +
+ + {{ paging::paging( + url="/" ~ payments_params( + search=query.search, + frequency=query.frequency, + category=query.category + ), + page=page, + max_page=max_page + ) }} + + {% endif %} + + {% endblock main %} diff --git a/templates/payment/update.html b/templates/payment/update.html index 25e6915..4e244f4 100644 --- a/templates/payment/update.html +++ b/templates/payment/update.html @@ -6,7 +6,7 @@ {% block main %} -
+

Modification

- - - - - + + + {% set user_id = form.user_id | default(value="" ~ payment.user_id) %} - - + {% set category_id = form.category_id | default(value="" ~ payment.category_id) %} - - + {% set date = form.date | default(value=payment.date) %} {% if payment.frequency == "Punctual" %} - - + {% else %}

Suppression

-
+ {% endblock main %} -- cgit v1.2.3