permettre l'écriture de days_until_due
This commit is contained in:
parent
f23e3cc1b7
commit
fcfe53e3cf
2 changed files with 17 additions and 5 deletions
|
|
@ -46,6 +46,8 @@
|
|||
owner: root
|
||||
group: root
|
||||
mode: preserve
|
||||
notify:
|
||||
- restart life-noc input api
|
||||
|
||||
- name: generate icinga services from domains
|
||||
ansible.builtin.command:
|
||||
|
|
|
|||
|
|
@ -580,14 +580,24 @@ def page_item(domain: str, item_key: str) -> HTMLResponse:
|
|||
"""
|
||||
|
||||
manual_form_html = ""
|
||||
if allow_manual_edit and form_mode == "complete_date":
|
||||
if allow_manual_edit and form_mode in {"complete_date", "due_date"}:
|
||||
form_title = "Mettre à jour la date" if form_mode == "complete_date" else "Définir l’échéance"
|
||||
field_label = "Date" if form_mode == "complete_date" else "Date d’échéance"
|
||||
form_hint = ""
|
||||
if form_mode == "due_date":
|
||||
form_hint = '<p class="muted">Saisir la date cible de cette échéance.</p>'
|
||||
manual_form_html = f"""
|
||||
<section class="card">
|
||||
<h2>Mettre à jour la date</h2>
|
||||
<form method="post" action="/life-noc/item/{html_escape(domain)}/{html_escape(item_key)}/set" class="actions">
|
||||
<input type="date" name="value" value="{html_escape(current_input.get('value', ''))}" required>
|
||||
<h2>{html_escape(form_title)}</h2>
|
||||
{form_hint}
|
||||
<form method="post" action="/life-noc/item/{html_escape(domain)}/{html_escape(item_key)}/set" class="form-grid">
|
||||
<label>{html_escape(field_label)}
|
||||
<input type="date" name="value" value="{html_escape(current_input.get('value', ''))}" required>
|
||||
</label>
|
||||
<input type="hidden" name="origin" value="manual">
|
||||
<button type="submit">Enregistrer</button>
|
||||
<div class="actions">
|
||||
<button type="submit">Enregistrer</button>
|
||||
</div>
|
||||
</form>
|
||||
</section>
|
||||
"""
|
||||
|
|
|
|||
Loading…
Reference in a new issue