Refactor sticky button into component

This commit is contained in:
Chris Hill-Scott
2019-01-14 13:34:23 +00:00
parent 509a9e861d
commit 0df88f923c
4 changed files with 18 additions and 18 deletions

View File

@@ -35,3 +35,9 @@
{% endif %} {% endif %}
</div> </div>
{% endmacro %} {% endmacro %}
{% macro sticky_page_footer(button_text=None) %}
<div class="js-stick-at-bottom-when-scrolling">
{{ page_footer(button_text) }}
</div>
{% endmacro %}

View File

@@ -1,6 +1,6 @@
{% extends "withnav_template.html" %} {% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %} {% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %} {% from "components/page-footer.html" import sticky_page_footer %}
{% from "components/radios.html" import radios %} {% from "components/radios.html" import radios %}
{% from "components/form.html" import form_wrapper %} {% from "components/form.html" import form_wrapper %}
@@ -23,11 +23,9 @@
{% if current_user.platform_admin %} {% if current_user.platform_admin %}
{{ radios(form.process_type) }} {{ radios(form.process_type) }}
{% endif %} {% endif %}
<div class="js-stick-at-bottom-when-scrolling"> {{ sticky_page_footer(
{{ page_footer( 'Save'
'Save' ) }}
) }}
</div>
</div> </div>
<aside class="column-whole"> <aside class="column-whole">
{% include "partials/templates/guidance-formatting.html" %} {% include "partials/templates/guidance-formatting.html" %}

View File

@@ -1,6 +1,6 @@
{% extends "withnav_template.html" %} {% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %} {% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %} {% from "components/page-footer.html" import sticky_page_footer %}
{% from "components/radios.html" import radios %} {% from "components/radios.html" import radios %}
{% from "components/form.html" import form_wrapper %} {% from "components/form.html" import form_wrapper %}
@@ -23,11 +23,9 @@
{% endif %} {% endif %}
{{ textbox(form.subject, width='1-1', highlight_tags=True, rows=2) }} {{ textbox(form.subject, width='1-1', highlight_tags=True, rows=2) }}
{{ textbox(form.template_content, highlight_tags=True, width='1-1', rows=8) }} {{ textbox(form.template_content, highlight_tags=True, width='1-1', rows=8) }}
<div class="js-stick-at-bottom-when-scrolling"> {{ sticky_page_footer(
{{ page_footer( 'Save'
'Save' ) }}
) }}
</div>
</div> </div>
<aside class="column-three-quarters"> <aside class="column-three-quarters">
{% include "partials/templates/guidance-formatting-letters.html" %} {% include "partials/templates/guidance-formatting-letters.html" %}

View File

@@ -1,6 +1,6 @@
{% extends "withnav_template.html" %} {% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %} {% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %} {% from "components/page-footer.html" import sticky_page_footer %}
{% from "components/radios.html" import radios %} {% from "components/radios.html" import radios %}
{% from "components/form.html" import form_wrapper %} {% from "components/form.html" import form_wrapper %}
@@ -24,11 +24,9 @@
{% if current_user.platform_admin %} {% if current_user.platform_admin %}
{{ radios(form.process_type) }} {{ radios(form.process_type) }}
{% endif %} {% endif %}
<div class="js-stick-at-bottom-when-scrolling"> {{ sticky_page_footer(
{{ page_footer( 'Save'
'Save' ) }}
) }}
</div>
</div> </div>
<aside class="column-whole"> <aside class="column-whole">
{% include "partials/templates/guidance-personalisation.html" %} {% include "partials/templates/guidance-personalisation.html" %}