Merge pull request #1168 from alphagov/contact-letter-block

add letter_contact_block edit fields
This commit is contained in:
Chris Hill-Scott
2017-03-06 11:11:54 +00:00
committed by GitHub
13 changed files with 208 additions and 13 deletions

View File

@@ -30,7 +30,9 @@
{% endif %}
</label>
{{ field(**{
'class': 'form-control form-control-{} textbox-highlight-textbox'.format(width) if highlight_tags else 'form-control form-control-{} {}'.format(width, 'textbox-right-aligned' if suffix else ''),
'class':
'form-control form-control-{} textbox-highlight-textbox'.format(width) if highlight_tags else
'form-control form-control-{} {}'.format(width, 'textbox-right-aligned' if suffix else ''),
'data-module': 'highlight-tags' if highlight_tags else '',
'rows': rows|string
}) }}

View File

@@ -0,0 +1,8 @@
<h2 class="heading-medium">Contact details</h2>
<p>
Add contact details for your service in
<a href="{{ url_for('.service_set_letter_contact_block', service_id=current_service.id) }}">settings</a>.
</p>
<p>
The text will appear in the top right of all letters your service sends.
</p>

View File

@@ -26,9 +26,10 @@
delete_link_text='Delete this template'
) }}
</div>
<aside class="column-whole">
<aside class="column-three-quarters">
{% include "partials/templates/guidance-formatting-letters.html" %}
{% include "partials/templates/guidance-personalisation.html" %}
{% include "partials/templates/guidance-contact-block.html" %}
</aside>
</div>
</form>

View File

@@ -20,23 +20,35 @@
caption_visible=False
) %}
{% call row() %}
{{ text_field('Service name' )}}
{{ text_field('Service name') }}
{{ text_field(current_service.name) }}
{{ edit_field('Change', url_for('.service_name_change', service_id=current_service.id)) }}
{% endcall %}
{% call row() %}
{{ text_field('Email reply to address')}}
{{ text_field('Email reply to address') }}
{{ text_field(
current_service.reply_to_email_address,
status='' if current_service.reply_to_email_address else 'default'
) }}
{{ edit_field('Change', url_for('.service_set_reply_to_email', service_id=current_service.id)) }}
{% endcall %}
{% call row() %}
{{ text_field('Text message sender')}}
{{ text_field('Text message sender') }}
{{ text_field(current_service.sms_sender or '40604') }}
{{ edit_field('Change', url_for('.service_set_sms_sender', service_id=current_service.id)) }}
{% endcall %}
{% if current_service.can_send_letters %}
{% call row() %}
{{ text_field('Letter contact details') }}
{% call field(status='' if current_service.letter_contact_block else 'default') %}
{{ current_service.letter_contact_block | escape | nl2br | safe }}
{% endcall %}
{{ edit_field('Change', url_for('.service_set_letter_contact_block', service_id=current_service.id)) }}
{% endcall %}
{% endif %}
{% endcall %}
</div>

View File

@@ -0,0 +1,29 @@
{% extends "withnav_template.html" %}
{% from "components/textbox.html" import textbox %}
{% from "components/page-footer.html" import page_footer %}
{% block service_page_title %}
Letter contact block
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">
Letter contact details
</h1>
<div class="grid-row">
<form method="post" class="column-half">
{{ textbox(
form.letter_contact_block,
width='1-1',
rows=10
) }}
{{ page_footer(
'Save',
back_link=url_for('.service_settings', service_id=current_service.id),
back_link_text='Back to settings'
) }}
</form>
</div>
{% endblock %}