Merge pull request #3054 from alphagov/remove-old-agreement-pages

Remove the user-specific agreement pages
This commit is contained in:
Chris Hill-Scott
2019-07-17 13:07:39 +01:00
committed by GitHub
16 changed files with 100 additions and 407 deletions

View File

@@ -6,28 +6,18 @@ from flask_login import current_user
from app import current_service
from app.main import main
from app.main.forms import AcceptAgreementForm
from app.main.views.sub_navigation_dictionaries import features_nav
from app.s3_client.s3_mou_client import get_mou
from app.utils import user_has_permissions, user_is_logged_in
@main.route('/agreement')
@user_is_logged_in
def agreement():
return render_template(
'views/agreement/{}.html'.format(current_user.default_organisation.as_jinja_template),
owner=current_user.default_organisation.name,
navigation_links=features_nav(),
)
from app.utils import user_has_permissions
@main.route('/services/<uuid:service_id>/agreement')
@user_has_permissions('manage_service')
def service_agreement(service_id):
return render_template(
'views/agreement/service-{}.html'.format(current_service.organisation.as_jinja_template),
owner=current_service.organisation.name,
)
if current_service.organisation.crown is None:
return render_template('views/agreement/service-agreement-choose.html')
if current_service.organisation.agreement_signed:
return render_template('views/agreement/service-agreement-signed.html')
return render_template('views/agreement/service-agreement.html')
@main.route('/services/<uuid:service_id>/agreement.pdf')
@@ -82,14 +72,6 @@ def service_confirm_agreement(service_id):
return render_template('views/agreement/agreement-confirm.html')
@main.route('/agreement.pdf')
@user_is_logged_in
def download_agreement():
return send_file(**get_mou(
current_user.default_organisation.crown_status_or_404
))
@main.route('/agreement/<variant>', endpoint='public_agreement')
@main.route('/agreement/<variant>.pdf', endpoint='public_download_agreement')
def public_agreement(variant):

View File

@@ -211,7 +211,9 @@ def submit_request_to_go_live(service_id):
service_name=current_service.name,
service_dashboard=url_for('main.service_dashboard', service_id=current_service.id, _external=True),
organisation_type=str(current_service.organisation_type).title(),
agreement=current_service.organisation.as_human_readable(current_user.email_domain),
agreement=current_service.organisation.as_agreement_statement_for_go_live_request(
current_user.email_domain
),
volume_email_formatted=format_thousands(current_service.volume_email),
volume_sms_formatted=format_thousands(current_service.volume_sms),
volume_letter_formatted=format_thousands(current_service.volume_letter),

View File

@@ -1,4 +1,4 @@
from flask import Markup, abort
from flask import abort
from werkzeug.utils import cached_property
from app.models import JSONModel, ModelList
@@ -71,7 +71,7 @@ class Organisation(JSONModel):
self.organisation_type = None
self.request_to_go_live_notes = None
def as_human_readable(self, fallback_domain):
def as_agreement_statement_for_go_live_request(self, fallback_domain):
if self.agreement_signed:
agreement_statement = 'Yes, on behalf of {}.'.format(self.name)
elif self.name:
@@ -98,52 +98,6 @@ class Organisation(JSONModel):
def as_info_for_branding_request(self, fallback_domain):
return self.name or 'Cant tell (domain is {})'.format(fallback_domain)
@property
def as_jinja_template(self):
if self.crown is None:
return 'agreement-choose'
if self.agreement_signed:
return 'agreement-signed'
return 'agreement'
def as_terms_of_use_paragraph(self, **kwargs):
return Markup(self._as_terms_of_use_paragraph(**kwargs))
def _as_terms_of_use_paragraph(self, terms_link, download_link, support_link, signed_in):
if not signed_in:
return ((
'{} <a href="{}">Sign in</a> to download a copy '
'or find out if one is already in place.'
).format(self._acceptance_required, terms_link))
if self.agreement_signed is None:
return ((
'{} <a href="{}">Download the agreement</a> or '
'<a href="{}">contact us</a> to find out if we already '
'have one in place with your organisation.'
).format(self._acceptance_required, download_link, support_link))
if self.agreement_signed is False:
return ((
'{} <a href="{}">Download a copy</a>.'
).format(self._acceptance_required, download_link))
return (
'Your organisation ({}) has already accepted the '
'GOV.UK&nbsp;Notify data sharing and financial '
'agreement.'.format(self.name)
)
@property
def _acceptance_required(self):
return (
'Your organisation {} must also accept our data sharing '
'and financial agreement.'.format(
'({})'.format(self.name) if self.name else '',
)
)
@property
def crown_status_or_404(self):
if self.crown is None:

