Rename submit_form component to page_footer

Submit form was
- a confusing name in itself
- not descriptive, because it also has an optional ‘back’ link

This commit also puts this component in as many pages as possible, stripping
out any hard-coded buttons and links.

It replaces any usage of buttons for ‘back’, because these are links, not
buttons (ie they don’t change any data).
This commit is contained in:
Chris Hill-Scott
2016-01-07 20:11:22 +00:00
parent 0b62d1e755
commit 4d10eec1e2
24 changed files with 73 additions and 76 deletions

View File

@@ -0,0 +1,11 @@
{% macro page_footer(button_text=None, back_link=False, back_link_text="Back", destructive=False) %}
<div class="page-footer">
{% if button_text %}
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="submit" class="button{% if destructive %}-destructive{% endif %}" value="{{ button_text }}" />
{% endif %}
{% if back_link %}
<a class="page-footer-back-link" role="button" href="{{ back_link }}">{{ back_link_text }}</a>
{% endif %}
</div>
{% endmacro %}

View File

@@ -1,9 +0,0 @@
{% macro submit_form(button_text, back_link=False, back_link_text="Back", destructive=False) %}
<div class="submit-form">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="submit" class="button{% if destructive %}-destructive{% endif %}" value="{{ button_text }}" />
{% if back_link %}
<a class="submit-form-back-link" role="button" href="{{ back_link }}">{{ back_link_text }}</a>
{% endif %}
</div>
{% endmacro %}