diff options
author | Joris | 2021-10-09 10:27:45 +0200 |
---|---|---|
committer | Joris | 2021-10-10 21:21:32 +0200 |
commit | af1177e814d19e63ce39c42fc7c5888e4b3d9604 (patch) | |
tree | 9e8d495f21a82e8cff92fe7692eb856b0e900e07 /templates/payment | |
parent | a370f989fe3b864676ed9aecf57f70e55e7958b2 (diff) |
Search by category
Diffstat (limited to 'templates/payment')
-rw-r--r-- | templates/payment/create.html | 26 | ||||
-rw-r--r-- | templates/payment/table.html | 20 |
2 files changed, 33 insertions, 13 deletions
diff --git a/templates/payment/create.html b/templates/payment/create.html index aea6fcd..5bae767 100644 --- a/templates/payment/create.html +++ b/templates/payment/create.html @@ -72,18 +72,20 @@ {% set category_id = form.category_id | default(value="") %} - <label class="g-Form__Label" for="category_id">Catégorie</label> - <select name="category_id" id="category_id" class="g-Form__Select" required> - {% for category in categories %} - <option - value="{{ category.id }}" - style="color: {{ category.color }}" - {% if "" ~ category.id == category_id %} selected {% endif %} - > - {{ category.name }} - </option> - {% endfor %} - </select> + <label class="g-Form__Label" for="category_id"> + Catégorie + <select name="category_id" id="category_id" class="g-Form__Select" required> + {% for category in categories %} + <option + value="{{ category.id }}" + style="color: {{ category.color }}" + {% if "" ~ category.id == category_id %} selected {% endif %} + > + {{ category.name }} + </option> + {% endfor %} + </select> + </label> {% set date = form.date | default(value=now() | date(format="%Y-%m-%d")) %} diff --git a/templates/payment/table.html b/templates/payment/table.html index 19b56b4..5234e05 100644 --- a/templates/payment/table.html +++ b/templates/payment/table.html @@ -44,6 +44,23 @@ class="g-Form__Input g-Payments__SearchInput" value="{{ query.search }}" /> + + <label class="g-Form__Label"> + Catégorie + <select name="category" class="g-Form__Select"> + <option disabled selected value></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__Search" value="🔍"> </form> {% endif %} @@ -118,7 +135,8 @@ {{ paging::paging( url="/" ~ payments_params( search=query.search, - frequency=query.frequency + frequency=query.frequency, + category=query.category ), page=page, max_page=max_page |