Merge branch 'master' into flexible-data-retention

This commit is contained in:
Rebecca Law
2018-08-06 15:37:11 +01:00
70 changed files with 1378 additions and 363 deletions

View File

@@ -109,9 +109,9 @@
{% block footer_support_links %}
<nav class="footer-nav">
Built by the <a href="https://www.gov.uk/government/organisations/government-digital-service">Government Digital Service</a>
<a href="{{ url_for("main.privacy") }}">Privacy</a>
<a href="{{ url_for("main.privacy") }}">Privacy</a>
<a href="{{ url_for("main.cookies") }}">Cookies</a>
{% if current_service.research_mode %}
{% if current_service and current_service.research_mode %}
<span id="research-mode" class="research-mode">research mode</span>
{% endif %}
</nav>
@@ -128,10 +128,7 @@
ga('set', 'anonymizeIp', true);
ga('set', 'displayFeaturesTask', null);
ga('set', 'transport', 'beacon');
// strip UUIDs
page = (window.location.pathname + window.location.search).replace(
/[a-f0-9]{8}-?[a-f0-9]{4}-?4[a-f0-9]{3}-?[89ab][a-f0-9]{3}-?[a-f0-9]{12}/g, '…'
)
ga('send', 'pageview', page);
page = window.location.pathname + window.location.search;
ga('send', 'pageview', stripUUIDs(page));
</script>
{% endblock %}

View File

@@ -20,10 +20,11 @@
{% else %}
<nav class="navigation">
<ul>
<li><a href="{{ url_for('.choose_template', service_id=current_service.id) }}" {{ casework_navigation.is_selected('send-one-off') }}>Send a message</a></li>
</ul>
<ul>
<li><a href="{{ url_for('.choose_template', service_id=current_service.id) }}" {{ casework_navigation.is_selected('send-one-off') }}>Templates</a></li>
<li><a href="{{ url_for('.view_notifications', service_id=current_service.id, status='sending,delivered,failed') }}" {{ casework_navigation.is_selected('sent-messages') }}>Sent messages</a></li>
{% if current_service.has_jobs() %}
<li><a href="{{ url_for('.view_jobs', service_id=current_service.id) }}" {{ casework_navigation.is_selected('uploaded-files') }}>Uploaded files</a></li>
{% endif %}
</ul>
</nav>

View File

@@ -27,7 +27,7 @@
smaller=smaller_font_size
) }}
</div>
{% if 'letter' in current_service['permissions'] %}
{% if current_service.has_permission('letter') %}
<div id="total-letters" class="{{column_width}}">
{{ big_number_with_status(
statistics['letter']['requested'],

View File

@@ -5,12 +5,14 @@
<div class="ajax-block-container">
{% if scheduled_jobs %}
<div class='dashboard-table'>
<h2 class="heading-medium">
In the next few days
</h2>
{% if not hide_heading %}
<h2 class="heading-medium">
In the next few days
</h2>
{% endif %}
{% call(item, row_number) list_table(
scheduled_jobs,
caption="In the next 24 hours",
caption="In the next few days",
caption_visible=False,
empty_message='Nothing to see here',
field_headings=[

View File

@@ -0,0 +1,51 @@
{% extends "views/platform-admin/_base_template.html" %}
{% from "components/page-footer.html" import page_footer %}
{% block per_page_title %}
Find users by email
{% endblock %}
{% block platform_admin_content %}
<h1 class="heading-large">
Find users by email
</h1>
<form
method="post"
action="{{ url_for('.find_users_by_email') }}"
class="grid-row"
>
<div class="column-three-quarters">
{{ textbox(
form.search,
width='1-1',
label='Find users by email, or by partial email'
) }}
</div>
<div class="column-one-quarter align-button-with-textbox">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
<button type="submit" class="button">Search</button>
</div>
</form>
<form id="search-form" method="post">
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}">
</form>
{% if users_found %}
<nav class="browse-list">
<ul>
{% for user in users_found %}
<li class="browse-list-item">
<a href="{{url_for('.user_information', user_id=user.id)}}" class="browse-list-link">{{ user.email_address }}</a>
<p class="browse-list-hint">{{ user.name }}</p>
</li>
<hr>
{% endfor %}
</ul>
</nav>
{% elif users_found == [] %}
<p class="browse-list-hint">No users found.</p>
{% endif %}
{% endblock %}

View File

@@ -0,0 +1,43 @@
{% extends "views/platform-admin/_base_template.html" %}
{% from "components/page-footer.html" import page_footer %}
{% block per_page_title %}
User information for {{ user.name }}
{% endblock %}
{% block platform_admin_content %}
<div class="grid-row bottom-gutter">
<div class="column-whole">
<h1 class="heading-large">
{{ user.name }}
</h1>
<p>{{ user.email_address }}</p>
<p>{{ user.mobile_number }}</p>
<h2 class="heading-medium">Services</h2>
<nav class="browse-list">
<ul>
{% for service in services %}
<li class="browse-list-item">
<a class="browse-list-hint" href={{url_for('.service_dashboard', service_id=service.id)}}>{{ service.name }}</a>
</li>
{% endfor %}
</ul>
</nav>
<h2 class="heading-medium">Last login</h2>
{% if not user.logged_in_at %}
<p>This person has never logged in</p>
{% else %}
<p>Last logged in
<time class="timeago" datetime="{{ user.logged_in_at }}">
{{ user.logged_in_at|format_delta }}
</time>
</p>
{% endif %}
{% if user.failed_login_count > 0 %}
<p style="color:#b10e1e;">
{{ user.failed_login_count }} failed login attempts
</p>
{% endif %}
</div>
</div>
{% endblock %}

View File

@@ -8,6 +8,7 @@
{% block maincolumn_content %}
<h1 class="heading-large">Uploaded files</h1>
<div class="dashboard">
{{ scheduled_jobs|safe }}
{% include 'views/dashboard/_jobs.html' %}
{{ previous_next_navigation(prev_page, next_page) }}
</div>

View File

@@ -92,7 +92,7 @@
'Basic view'
) }}
{% endif %}
{% if 'email_auth' in current_service['permissions'] %}
{% if current_service.has_permission('email_auth') %}
<div class="tick-cross-list-hint">
{% if user.auth_type == 'sms_auth' %}
Signs in with a text message code

View File

@@ -8,8 +8,8 @@
<div class="bottom-gutter-1-3">
{{ radio(option, option_hints={
'admin': 'See dashboard and team members',
'caseworker': 'Send messages and see sent messages'
'admin': 'Show dashboard and other options',
'caseworker': 'Send messages, hide dashboard and other options'
}) }}
</div>
{% if option.data == 'admin' %}

View File

@@ -4,16 +4,20 @@
{% from "components/page-footer.html" import page_footer %}
{% from "components/textbox.html" import textbox %}
{% set page_title = (
message_count_label(99, message_type, suffix='') | capitalize
if current_user.has_permissions('view_activity')
else 'Sent messages'
) %}
{% block service_page_title %}
{{ message_count_label(99, message_type, suffix='') | capitalize }}
{{ page_title }}
{% endblock %}
{% block maincolumn_content %}
<h1 class="heading-large">
{% if not current_user.has_permissions('view_activity') %}<span class="visually-hidden">{% endif %}
{{ message_count_label(99, message_type, suffix='') | capitalize }}
{% if not current_user.has_permissions('view_activity') %}</span>{% endif %}
{{ page_title }}
</h1>
{% if not message_type == "letter" %}

View File

@@ -20,6 +20,7 @@
('Email branding', url_for('main.email_branding')),
('Letter jobs', url_for('main.letter_jobs')),
('Inbound SMS numbers', url_for('main.inbound_sms_admin')),
('Find users by email', url_for('main.find_users_by_email')),
('Email Complaints', url_for('main.platform_admin_list_complaints'))
] %}
<li>

