mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-10 01:55:41 -04:00
Added 2 new macros for carrier and carrier message
adjusted formating in table and notifications html
This commit is contained in:
@@ -69,7 +69,7 @@
|
|||||||
'table-field-right-aligned' if align == 'right' else
|
'table-field-right-aligned' if align == 'right' else
|
||||||
'table-field-center-aligned' if align == 'center' else
|
'table-field-center-aligned' if align == 'center' else
|
||||||
'table-field-left-aligned'
|
'table-field-left-aligned'
|
||||||
%}
|
%}
|
||||||
{% set border = '' if border else 'table-field-noborder' %}
|
{% set border = '' if border else 'table-field-noborder' %}
|
||||||
{% set wrap = 'table-field-wrap-text' if wrap else '' %}
|
{% set wrap = 'table-field-wrap-text' if wrap else '' %}
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@
|
|||||||
{% if notification.status|format_notification_status_as_url(notification.notification_type) %}
|
{% if notification.status|format_notification_status_as_url(notification.notification_type) %}
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<p class="status-hint margin-0 width-card-lg">
|
<p class="status-hint margin-0 width-card ">
|
||||||
{{ notification.status|format_notification_status_as_time(
|
{{ notification.status|format_notification_status_as_time(
|
||||||
notification.created_at|format_datetime_short,
|
notification.created_at|format_datetime_short,
|
||||||
(notification.updated_at or notification.created_at)|format_datetime_short
|
(notification.updated_at or notification.created_at)|format_datetime_short
|
||||||
@@ -180,6 +180,42 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro notification_carrier_field(notification) %}
|
||||||
|
|
||||||
|
<!-- {% set displayed_on_single_line = notification.status in ['created', 'pending', 'sending', 'delivered', 'accepted', 'received'] %} -->
|
||||||
|
|
||||||
|
{% if not notification %}
|
||||||
|
{% call field(align='right') %}{% endcall %}
|
||||||
|
{% else %}
|
||||||
|
<!-- {% set status = notification.status|format_notification_status_as_field_status(notification.notification_type) %} -->
|
||||||
|
{% call field(
|
||||||
|
align='right'
|
||||||
|
) %}
|
||||||
|
<p class="status-hint margin-0 width-card">
|
||||||
|
{{ notification.carrier}}
|
||||||
|
</p>
|
||||||
|
{% if displayed_on_single_line %}</span>{% endif %}
|
||||||
|
{% endcall %}
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
|
{% macro notification_carrier_message_field(notification) %}
|
||||||
|
|
||||||
|
{% if not notification %}
|
||||||
|
{% call field(align='right') %}{% endcall %}
|
||||||
|
{% else %}
|
||||||
|
<!-- {% set status = notification.status|format_notification_status_as_field_status(notification.notification_type) %} -->
|
||||||
|
{% call field(
|
||||||
|
status=status,
|
||||||
|
align='right'
|
||||||
|
) %}
|
||||||
|
<p class="status-hint margin-0 width-card">
|
||||||
|
{{notification.provider_response}}
|
||||||
|
</p>
|
||||||
|
{% if displayed_on_single_line %}</span>{% endif %}
|
||||||
|
{% endcall %}
|
||||||
|
{% endif %}
|
||||||
|
{% endmacro %}
|
||||||
|
|
||||||
{% macro spark_bar_field(
|
{% macro spark_bar_field(
|
||||||
count,
|
count,
|
||||||
@@ -189,7 +225,7 @@
|
|||||||
{% call field(align='right') %}
|
{% call field(align='right') %}
|
||||||
<span {% if id %}id="{{ id }}"{% endif %} class="spark-bar">
|
<span {% if id %}id="{{ id }}"{% endif %} class="spark-bar">
|
||||||
<span class="spark-bar-bar">
|
<span class="spark-bar-bar">
|
||||||
{{ '{:,.0f}'.format(count) }}
|
{{ '{:,.0f}'.format(count) }}
|
||||||
<!-- {% if count == 1 -%}
|
<!-- {% if count == 1 -%}
|
||||||
message sent
|
message sent
|
||||||
{% else -%}
|
{% else -%}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{% from "components/page-footer.html" import page_footer %}
|
{% from "components/page-footer.html" import page_footer %}
|
||||||
{% from "components/previous-next-navigation.html" import previous_next_navigation %}
|
{% 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 %}
|
{% from "components/table.html" import list_table, field, text_field, link_field, right_aligned_field_heading, hidden_field_heading, row_heading, notification_status_field, notification_carrier_field, notification_carrier_message_field %}
|
||||||
|
|
||||||
<div class="ajax-block-container" id='pill-selected-item'>
|
<div class="ajax-block-container" id='pill-selected-item'>
|
||||||
|
|
||||||
@@ -12,17 +12,19 @@
|
|||||||
caption="Recent activity",
|
caption="Recent activity",
|
||||||
caption_visible=False,
|
caption_visible=False,
|
||||||
empty_message='No messages found  (messages are kept for {} days)'.format(limit_days)|safe,
|
empty_message='No messages found  (messages are kept for {} days)'.format(limit_days)|safe,
|
||||||
field_headings=['Recipient', 'Status'],
|
field_headings=['Recipient', 'Status', 'Carrier', 'Response'],
|
||||||
field_headings_visible=False
|
field_headings_visible=False
|
||||||
) %}
|
) %}
|
||||||
{% call row_heading() %}
|
{% call row_heading() %}
|
||||||
<a class="usa-link file-list-filename" href="{{ single_notification_url(notification_id=item.id) }}">{{ item.to.splitlines()|join(', ') if item.to else '' }}</a>
|
<a class="usa-link file-list-filename" href="{{ single_notification_url(notification_id=item.id) }}">{{ item.to.splitlines()|join(', ') if item.to else '' }}</a>
|
||||||
<p class="file-list-hint">
|
<p class="file-list-hint width-card">
|
||||||
{{ item.preview_of_content }}
|
{{ item.preview_of_content }}
|
||||||
</p>
|
</p>
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
|
|
||||||
{{ notification_status_field(item) }}
|
{{ notification_status_field(item) }}
|
||||||
|
{{ notification_carrier_field(item) }}
|
||||||
|
{{ notification_carrier_message_field(item)}}
|
||||||
|
|
||||||
{% endcall %}
|
{% endcall %}
|
||||||
{% if notifications %}
|
{% if notifications %}
|
||||||
|
|||||||
Reference in New Issue
Block a user