Allow deleting default letter contact blocks

It’s possible to delete default letter contact blocks because there is a
fallback – having a blank letter contact block. This is different to SMS
senders and reply to addresses.

For this to make sense it also means:
- adding the ‘blank’ letter contact block to the list of letter contact
  blocks
- having a way of setting the default back to being blank
This commit is contained in:
Chris Hill-Scott
2019-07-05 13:17:48 +01:00
parent 17bf06d04c
commit 44d5dc44d3
7 changed files with 136 additions and 46 deletions

View File

@@ -17,11 +17,18 @@
) }}
</div>
<div class="user-list">
{% if not letter_contact_details %}
<div class="user-list-item">
<span class="hint">You havent added any letter contact details yet</span>
</div>
{% endif %}
<div class="user-list-item">
<span class="hint">
Blank
{% if current_service.default_letter_contact_block %}
{% if current_user.has_permissions('manage_service') %}
<a class="user-list-edit-link" href="{{ url_for('.service_make_blank_default_letter_contact', service_id =current_service.id) }}">Make default</a>
{% endif %}
{% else %}
(default)
{% endif %}
</span>
</div>
{% for item in letter_contact_details %}
<div class="user-list-item">
<p>

View File

@@ -24,20 +24,24 @@
rows=10,
highlight_tags=True
) }}
{% if form.is_default.data %}
<p class="form-group">
This is currently your default address for {{ current_service.name }}
This is the default address for {{ current_service.name }}
</p>
{% else %}
<div class="form-group">
{{ checkbox(form.is_default) }}
</div>
{% endif %}
{{ page_footer(
'Save',
delete_link=url_for('.service_confirm_delete_letter_contact', service_id=current_service.id, letter_contact_id=letter_contact_id),
delete_link_text='Delete'
) }}
{% endcall %}
{% endblock %}