View File

@@ -122,7 +122,6 @@ class HeaderNavigation(Navigation):
'add_organisation',
'add_service',
'add_service_template',
'agreement',
'api_callbacks',
'api_documentation',
'api_integration',
@@ -162,7 +161,6 @@ class HeaderNavigation(Navigation):
'delivery_and_failure',
'delivery_status_callback',
'design_content',
'download_agreement',
'download_notifications_csv',
'edit_data_retention',
'edit_organisation_agreement',
@@ -431,7 +429,6 @@ class MainNavigation(Navigation):
'add_data_retention',
'add_organisation',
'add_service',
'agreement',
'archive_service',
'archive_user',
'bat_phone',
@@ -459,7 +456,6 @@ class MainNavigation(Navigation):
'delivery_and_failure',
'design_content',
'documentation',
'download_agreement',
'download_notifications_csv',
'edit_data_retention',
'edit_organisation_agreement',
@@ -623,7 +619,6 @@ class CaseworkNavigation(Navigation):
'add_organisation',
'add_service',
'add_service_template',
'agreement',
'api_callbacks',
'api_documentation',
'api_integration',
@@ -674,7 +669,6 @@ class CaseworkNavigation(Navigation):
'delivery_status_callback',
'design_content',
'documentation',
'download_agreement',
'download_notifications_csv',
'edit_data_retention',
'edit_organisation_agreement',
@@ -911,7 +905,6 @@ class OrgNavigation(Navigation):
'add_organisation',
'add_service',
'add_service_template',
'agreement',
'api_callbacks',
'api_documentation',
'api_integration',
@@ -956,7 +949,6 @@ class OrgNavigation(Navigation):
'delivery_status_callback',
'design_content',
'documentation',
'download_agreement',
'download_notifications_csv',
'edit_data_retention',
'edit_provider',

View File

@@ -1,12 +0,0 @@
<p>
Before you can go live on GOV.UK Notify, your organisation needs to
accept to our data sharing and financial agreement.
</p>
<p>
There are different agreements for crown and non-crown organisations.
</p>
<p>
<a href="{{ url_for('main.support') }}">Get in touch</a> to tell us
whether or not you work for a crown organisation. If youre not sure
well help you work it out.
</p>

View File

@@ -1,8 +0,0 @@
<p>
Your organisation ({{ owner }}) has already accepted the GOV.UK
Notify data sharing and financial agreement. You can
<a href="{{ url_for('main.service_download_agreement', service_id=current_service.id) }}">download a copy</a>.
</p>
<p>
The agreement contains commercially sensitive information, so dont share it more widely than you need to.
</p>

View File

@@ -1,17 +0,0 @@
<p>
To use GOV.UK Notify your organisation ({{ current_service.organisation.name }}) must accept the GOV.UK Notify data sharing and financial agreement.
</p>
<p>
This agreement only needs to be accepted once and will then cover all Notify services from
{{ current_service.organisation.name }}.
</p>
<p>
It needs to be accepted by, or on behalf of someone who can sign contracts for your organisation.
</p>
<p>
<a href="{{ url_for('main.service_download_agreement', service_id=current_service.id) }}">Download a copy of the agreement</a>.
</p>
<p>
The agreement contains commercially sensitive information, so dont share it more widely than you need to.
</p>
<a href="{{ url_for('main.service_accept_agreement', service_id=current_service.id) }}" class="button">Continue</a>

View File

