Files
notifications-admin/app/templates/views/edit-broadcast-template.html
Chris Hill-Scott 3fdaa29f35 Fetch template length message as user types
This commit adds some Javascript that makes AJAX requests as the users
changes the content of their template.

It then takes the content returned by the backend and inserts it in the
page.
2021-01-07 17:11:43 +00:00

41 lines
1.5 KiB
HTML

{% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-header.html" import page_header %}
{% from "components/page-footer.html" import page_footer %}
{% from "components/form.html" import form_wrapper %}
{% block service_page_title %}
{{ heading_action }} template
{% endblock %}
{% block maincolumn_content %}
{{ page_header(
'{} template'.format(heading_action),
back_link=url_for('main.view_template', service_id=current_service.id, template_id=template.id) if template else url_for('main.choose_template', service_id=current_service.id, template_folder_id=template_folder_id)
) }}
{% call form_wrapper() %}
<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds">
{{ form.name(param_extensions={
"classes": "govuk-!-width-full",
"hint": {"text": "Your recipients will not see this"},
}) }}
{{ textbox(form.template_content, highlight_placeholders=False, autosize=True, width='1-1', rows=5) }}
</div>
<div class="govuk-grid-column-full">
<div class="js-stick-at-bottom-when-scrolling">
{{ page_footer('Save') }}
<span class="template-content-count">
<div data-module="update-status" data-target="template_content" data-updates-url="{{ url_for('.count_content_length', service_id=current_service.id, template_type='broadcast') }}">
</div>
</span>
</div>
</div>
</div>
{% endcall %}
{% endblock %}