new enum view_activity, _manage_users, send_emails

This commit is contained in:
Beverly Nguyen
2025-07-21 14:24:11 -07:00
parent f3ff033ef0
commit ce4829b717
28 changed files with 80 additions and 70 deletions

View File

@@ -6,11 +6,11 @@
href="{{ url_for('.choose_template', service_id=current_service.id) }}">Send messages</a>
<ul class="usa-sidenav">
{% if current_user.has_permissions() %}
{% if current_user.has_permissions('view_activity') %}
{% if current_user.has_permissions(ServicePermission.VIEW_ACTIVITY) %}
<li class="usa-sidenav__item"><a class="{{ main_navigation.is_selected('dashboard') }}" href="{{ url_for('.service_dashboard', service_id=current_service.id) }}">Dashboard</a></li>
<li class="usa-sidenav__item"><a class="{{ main_navigation.is_selected('activity') }}" href="{{ url_for('.all_jobs_activity', service_id=current_service.id) }}">Activity</a></li>
{% endif %}
{% if not current_user.has_permissions('view_activity') %}
{% if not current_user.has_permissions(ServicePermission.VIEW_ACTIVITY) %}
<li class="usa-sidenav__item"><a class="{{ casework_navigation.is_selected('sent-messages') }}" href="{{ url_for('.view_notifications', service_id=current_service.id, status='sending,delivered,failed') }}">Sent messages</a></li>
{% endif %}
{% elif current_user.has_permissions(allow_org_user=True) %}

View File

@@ -125,7 +125,7 @@
<p><b>Note: </b>Report data is only available for 7 days after your message has been sent</p>
</div>
{{show_pagination}}
{% if current_user.has_permissions('view_activity') %}
{% if current_user.has_permissions(ServicePermission.VIEW_ACTIVITY) %}
<h2 class="line-height-sans-2 margin-bottom-0 margin-top-4">Download recent reports</h2>
<p class="font-body-sm">
<a href="{{ download_link_one_day }}" download="download" class="usa-link">Download all data last 24 hours (<abbr title="Comma separated values">CSV</abbr>)</a>

View File

@@ -7,7 +7,7 @@
{% set page_title = (
(99|message_count_label(message_type, suffix='')) | capitalize
if current_user.has_permissions('view_activity')
if current_user.has_permissions(ServicePermission.VIEW_ACTIVITY)
else 'Sent messages'
) %}
@@ -62,7 +62,7 @@
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
{% endcall %}
{% if current_user.has_permissions('view_activity') %}
{% if current_user.has_permissions(ServicePermission.VIEW_ACTIVITY) %}
<p class="font-body-sm">
<a href="{{ download_link_seven_day }}" download="download" class="usa-link">Download all data last 7 days (<abbr title="Comma separated values">CSV</abbr>)</a>
&emsp;

View File

@@ -50,7 +50,7 @@
{{ ajax_block(partials, updates_url, 'status', finished=finished) }}
{% endif %}
{% if current_user.has_permissions(ServicePermission.SEND_MESSAGES) and current_user.has_permissions('view_activity') and template.template_type == 'sms' and can_receive_inbound %}
{% if current_user.has_permissions(ServicePermission.SEND_MESSAGES) and current_user.has_permissions(ServicePermission.VIEW_ACTIVITY) and template.template_type == 'sms' and can_receive_inbound %}
<p>
<a class="usa-link" href="{{ url_for('.conversation', service_id=current_service.id, notification_id=notification_id, _anchor='n{}'.format(notification_id)) }}">See all text messages sent to this phone number</a>
</p>