mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Use a macro for form tags
This will stop us repeatedly forgetting to add `novalidate` and `autocomplete='off'` to our forms (which is how most of them are set up). It uses sensible defaults, based on how we most-commonly configure forms: - most of our forms are `post`ed (but this can be overridden) - `autocomplete` should only be enabled where it makes sense, otherwise it’s more annoying than useful (but this can be overriden) - we should never be using HTML5 form validation because our own error styles and messages are better
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
{% from "components/big-number.html" import big_number_simple %}
|
||||
{% from "components/message-count-label.html" import message_count_label %}
|
||||
{% from "components/status-box.html" import status_box %}
|
||||
{% from "components/form.html" import form_wrapper %}
|
||||
|
||||
{% block per_page_title %}
|
||||
Platform admin
|
||||
@@ -15,12 +16,12 @@
|
||||
</h1>
|
||||
<details {% if form.errors %}open{% endif %}>
|
||||
<summary>Apply filters</summary>
|
||||
<form autocomplete="off" method="get">
|
||||
{% call form_wrapper(method="get") %}
|
||||
{{ textbox(form.start_date, hint="Enter start date in format YYYY-MM-DD") }}
|
||||
{{ textbox(form.end_date, hint="Enter end date in format YYYY-MM-DD") }}
|
||||
</br>
|
||||
<button type="submit" class="button">Filter</button>
|
||||
</form>
|
||||
{% endcall %}
|
||||
</details>
|
||||
|
||||
<div class="grid-row bottom-gutter">
|
||||
|
||||
Reference in New Issue
Block a user