@@ -1,25 +0,0 @@
{% extends "withoutnav_template.html" %}
{% from "components/sub-navigation.html" import sub_navigation %}
{% block per_page_title %}
GOV.UK Notify data sharing and financial agreement
{% endblock %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-one-third">
{{ sub_navigation(navigation_links) }}
</div>
<div class="column-two-thirds">
<h1 class="heading-large">
GOV.UK Notify data sharing and financial agreement
</h1>
{% include 'views/agreement/_agreement-choose.html'%}
</div>
</div>
{% endblock %}

View File

@@ -1,25 +0,0 @@
{% extends "withoutnav_template.html" %}
{% from "components/sub-navigation.html" import sub_navigation %}
{% block per_page_title %}
GOV.UK Notify data sharing and financial agreement
{% endblock %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-one-third">
{{ sub_navigation(navigation_links) }}
</div>
<div class="column-two-thirds">
<h1 class="heading-large">
GOV.UK Notify data sharing and financial agreement
</h1>
{% include 'views/agreement/_agreement-signed.html' %}
</div>
</div>
{% endblock %}

View File

@@ -1,25 +0,0 @@
{% extends "withoutnav_template.html" %}
{% from "components/sub-navigation.html" import sub_navigation %}
{% block per_page_title %}
GOV.UK Notify data sharing and financial agreement
{% endblock %}
{% block maincolumn_content %}
<div class="grid-row">
<div class="column-one-third">
{{ sub_navigation(navigation_links) }}
</div>
<div class="column-two-thirds">
<h1 class="heading-large">
GOV.UK Notify data sharing and financial agreement
</h1>
{% include 'views/agreement/_agreement.html'%}
</div>
</div>
{% endblock %}

View File

@@ -15,7 +15,18 @@
back_link=url_for('main.request_to_go_live', service_id=current_service.id)
)}}
{% include 'views/agreement/_agreement-choose.html'%}
<p>
Before you can go live on GOV.UK Notify, your organisation needs to
accept to our data sharing and financial agreement.
</p>
<p>
There are different agreements for crown and non-crown organisations.
</p>
<p>
<a href="{{ url_for('main.support') }}">Get in touch</a> to tell us
whether or not you work for a crown organisation. If youre not sure
well help you work it out.
</p>
</div>
</div>

View File

@@ -15,7 +15,14 @@
back_link=url_for('main.request_to_go_live', service_id=current_service.id)
)}}
{% include 'views/agreement/_agreement-signed.html' %}
<p>
Your organisation ({{ current_service.organisation.name }}) has already accepted the GOV.UK
Notify data sharing and financial agreement. You can
<a href="{{ url_for('main.service_download_agreement', service_id=current_service.id) }}">download a copy</a>.
</p>
<p>
The agreement contains commercially sensitive information, so dont share it more widely than you need to.
</p>
</div>
</div>

View File

@@ -15,7 +15,23 @@
back_link=url_for('main.request_to_go_live', service_id=current_service.id)
)}}
{% include 'views/agreement/_agreement.html'%}
<p>
To use GOV.UK Notify your organisation ({{ current_service.organisation.name }}) must accept the GOV.UK Notify data sharing and financial agreement.
</p>
<p>
This agreement only needs to be accepted once and will then cover all Notify services from
{{ current_service.organisation.name }}.
</p>
<p>
It needs to be accepted by, or on behalf of someone who can sign contracts for your organisation.
</p>
<p>
<a href="{{ url_for('main.service_download_agreement', service_id=current_service.id) }}">Download a copy of the agreement</a>.
</p>
<p>
The agreement contains commercially sensitive information, so dont share it more widely than you need to.
</p>
<a href="{{ url_for('main.service_accept_agreement', service_id=current_service.id) }}" class="button">Continue</a>
</div>
</div>

View File

@@ -13,15 +13,6 @@
These terms apply to your services use of GOV.UK&nbsp;Notify. You must be the service manager to accept them.
</p>
<p>
{{ current_user.default_organisation.as_terms_of_use_paragraph(
terms_link=url_for('main.sign_in', next=url_for('main.terms')),
download_link=url_for('.agreement'),
support_link=url_for('.feedback', ticket_type='ask-question-give-feedback', body='agreement'),
signed_in=current_user.is_authenticated
)}}
</p>
<h2 class="heading-medium">When using Notify</h2>
<p>You must:</p>
<ul class="list list-bullet">