make partials source-agnostic

they're currently expecting a RecipientsCSV object - but we won't
always have that available if we're handling a single notification.

So make the partials take generic variables, and then use a jinja with
block to pass in the correct values from either the check csv page or
the check notification page.

Additionally set the notification check page to show errors nicely -
hide the send button if there were problems, and replace the header
This commit is contained in:
Leo Hemsted
2017-06-29 15:33:31 +01:00
parent 70914bfe8a
commit 42e33ce9e6
4 changed files with 42 additions and 17 deletions

View File

@@ -120,7 +120,12 @@
</div>
{% elif not recipients.allowed_to_send_to %}
{% include "partials/check/not-allowed-to-send-to.html" %}
{% with
count_of_recipients=count_of_recipients,
template_type_label=recipients.recipient_column_headers[0]
%}
{% include "partials/check/not-allowed-to-send-to.html" %}
{% endwith %}
{% elif recipients.more_rows_than_can_send %}
{% include "partials/check/too-many-messages.html" %}
{% else %}