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/payment/create.html | 12 ++++++------ templates/payment/table.html | 8 ++++---- templates/payment/table/search.html | 8 ++++---- templates/payment/update.html | 10 +++++----- 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'templates/payment') 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" %} @@ -27,7 +27,7 @@ type="number" name="cost" class="g-Form__Input" - value="{{ query.cost }}" + value="{{ query.cost or '' }}" /> @@ -67,7 +67,7 @@ type="date" name="start_date" class="g-Form__Input" - value="{{ query.start_date }}" + value="{{ query.start_date or '' }}" /> @@ -77,7 +77,7 @@ type="date" name="end_date" class="g-Form__Input" - value="{{ query.end_date }}" + value="{{ query.end_date or '' }}" /> diff --git a/templates/payment/update.html b/templates/payment/update.html index 22a4d01..dfa0892 100644 --- a/templates/payment/update.html +++ b/templates/payment/update.html @@ -57,7 +57,7 @@ @@ -68,12 +68,12 @@ name="cost" type="number" class="g-Form__Input" - value="{{ form.cost | default(value=payment.cost) }}" + value="{{ form.cost or payment.cost }}" required /> - {% set user_id = form.user_id | default(value="" ~ payment.user_id) %} + {% set user_id = form.user_id or payment.user_id %} - {% set category_id = form.category_id | default(value="" ~ payment.category_id) %} + {% set category_id = form.category_id or payment.category_id %} - {% set date = form.date | default(value=payment.date) %} + {% set date = form.date or payment.date %} {% if payment.frequency == "Punctual" %}