mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 22:40:31 -04:00
Refactor add-service form such that the dao is not exposed in the forms.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
{%- from "macros.html" import render_field %}
|
||||
{% block top_of_page %}{% endblock %}
|
||||
<!DOCTYPE html>
|
||||
<!--[if lt IE 9]><html class="lte-ie8" lang="{{ html_lang|default('en') }}"><![endif]-->
|
||||
|
||||
12
app/templates/macros.html
Normal file
12
app/templates/macros.html
Normal file
@@ -0,0 +1,12 @@
|
||||
{% macro render_field(field) %}
|
||||
<dt>{{ field.label }}
|
||||
<dd>{{ field(**kwargs)|safe }}
|
||||
{% if field.errors %}
|
||||
<ul class=error-summary>
|
||||
{% for error in field.errors %}
|
||||
<li>{{ error }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
</dd>
|
||||
{% endmacro %}
|
||||
@@ -18,9 +18,7 @@ GOV.UK Notify | Set up service
|
||||
|
||||
<form autocomplete="off" action="" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
<label class="form-label">Service name</label>
|
||||
{{ form.service_name(class="form-control-2-3", autocomplete="off") }} <br>
|
||||
<span class="font-xsmall">For example, 'Vehicle tax' or 'Carer's allowance'</span>
|
||||
{{ render_field(form.service_name, class='form-control-2-3') }}
|
||||
|
||||
<p>
|
||||
<button class="button" href="dashboard" role="button">Continue</button>
|
||||
|
||||
Reference in New Issue
Block a user