mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 19:03:30 -05:00
Makes uses of the additions to utils in https://github.com/alphagov/notifications-utils/pull/9 This commit strips out a lot of the complex stuff that the views and templates in this app were doing. There is now a cleaner separation of concerns: - utils returns the number and type of errors in the csv - `get_errors_for_csv` helper in this app maps the number and type of errors onto human-friendly error messages - the view and template just doing the glueing-together of all the pieces This is (hopefully) easier to understand, definitely makes the component parts easier to test in isolation, and makes it easier to give more specific error messages.
29 lines
937 B
HTML
29 lines
937 B
HTML
{% macro banner(body, type=None, with_tick=False, delete_button=None, subhead=None) %}
|
|
<div class='banner{% if type %}-{{ type }}{% endif %}{% if with_tick %}-with-tick{% endif %}'>
|
|
{% if subhead %}
|
|
<div class="grid-row">
|
|
<div class="column-one-third">
|
|
{{ subhead }}
|
|
</div>
|
|
<div class="column-two-thirds">
|
|
{% endif %}
|
|
|
|
{{ body }}
|
|
|
|
{% if subhead %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
{% if delete_button %}
|
|
<form method='post'>
|
|
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
|
<input type="submit" class="button" name="delete" value="{{ delete_button }}" />
|
|
</form>
|
|
{% endif %}
|
|
</div>
|
|
{% endmacro %}
|
|
|
|
{% macro banner_wrapper(type=None, with_tick=False, delete_button=None, subhead=None) %}
|
|
{{ banner(caller()|safe, type=type, with_tick=with_tick, delete_button=delete_button, subhead=subhead) }}
|
|
{% endmacro %}
|