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/balance.html | 2 +- templates/base.html | 116 +++++++++--------- templates/category/create.html | 44 +++---- templates/category/table.html | 49 ++++---- templates/category/update.html | 49 ++++---- templates/income/create.html | 96 ++++++++------- templates/income/table.html | 73 ++++++------ templates/income/update.html | 99 ++++++++-------- templates/login.html | 14 ++- templates/payment/create.html | 93 ++++++++------- templates/payment/table.html | 259 ++++++++++++++++++++--------------------- templates/payment/update.html | 117 ++++++++++--------- templates/statistics.html | 10 +- 13 files changed, 526 insertions(+), 495 deletions(-) (limited to 'templates') diff --git a/templates/balance.html b/templates/balance.html index 15da854..b97ea40 100644 --- a/templates/balance.html +++ b/templates/balance.html @@ -6,7 +6,7 @@ {% block main %} -
+
{% if exceeding_payers %}
- {% endif %} + + Statistiques + - + +{% endif %}
{% block main %}{% endblock main %} diff --git a/templates/category/create.html b/templates/category/create.html index e206898..af95e16 100644 --- a/templates/category/create.html +++ b/templates/category/create.html @@ -6,7 +6,7 @@ {% block main %} -
+

Retour aux categories @@ -22,30 +22,32 @@

{% endif %} - - - - - + + +
-
+ {% endblock main %} diff --git a/templates/category/table.html b/templates/category/table.html index 896304a..ad42258 100644 --- a/templates/category/table.html +++ b/templates/category/table.html @@ -6,33 +6,36 @@ {% block main %} -
- Nouveau -
+
- {% if not categories %} + {% if not categories %} +
+ Il n’y a aucune catégorie. +
+ {% endif %} -
- Il n’y a aucune catégorie. + - {% else %} - -
- {% for category in categories %} - - + {% for category in categories %} + - {{ category.name }} - - - {% endfor %} -
+ + {{ category.name }} + + + {% endfor %} +
+ {% endif %} + +
- {% endif %} {% endblock main %} diff --git a/templates/category/update.html b/templates/category/update.html index a4c1481..48dda06 100644 --- a/templates/category/update.html +++ b/templates/category/update.html @@ -6,7 +6,7 @@ {% block main %} -
+

Retour aux catégories @@ -30,24 +30,26 @@ >

Modification

- - - - - + + +
@@ -67,19 +69,18 @@ utilisée.

{% else %} -
+
{% endblock main %} diff --git a/templates/income/create.html b/templates/income/create.html index b74dddd..3c899ca 100644 --- a/templates/income/create.html +++ b/templates/income/create.html @@ -6,7 +6,7 @@ {% block main %} -
+

{{ error }}

{% endif %} - - + {% set user_id = form.user_id | default(value="" ~ connected_user.id) %} - - + {% set month_index = form.month | default(value="" ~ current_month) %} - - + - - +
-
+ {% endblock main %} diff --git a/templates/income/table.html b/templates/income/table.html index efd82a7..60cd6e0 100644 --- a/templates/income/table.html +++ b/templates/income/table.html @@ -8,48 +8,49 @@ {% block main %} -
+
+ + {% if not incomes %} +
+ Il n’y a aucun revenu. +
+ {% endif %} +
- Nouveau + Ajouter un revenu -
- {% if not incomes %} + {% if incomes %} +
+
+ Montant + Personne + Mois +
+ {% for income in incomes %} + + + {{ income.amount | euros() }} + + {{ income.user }} + {{ income.date }} + + {% endfor %} +
-
- Il n’y a aucun revenu. -
+ {{ paging::paging( + url="/incomes", + page=page, + max_page=max_page + ) }} + {% endif %} - {% else %} + -
-
- Montant - Personne - Mois -
- {% for income in incomes %} - - - {{ income.amount | euros() }} - - {{ income.user }} - {{ income.date }} - - {% endfor %} -
- - {{ paging::paging( - url="/incomes", - page=page, - max_page=max_page - ) }} - - {% endif %} {% endblock main %} diff --git a/templates/income/update.html b/templates/income/update.html index 6dd649a..855d5c4 100644 --- a/templates/income/update.html +++ b/templates/income/update.html @@ -6,7 +6,7 @@ {% block main %} -
+

Modification

- - + {% set user_id = form.user_id | default(value="" ~ income.user_id) %} - - + {% set month_index = form.month | default(value="" ~ income.month) %} - - - - - + + +
@@ -99,19 +105,18 @@ utilisée.

{% else %} -
+
{% endblock main %} diff --git a/templates/login.html b/templates/login.html index fd4cfe9..0c2e151 100644 --- a/templates/login.html +++ b/templates/login.html @@ -13,11 +13,15 @@
{{ error }}
{% endif %} - - - - - + + +
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="") %} -
-
+ {% endblock main %} diff --git a/templates/payment/table.html b/templates/payment/table.html index 5234e05..da15b22 100644 --- a/templates/payment/table.html +++ b/templates/payment/table.html @@ -8,139 +8,138 @@ {% block main %} -
-
-
- {% 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 %} diff --git a/templates/statistics.html b/templates/statistics.html index badbc6d..21e8fcd 100644 --- a/templates/statistics.html +++ b/templates/statistics.html @@ -6,10 +6,12 @@ {% block main %} -
- - -
+
+
+ + +
+