View File

@@ -9,18 +9,25 @@
{% block maincolumn_content %}
<div class="grid-row">
<form method="post" class="column-five-sixths">
<form
method="post"
class="column-five-sixths"
data-module="track-form-submission"
>
<h1 class="heading-large">Basic view</h1>
<p>
Basic view lets you restrict a team member to only:
Hide the dashboard and other options from team members who only need to send messages.
</p>
<p>
Turn on basic view then edit team members permissions.
</p>
<p>
Team members with basic view can only:
</p>
<ul class="list list-bullet">
<li>send messages</li>
<li>see sent messages</li>
<li>send messages using existing templates</li>
<li>see a list of sent messages</li>
</ul>
<p>
Youll get to choose which team members have basic view.
</p>
<p>
<a href="{{ url_for('main.preview_basic_view', service_id=current_service.id) }}">See a preview of basic view</a>.
</p>

View File

@@ -120,12 +120,12 @@
<div class="grid-row bottom-gutter">
<div class="column-half">
<h3 class="visually-hidden">Services</h3>
<div class="product-page-big-number">292</div>
<div class="product-page-big-number">308</div>
services
</div>
<div class="column-half">
<h3 class="visually-hidden">Organisations</h3>
<div class="product-page-big-number">96</div>
<div class="product-page-big-number">101</div>
organisations
</div>
</div>

View File

@@ -4,6 +4,8 @@
{% extends "withnav_template.html" %}
{% set page_title = 'Templates' %}
{% block service_page_title %}
{{ page_title }}
{% endblock %}

View File

@@ -0,0 +1,36 @@
{% from "components/message-count-label.html" import message_count_label %}
{% extends "withnav_template.html" %}
{% block service_page_title %}
Copy an existing template
{% endblock %}
{% block maincolumn_content %}
<div class="bottom-gutter-3-2">
<h1 class="heading-large">Copy an existing template</h1>
</div>
<nav>
{% for service in services %}
{% if service.templates and services|length > 1 %}
<h2 class="">
{{ service.name }}
</h2>
<div class="left-gutter-4-3 bottom-gutter-3-2">
{% endif %}
{% for template in service.templates %}
<h2 class="message-name">
<a href="{{ url_for('.copy_template', service_id=current_service.id, template_id=template.id, from_service=service.id) }}">{{ template.name }}</a>
</h2>
<p class="message-type">
{{ message_count_label(1, template.template_type, suffix='')|capitalize }} template
</p>
{% endfor %}
{% if service.templates %}
</div>
{% endif %}
{% endfor %}
</nav>
{% endblock %}

View File

@@ -10,7 +10,13 @@
<div class="navigation-service-name">
{{ current_service.name }}
{% if current_user.previewing_basic_view %}
<span class="navigation-service-basic-view-preview">Preview of basic view</span>
<span
class="navigation-service-basic-view-preview"
data-module="track-event"
data-event-category="basic-view"
data-event-action="preview"
data-event-label="{{ current_service.id }}"
>Preview of basic view</span>
<a class="navigation-service-basic-view-back-link" href="{{ url_for('main.service_set_basic_view', service_id=current_service.id)}}">Back to settings</a>
{% endif %}
</div>