mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-28 18:24:00 -04:00
merge from main
This commit is contained in:
@@ -150,8 +150,14 @@ def _csp(config):
|
||||
"https://js-agent.newrelic.com",
|
||||
"https://gov-bam.nr-data.net",
|
||||
"https://www.googletagmanager.com",
|
||||
"https://www.google-analytics.com",
|
||||
"https://dap.digitalgov.gov",
|
||||
],
|
||||
"connect-src": [
|
||||
"'self'",
|
||||
"https://gov-bam.nr-data.net",
|
||||
"https://www.google-analytics.com",
|
||||
],
|
||||
"connect-src": ["'self'", "https://gov-bam.nr-data.net"],
|
||||
"style-src": ["'self'", asset_domain],
|
||||
"img-src": ["'self'", asset_domain, logo_domain],
|
||||
}
|
||||
|
||||
@@ -1196,7 +1196,7 @@ class AdminServiceSMSAllowanceForm(StripWhitespaceForm):
|
||||
|
||||
class AdminServiceMessageLimitForm(StripWhitespaceForm):
|
||||
message_limit = GovukIntegerField(
|
||||
"Number of messages the service is allowed to send each day",
|
||||
"Max number of messages the service has per send",
|
||||
validators=[DataRequired(message="Cannot be empty")],
|
||||
)
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ from app.main.forms import (
|
||||
SearchUsersForm,
|
||||
)
|
||||
from app.models.user import InvitedUser, User
|
||||
from app.utils.user import is_gov_user, user_has_permissions, user_is_platform_admin
|
||||
from app.utils.user import is_gov_user, user_has_permissions
|
||||
from app.utils.user_permissions import permission_options
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ def manage_users(service_id):
|
||||
@main.route(
|
||||
"/services/<uuid:service_id>/users/invite/<uuid:user_id>", methods=["GET", "POST"]
|
||||
)
|
||||
@user_is_platform_admin
|
||||
@user_has_permissions("manage_service")
|
||||
def invite_user(service_id, user_id=None):
|
||||
form_class = InviteUserForm
|
||||
form = form_class(
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
'table-field-right-aligned' if align == 'right' else
|
||||
'table-field-center-aligned' if align == 'center' else
|
||||
'table-field-left-aligned'
|
||||
%}
|
||||
%}
|
||||
{% set border = '' if border else 'table-field-noborder' %}
|
||||
{% set wrap = 'table-field-wrap-text' if wrap else '' %}
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
{% if notification.status|format_notification_status_as_url(notification.notification_type) %}
|
||||
</a>
|
||||
{% 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.created_at|format_datetime_short,
|
||||
(notification.updated_at or notification.created_at)|format_datetime_short
|
||||
@@ -180,6 +180,42 @@
|
||||
{% endif %}
|
||||
{% 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(
|
||||
count,
|
||||
@@ -189,7 +225,7 @@
|
||||
{% call field(align='right') %}
|
||||
<span {% if id %}id="{{ id }}"{% endif %} class="spark-bar">
|
||||
<span class="spark-bar-bar">
|
||||
{{ '{:,.0f}'.format(count) }}
|
||||
{{ '{:,.0f}'.format(count) }}
|
||||
<!-- {% if count == 1 -%}
|
||||
message sent
|
||||
{% else -%}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% 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 %}
|
||||
{% 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'>
|
||||
|
||||
@@ -12,17 +12,19 @@
|
||||
caption="Recent activity",
|
||||
caption_visible=False,
|
||||
empty_message='No messages found  (messages are kept for {} days)'.format(limit_days)|safe,
|
||||
field_headings=['Recipient', 'Status'],
|
||||
field_headings=['Recipient', 'Status', 'Carrier', 'Carrier Response'],
|
||||
field_headings_visible=False
|
||||
) %}
|
||||
{% 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>
|
||||
<p class="file-list-hint">
|
||||
<p class="file-list-hint width-card">
|
||||
{{ item.preview_of_content }}
|
||||
</p>
|
||||
{% endcall %}
|
||||
|
||||
{{ notification_status_field(item) }}
|
||||
{{ notification_carrier_field(item) }}
|
||||
{{ notification_carrier_message_field(item)}}
|
||||
|
||||
{% endcall %}
|
||||
{% if notifications %}
|
||||
|
||||
@@ -9,9 +9,19 @@
|
||||
|
||||
{% block maincolumn_content %}
|
||||
|
||||
<h1 class="font-body-lg">
|
||||
Team members
|
||||
</h1>
|
||||
<div class="display-flex flex-justify flex-align-center">
|
||||
<h1 class="font-body-xl margin-0">
|
||||
Team members
|
||||
</h1>
|
||||
{% if current_user.has_permissions('manage_service') %}
|
||||
{{ usaButton({
|
||||
"element": "a",
|
||||
"text": "Invite a team member",
|
||||
"href": url_for('.invite_user', service_id=current_service.id),
|
||||
"classes": "usa-button--outline"
|
||||
}) }}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
{% if show_search_box %}
|
||||
<div data-module="autofocus">
|
||||
@@ -84,15 +94,4 @@
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
{% if current_user.has_permissions('manage_service') %}
|
||||
<div class="js-stick-at-bottom-when-scrolling">
|
||||
{{ usaButton({
|
||||
"element": "a",
|
||||
"text": "Invite a team member",
|
||||
"href": url_for('.invite_user', service_id=current_service.id),
|
||||
"classes": "usa-button"
|
||||
}) }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
@@ -294,9 +294,9 @@
|
||||
{{ edit_field('Change', url_for('.set_rate_limit', service_id=current_service.id), suffix='rate limit') }}
|
||||
{% endcall %}
|
||||
{% call row() %}
|
||||
{{ text_field('Message limit')}}
|
||||
{{ text_field('{:,} per day'.format(current_service.message_limit)) }}
|
||||
{{ edit_field('Change', url_for('.set_message_limit', service_id=current_service.id), suffix='daily message limit') }}
|
||||
{{ text_field('Message batch limit')}}
|
||||
{{ text_field('{:,} per send'.format(current_service.message_limit)) }}
|
||||
{{ edit_field('Change', url_for('.set_message_limit', service_id=current_service.id), suffix='message batch limit') }}
|
||||
{% endcall %}
|
||||
{% call row() %}
|
||||
{{ text_field('Free text message allowance')}}
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
{% from "components/components/back-link/macro.njk" import usaBackLink %}
|
||||
|
||||
{% block service_page_title %}
|
||||
Daily message limit
|
||||
Message batch limit
|
||||
{% endblock %}
|
||||
|
||||
{% block backLink %}
|
||||
@@ -15,7 +15,7 @@
|
||||
{% block maincolumn_content %}
|
||||
|
||||
{% call form_wrapper() %}
|
||||
{{ page_header('Daily message limit') }}
|
||||
{{ page_header('Message batch limit') }}
|
||||
{{ form.message_limit }}
|
||||
{{ page_footer('Save') }}
|
||||
{% endcall %}
|
||||
|
||||
@@ -16,9 +16,8 @@ Notify.gov
|
||||
<div class="grid-container padding-y-4">
|
||||
<div class="grid-row grid-gap display-flex flex-align-center">
|
||||
<div class="desktop:grid-col-7 tablet:grid-col-12">
|
||||
<h1 class="font-serif-2xl usa-hero__heading">Send text messages to your participants</h1>
|
||||
<p class="font-sans-lg">Notify.gov is a text messaging service that helps federal, state, local, tribal, and territorial governments more
|
||||
effectively communicate with their program participants.</p>
|
||||
<h1 class="font-serif-2xl usa-hero__heading">Reach people where they are with government-powered text messages</h1>
|
||||
<p class="font-sans-lg">Notify.gov is a text message service that helps federal, state, local, tribal and territorial governments more effectively communicate with the people they serve.</p>
|
||||
<div class="usa-button-group margin-bottom-5">
|
||||
<a class="usa-button usa-button--big margin-right-2" href="{{ url_for('main.sign_in' )}}">Sign in</a>
|
||||
if you are an existing pilot partner
|
||||
@@ -304,4 +303,4 @@ Notify.gov
|
||||
</div>-->
|
||||
|
||||
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
||||
@@ -38,18 +38,12 @@
|
||||
{% for item in template_list %}
|
||||
|
||||
{% set item_link_content %}
|
||||
{% for ancestor in item.ancestors %}
|
||||
<a href="{{ url_for('.choose_template', service_id=current_service.id, template_type=template_type, template_folder_id=ancestor.id) }}"
|
||||
class="usa-link template-list-folder">
|
||||
{{- format_item_name(ancestor.name) -}}
|
||||
</a> <span class="message-name-separator"></span>
|
||||
{% endfor %}
|
||||
{% if item.is_folder %}
|
||||
<a href="{{ url_for('.choose_template', service_id=current_service.id, template_type=template_type, template_folder_id=item.id) }}"
|
||||
class="usa-link template-list-folder">
|
||||
<span class="live-search-relevant">{{- format_item_name(item.name) -}}</span>
|
||||
</a>
|
||||
{% else %}
|
||||
{% elif not item.ancestors %}
|
||||
<a href="{{ url_for('.view_template', service_id=current_service.id, template_id=item.id) }}"
|
||||
class="usa-link template-list-template">
|
||||
<span class="live-search-relevant">
|
||||
@@ -70,9 +64,11 @@
|
||||
{% endset %}
|
||||
|
||||
{% set item_meta %}
|
||||
{% if not item.ancestors %}
|
||||
<span id="{{ item.id }}-item-hint" class="usa-hint usa-checkbox__label-description template-list-item-hint">
|
||||
{{ item.hint }}
|
||||
</span>
|
||||
{% endif %}
|
||||
{% endset %}
|
||||
|
||||
{# create the item config now to include the label content -#}
|
||||
@@ -112,4 +108,4 @@
|
||||
}) }}
|
||||
{% endif %}
|
||||
</nav>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user