mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-10 07:03:12 -05:00
This commit makes the placeholder hint not be dependent on their only being one textbox with placeholders on a page. To do this it needs to be its own module, because the two textboxes are each self-contained instances of the same module. The way I’ve gone about this is to make the placeholder hint accept a list of textboxes it should look in when deciding what message to display to the user. Most of the code is extracted from the existing placeholder highlighting module.
40 lines
1.5 KiB
HTML
40 lines
1.5 KiB
HTML
{% extends "withnav_template.html" %}
|
||
{% from "components/textbox.html" import textbox %}
|
||
{% from "components/page-footer.html" import page_footer %}
|
||
|
||
{% block page_title %}
|
||
{{ heading_action }} email template – GOV.UK Notify
|
||
{% endblock %}
|
||
|
||
{% block maincolumn_content %}
|
||
|
||
<h1 class="heading-large">
|
||
{{ heading_action }} email template
|
||
</h1>
|
||
|
||
<form method="post">
|
||
<div class="grid-row">
|
||
<div class="column-two-thirds">
|
||
{{ textbox(form.name, width='1-1', hint='Your recipients won’t see this', rows=10) }}
|
||
{{ textbox(form.subject, width='1-1', highlight_tags=True, rows=2) }}
|
||
</div>
|
||
<div class="column-two-thirds">
|
||
{{ textbox(form.template_content, highlight_tags=True, width='1-1', rows=8) }}
|
||
{{ page_footer(
|
||
'Save',
|
||
delete_link=url_for('.delete_service_template', service_id=current_service.id, template_id=template_id) if template_id or None,
|
||
delete_link_text='Delete this template'
|
||
) }}
|
||
</div>
|
||
<div class="column-one-third">
|
||
<label for='template_content' class='placeholder-hint banner-mode' data-module='placeholder-hint' data-textboxes-selector='#template_content,#subject' data-target-textbox-selector="#template_content">
|
||
<div class="" id="placeholder-hint" aria-live="polite">
|
||
<p>Add fields using ((double brackets))</p>
|
||
</div>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
|
||
{% endblock %}
|