Files
notifications-admin/app/templates/views/activity/notifications.html
Chris Hill-Scott f30187b529 Don’t show pagination links when searching
The search form makes a post request, so that phone numbers and email
addresses don’t show up in logs or browser history.

At most the API will return 50 results, with some pagination links. We
can’t easily give you links to click in the admin app, because links can
only perform get requests.

Because the value of seeing more than 50 results feels quite low (users
will probably make their search more specific before scrolling through
all 50) let’s just show a message saying only the first 50 results are
displayed.
2020-05-06 17:33:19 +01:00

45 lines
1.6 KiB
HTML

{% from "components/page-footer.html" import page_footer %}
{% from "components/previous-next-navigation.html" import previous_next_navigation %}
{% from "components/table.html" import list_table, field, text_field, link_field, right_aligned_field_heading, hidden_field_heading, row_heading, notification_status_field %}
<div class="ajax-block-container" id='pill-selected-item'>
{% if notifications %}
<div class='dashboard-table'>
{% endif %}
{% call(item, row_number) list_table(
notifications,
caption="Recent activity",
caption_visible=False,
empty_message='No messages found &thinsp;(messages are kept for {} days)'.format(limit_days)|safe,
field_headings=['Recipient', 'Status'],
field_headings_visible=False
) %}
{% call row_heading() %}
{% if item.status in ('pending-virus-check', 'virus-scan-failed') %}
<span class="file-list-filename loading-indicator">Checking</span>
{% else %}
<a class="govuk-link govuk-link--no-visited-state file-list-filename" href="{{ url_for('.view_notification', service_id=current_service.id, notification_id=item.id) }}">{{ item.to.splitlines()[0].lstrip().rstrip(' ,') if item.to else '' }}</a>
{% endif %}
<p class="file-list-hint">
{{ item.preview_of_content }}
</p>
{% endcall %}
{{ notification_status_field(item) }}
{% endcall %}
{% if notifications %}
</div>
{% endif %}
{% if more_than_can_be_shown %}
<p class="table-show-more-link">
Only showing the first 50 messages
</p>
{% else %}
{{ previous_next_navigation(prev_page, next_page) }}
{% endif %}
</div>