aboutsummaryrefslogtreecommitdiff
path: root/templates/payment/update.html
diff options
context:
space:
mode:
authorJoris2021-01-03 13:40:40 +0100
committerJoris2021-01-03 13:54:20 +0100
commit11052951b74b9ad4b6a9412ae490086235f9154b (patch)
tree64526ac926c1bf470ea113f6cac8a33158684e8d /templates/payment/update.html
parent371449b0e312a03162b78797b83dee9d81706669 (diff)
downloadbudget-11052951b74b9ad4b6a9412ae490086235f9154b.tar.gz
budget-11052951b74b9ad4b6a9412ae490086235f9154b.tar.bz2
budget-11052951b74b9ad4b6a9412ae490086235f9154b.zip
Rewrite in Rust
Diffstat (limited to 'templates/payment/update.html')
-rw-r--r--templates/payment/update.html144
1 files changed, 144 insertions, 0 deletions
diff --git a/templates/payment/update.html b/templates/payment/update.html
new file mode 100644
index 0000000..25e6915
--- /dev/null
+++ b/templates/payment/update.html
@@ -0,0 +1,144 @@
+{% extends "base.html" %}
+
+{% block title %}
+ Paiement {{ id }}
+{% endblock title %}
+
+{% block main %}
+
+ <div>
+ <p class="g-Paragraph">
+ <a
+ class="g-Link g-Media__Large"
+ href="/{{ payments_params(
+ page=query.page,
+ search=query.search,
+ frequency=query.frequency
+ ) }}"
+ >
+ Retour aux paiements
+ </a>
+ </p>
+
+ {% if error %}
+ <div class="g-Form__Error">{{ error }}</div>
+ {% endif %}
+
+ {% if not payment %}
+
+ Le paiement n’a pas été trouvé.
+
+ {% else %}
+
+ <form
+ class="g-Form"
+ action="/payment/{{ payment.id }}/update{{ payments_params(
+ page=query.page,
+ search=query.search,
+ frequency=query.frequency,
+ highlight=query.highlight
+ ) }}"
+ method="POST"
+ >
+ <h1 class="g-H1">Modification</h1>
+
+ <label class="g-Form__Label" for="name">Nom</label>
+ <input
+ name="name"
+ class="g-Form__Input"
+ id="name"
+ value="{{ form.name | default(value=payment.name) }}"
+ required
+ />
+
+ <label class="g-Form__Label" for="cost">Coût</label>
+ <input
+ name="cost"
+ type="number"
+ class="g-Form__Input"
+ id="cost"
+ value="{{ form.cost | default(value=payment.cost) }}"
+ required
+ />
+
+ {% set user_id = form.user_id | default(value="" ~ payment.user_id) %}
+
+ <label class="g-Form__Label" for="user_id">Personne</label>
+ <select name="user_id" id="user_id" class="g-Form__Select" required>
+ {% for user in users %}
+ <option
+ value="{{ user.id }}"
+ {% if "" ~ user.id == user_id %} selected {% endif %}
+ >
+ {{ user.name }}
+ </option>
+ {% endfor %}
+ </select>
+
+ {% set category_id = form.category_id | default(value="" ~ payment.category_id) %}
+
+ <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>
+
+ {% set date = form.date | default(value=payment.date) %}
+
+ {% if payment.frequency == "Punctual" %}
+ <label class="g-Form__Label" for="date">Date</label>
+ <input
+ name="date"
+ type="date"
+ class="g-Form__Input"
+ id="date"
+ value="{{ date }}"
+ required
+ />
+ {% else %}
+ <input
+ name="date"
+ type="hidden"
+ value="{{ date }}"
+ />
+ {% endif %}
+
+ <div>
+ <input class="g-Button__Validate" type="submit" value="Modifier" />
+ </div>
+ </form>
+
+ <form
+ class="g-Form"
+ action="/payment/{{ payment.id }}/delete{{ payments_params(
+ page=query.page,
+ search=query.search,
+ frequency=query.frequency,
+ highlight=query.highlight
+ ) }}"
+ method="POST"
+ >
+ <h1 class="g-H1">Suppression</h1>
+
+ <label class="g-Form__Label" for="remove-input">
+ Veuillez recopier le nom du paiement : « {{ payment.name }} ».
+ </label>
+
+ <input name="remove-input" class="g-Form__Input" id="remove-input" data-name="{{ payment.name }}" />
+
+ <div>
+ <input class="g-Button__Danger" type="submit" value="Supprimer" id="remove-button" disabled />
+ </div>
+ </form>
+
+ {% endif %}
+ </div>
+
+{% endblock main %}