aboutsummaryrefslogtreecommitdiff
path: root/templates/income/create.html
diff options
context:
space:
mode:
authorJoris2021-01-03 13:40:40 +0100
committerJoris2021-01-03 13:54:20 +0100
commit11052951b74b9ad4b6a9412ae490086235f9154b (patch)
tree64526ac926c1bf470ea113f6cac8a33158684e8d /templates/income/create.html
parent371449b0e312a03162b78797b83dee9d81706669 (diff)
Rewrite in Rust
Diffstat (limited to 'templates/income/create.html')
-rw-r--r--templates/income/create.html89
1 files changed, 89 insertions, 0 deletions
diff --git a/templates/income/create.html b/templates/income/create.html
new file mode 100644
index 0000000..b74dddd
--- /dev/null
+++ b/templates/income/create.html
@@ -0,0 +1,89 @@
+{% extends "base.html" %}
+
+{% block title %}
+ Nouveau revenu
+{% endblock title %}
+
+{% block main %}
+
+ <div>
+ <p class="g-Paragraph">
+ <a
+ class="g-Link g-Media__Large"
+ href="/incomes?page={{ query.page | default(value=1) }}"
+ >
+ Retour aux revenus
+ </a>
+ </p>
+
+ <form
+ class="g-Form"
+ action="/income/create?page={{ query.page | default(value=1) }}"
+ method="POST"
+ >
+ <h1 class="g-H1">
+ Nouveau revenu
+ </h1>
+
+ {% if error %}
+ <div class="g-Form__Error">{{ error }}</div>
+ {% endif %}
+
+ <label class="g-Form__Label" for="amount">Montant</label>
+ <input
+ name="amount"
+ type="number"
+ class="g-Form__Input"
+ id="amount"
+ value="{{ form.amount | default(value="") }}"
+ required
+ {% if not form %} autofocus {% endif %}
+ />
+
+ {% set user_id = form.user_id | default(value="" ~ connected_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 month_index = form.month | default(value="" ~ current_month) %}
+
+ <label class="g-Form__Label" for="month">Mois</label>
+ <select name="month" id="month" class="g-Form__Select" required>
+ {% for month in months %}
+ <option
+ value="{{ loop.index }}"
+ {% if "" ~ loop.index == month_index %}
+ selected
+ {% endif %}
+ >
+ {{ month }}
+ </option>
+ {% endfor %}
+ </select>
+
+ <label class="g-Form__Label" for="year">Année</label>
+ <input
+ name="year"
+ type="number"
+ class="g-Form__Input"
+ id="year"
+ value="{{ form.year | default(value=now() | date(format="%Y")) }}"
+ required
+ />
+
+ <div>
+ <input class="g-Button__Validate" type="submit" value="Créer" />
+ </div>
+ </form>
+ </div>
+
+{% endblock main %}