{% extends 'base.html' %} {% block content %} {% from '_common_fields.html' import show_token_placeholders %} {#- Notification activity: every notification that is waiting, failed or was delivered, newest first, in one list. The list on the left, the selected notification on the right. Everything is in the address (filters, page, ?id= of the selected one), so it works without JavaScript; notification-queue.js opens the filters as a dialog, closes the row menus and copies an ID. See notification_delivery/ #} {%- macro nq_url() -%} {{- url_for('settings.notifications.queue', state=kwargs.get('state', filters.state), type=kwargs.get('type', filters.type), watch=kwargs.get('watch', filters.watch), page=kwargs.get('page'), id=kwargs.get('id'), per_page=kwargs.get('per_page')) -}} {%- endmacro -%} {#- A long text is cut off (faded out) at 200px by notification-queue.js, which then shows this to open it up. Without JavaScript the text is in the page whole and this stays hidden. #} {%- macro show_all_button(target_id) -%} {%- endmacro -%} {%- macro state_pill(state, item=None) -%} {%- if state == 'sent' -%} {{ _('Delivered') }} {%- elif state == 'failed' -%} {{ _('Failed') }} {%- elif item and item.sending -%} {{ _('Sending') }} {%- elif item and item.attempts -%} {%- else -%} {{ _('Queued') }} {%- endif -%} {%- endmacro -%} {#- How an attempt went, at the start of its line: a green tick, or a red cross with the status the other end answered with when the error has one (400, 503 ...) #} {%- macro attempt_pill(attempt) -%} {%- if attempt.ok -%} {{ _('Delivered') }} {%- else -%} {{ attempt.status_code or _('Failed') }} {%- endif -%} {%- endmacro -%} {%- set state_names = {'queued': _('Queued'), 'failed': _('Failed'), 'sent': _('Delivered')} -%}
{%- if filters.state or filters.type or filters.watch %}{{ _('No notifications match these filters.') }}{% else %}{{ _('No notifications yet.') }}{% endif -%}
{%- endfor %}{{ selected.url_masked or '-' }}{{ selected.id }}{{ _('This notification cannot be made from its template:') }}
{{ rendered.error }}
{%- elif rendered %}
{{ rendered.title }}
{{ rendered.body }}
{{ show_all_button('nq-rendered-body') }}
{%- if rendered.coloured_by_service %}
{{ _('This service shows the changes in colour: what is marked (removed), (added), (changed), (into) here is a coloured block there.') }}
{%- endif %} {%- else %}-
{%- endif %} {#- Only for one that could not be made when it was queued: everything else has no template any more, what it holds is what is sent #} {%- if not selected.tokens_rendered %}{{ selected.title or '' }}
{{ selected.body or '' }}
{{ show_all_button('nq-template-body') }}
{%- endif %}
{{ attempt.error }}{{ _('No attempt was made yet.') }}
{%- endif %} {%- else %}{{ _('Choose a notification on the left to see where it went and every attempt made.') }}
{%- endif %}