aboutsummaryrefslogtreecommitdiff
path: root/templates/payment
diff options
context:
space:
mode:
authorJoris2025-01-26 17:58:57 +0100
committerJoris2025-01-26 17:58:57 +0100
commit24eeb54a6b7159964e8887ade7fa5173b50feb3a (patch)
tree91af6253df784445db9b084b02b38b37a83224e8 /templates/payment
parentc5759f348e70cf54b4bfa4cd17e1fe1828ead30a (diff)
Replace tera by minijinjamain
tera was doing the job all right, but minijinja has fewer dependencies.
Diffstat (limited to 'templates/payment')
-rw-r--r--templates/payment/create.html12
-rw-r--r--templates/payment/table.html8
-rw-r--r--templates/payment/table/search.html8
-rw-r--r--templates/payment/update.html10
4 files changed, 19 insertions, 19 deletions
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 @@
<input
name="name"
class="g-Form__Input"
- value="{{ form.name | default(value="") }}"
+ value="{{ form.name or "" }}"
required
{% if not form %} autofocus {% endif %}
/>
@@ -56,12 +56,12 @@
name="cost"
type="number"
class="g-Form__Input"
- value="{{ form.cost | default(value="") }}"
+ value="{{ form.cost or "" }}"
required
/>
</label>
- {% set user_id = form.user_id | default(value="" ~ connected_user.id) %}
+ {% set user_id = form.user_id or connected_user.id %}
<label class="g-Form__Label">
Personne
@@ -79,7 +79,7 @@
</select>
</label>
- {% set category_id = form.category_id | default(value="") %}
+ {% set category_id = form.category_id or "" %}
<label class="g-Form__Label">
Catégorie
@@ -96,7 +96,7 @@
</select>
</label>
- {% 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" %}
<label class="g-Form__Label">
@@ -120,7 +120,7 @@
<input
type="hidden"
name="frequency"
- value="{{ query.frequency | default(value="Punctual") }}"
+ value="{{ query.frequency or "Punctual" }}"
/>
<div>
diff --git a/templates/payment/table.html b/templates/payment/table.html
index 450d84b..71bfb0a 100644
--- a/templates/payment/table.html
+++ b/templates/payment/table.html
@@ -20,7 +20,7 @@
</div>
{% else %}
<div class="g-Paragraph">
- {{ count | numeric }} paiement{{ count | pluralize }} comptabilisant {{ total_cost | euros() }}.
+ {{ count | numeric }} paiement{{ pluralize(count, "paiement") }} comptabilisant {{ total_cost | euros() }}.
</div>
{% endif %}
@@ -81,9 +81,9 @@
{{ payment.cost | euros() }}
</span>
<span class="g-Table__Cell">{{ payment.user }}</span>
- <span
+ <span
class="g-Table__Cell g-Media__Large"
- is="colored-category"
+ is="colored-category"
data-color="{{ payment.category_color }}"
>
{{ payment.category_name }}
@@ -97,7 +97,7 @@
{% endfor %}
</div>
- {{ paging::paging(
+ {{ paging.view(
url="/" ~ payments_params(
frequency=query.frequency,
name=query.name,
diff --git a/templates/payment/table/search.html b/templates/payment/table/search.html
index 9fedb78..cb72282 100644
--- a/templates/payment/table/search.html
+++ b/templates/payment/table/search.html
@@ -17,7 +17,7 @@
type="search"
name="name"
class="g-Form__Input"
- value="{{ query.name }}"
+ value="{{ query.name or '' }}"
/>
</label>
@@ -27,7 +27,7 @@
type="number"
name="cost"
class="g-Form__Input"
- value="{{ query.cost }}"
+ value="{{ query.cost or '' }}"
/>
</label>
@@ -67,7 +67,7 @@
type="date"
name="start_date"
class="g-Form__Input"
- value="{{ query.start_date }}"
+ value="{{ query.start_date or '' }}"
/>
</label>
@@ -77,7 +77,7 @@
type="date"
name="end_date"
class="g-Form__Input"
- value="{{ query.end_date }}"
+ value="{{ query.end_date or '' }}"
/>
</label>
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 @@
<input
name="name"
class="g-Form__Input"
- value="{{ form.name | default(value=payment.name) }}"
+ value="{{ form.name or payment.name }}"
required
/>
</label>
@@ -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
/>
</label>
- {% set user_id = form.user_id | default(value="" ~ payment.user_id) %}
+ {% set user_id = form.user_id or payment.user_id %}
<label class="g-Form__Label">
Personne
@@ -89,7 +89,7 @@
</select>
</label>
- {% set category_id = form.category_id | default(value="" ~ payment.category_id) %}
+ {% set category_id = form.category_id or payment.category_id %}
<label class="g-Form__Label">
Catégorie
@@ -105,7 +105,7 @@
</select>
</label>
- {% set date = form.date | default(value=payment.date) %}
+ {% set date = form.date or payment.date %}
{% if payment.frequency == "Punctual" %}
<label class="g-Form__Label">