aboutsummaryrefslogtreecommitdiff
path: root/templates/payment/table.html
diff options
context:
space:
mode:
Diffstat (limited to 'templates/payment/table.html')
-rw-r--r--templates/payment/table.html91
1 files changed, 21 insertions, 70 deletions
diff --git a/templates/payment/table.html b/templates/payment/table.html
index da15b22..c187f17 100644
--- a/templates/payment/table.html
+++ b/templates/payment/table.html
@@ -9,84 +9,34 @@
{% block main %}
<aside class="g-Aside">
- <form action="/" method="GET" class="g-Payments__Filters">
- <label class="g-Form__Label">
- Fréquence
- <select name="frequency" class="g-Form__Select">
- <option value="Punctual" {% if query.frequency == "Punctual" %} selected {% endif %}>
- Ponctuelle
- </option>
- <option value="Monthly" {% if query.frequency == "Monthly" %} selected {% endif %}>
- Mensuelle
- </option>
- </select>
- </label>
-
- <label class="g-Form__Label">
- Recherche
- <input
- type="search"
- name="search"
- class="g-Form__Input"
- value="{{ query.search }}"
- />
- </label>
-
- <label class="g-Form__Label">
- Catégorie
- <select name="category" class="g-Form__Select">
- <option selected disabled hidden></option>
- {% for category in categories %}
- <option
- value="{{ category.id }}"
- style="color: {{ category.color }}"
- {% if category.id == query.category %} selected {% endif %}
- >
- {{ category.name }}
- </option>
- {% endfor %}
- </select>
- </label>
-
- <input type="submit" class="g-Button__Validate" value="Rechercher">
- </form>
+ {% include "payment/table/search.html" %}
</aside>
<section class="g-Section">
- {% if not payments %}
- <div class="g-Payments__NoResults">
+ {% if not payments %}
+ <div class="g-Table__NoResults">
Aucun paiement ne correspond à votre recherche.
</div>
-
- <a
- class="g-Button__Validate g-Payments__New"
- href="/payment{{ payments_params(
- page=query.page,
- search=query.search,
- frequency=query.frequency
- ) }}"
- >
- Nouveau
- </a>
-
{% else %}
-
<div class="g-Paragraph">
{{ count | numeric }} paiement{{ count | pluralize }} comptabilisant {{ total_cost | euros() }}.
</div>
+ {% endif %}
- <a
- class="g-Paragraph g-Button__Validate g-Payments__New"
- href="/payment{{ payments_params(
- page=query.page,
- search=query.search,
- frequency=query.frequency
- ) }}"
- >
- Ajouter un paiement
- </a>
-
+ <a
+ class="g-Paragraph g-Button__Validate"
+ href="/payment{{ payments_params(
+ page=query.page,
+ name=query.name,
+ cost=query.cost,
+ frequency=query.frequency
+ ) }}"
+ >
+ Ajouter un paiement
+ </a>
+
+ {% if payments %}
<div class="g-Table">
<div class="g-Table__Row g-Table__Row--Header">
<span class="g-Table__Cell">Nom</span>
@@ -102,7 +52,8 @@
class="g-Table__Row {% if query.highlight == payment.id %} g-Table__Row--Highlight {% endif %}"
href="/payment/{{ payment.id }}{{ payments_params(
page=query.page,
- search=query.search,
+ name=query.name,
+ cost=query.cost,
frequency=query.frequency
) }}"
>
@@ -131,14 +82,14 @@
{{ paging::paging(
url="/" ~ payments_params(
- search=query.search,
+ name=query.name,
+ cost=query.cost,
frequency=query.frequency,
category=query.category
),
page=page,
max_page=max_page
) }}
-
{% endif %}
</section>