From 24eeb54a6b7159964e8887ade7fa5173b50feb3a Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 26 Jan 2025 17:58:57 +0100 Subject: Replace tera by minijinja tera was doing the job all right, but minijinja has fewer dependencies. --- templates/balance.html | 14 +++++++------- templates/base.html | 6 +++--- templates/category/create.html | 4 ++-- templates/category/update.html | 4 ++-- templates/income/create.html | 12 ++++++------ templates/income/table.html | 6 +++--- templates/income/update.html | 10 +++++----- templates/macros/paging.html | 16 +++++----------- templates/payment/create.html | 12 ++++++------ templates/payment/table.html | 8 ++++---- templates/payment/table/search.html | 8 ++++---- templates/payment/update.html | 10 +++++----- templates/report/list.j2 | 6 +++--- templates/report/report.j2 | 26 +++++++++++++------------- templates/statistics.html | 2 +- 15 files changed, 69 insertions(+), 75 deletions(-) (limited to 'templates') diff --git a/templates/balance.html b/templates/balance.html index b97ea40..c7f68e8 100644 --- a/templates/balance.html +++ b/templates/balance.html @@ -11,7 +11,7 @@
Retour aux revenus @@ -18,7 +18,7 @@
Retour aux revenus @@ -39,12 +39,12 @@ name="amount" type="number" class="g-Form__Input" - value="{{ form.amount | default(value=income.amount) }}" + value="{{ form.amount or income.amount }}" required /> - {% set user_id = form.user_id | default(value="" ~ income.user_id) %} + {% set user_id = form.user_id or income.user_id %} - {% set month_index = form.month | default(value="" ~ income.month) %} + {% set month_index = form.month or income.month %} diff --git a/templates/macros/paging.html b/templates/macros/paging.html index 59ba617..840e8f4 100644 --- a/templates/macros/paging.html +++ b/templates/macros/paging.html @@ -1,10 +1,4 @@ -{% macro paging(url, page, max_page) %} - {% if url is containing("?") %} - {% set sign = "&" %} - {% else %} - {% set sign = "?" %} - {% endif %} - +{% macro view(url, page, max_page) %}
-{% endmacro paging %} +{% endmacro %} diff --git a/templates/payment/create.html b/templates/payment/create.html index 4ac73de..7bcc536 100644 --- a/templates/payment/create.html +++ b/templates/payment/create.html @@ -44,7 +44,7 @@ @@ -56,12 +56,12 @@ name="cost" type="number" class="g-Form__Input" - value="{{ form.cost | default(value="") }}" + value="{{ form.cost or "" }}" required /> - {% set user_id = form.user_id | default(value="" ~ connected_user.id) %} + {% set user_id = form.user_id or connected_user.id %} - {% set category_id = form.category_id | default(value="") %} + {% set category_id = form.category_id or "" %} - {% set date = form.date | default(value=now() | date(format="%Y-%m-%d")) %} + {% set date = form.date or now("%Y-%m-%d") %} {% if query.frequency != "Monthly" %} {{ payment.user }} - {{ payment.category_name }} @@ -97,7 +97,7 @@ {% endfor %}