Merge branch 'master' of https://github.com/alphagov/notifications-admin into vb-platform-admin-admin

This commit is contained in:
venusbb
2017-09-22 15:47:19 +01:00
15 changed files with 86 additions and 26 deletions

View File

@@ -87,6 +87,7 @@ class Config(object):
r"bl\.uk",
r"stfc\.ac\.uk",
r"wmfs\.net",
r"bbsrc\.ac\.uk",
]
LOGO_UPLOAD_BUCKET_NAME = 'public-logos-local'

View File

@@ -511,7 +511,8 @@ class ServiceBrandingOrg(Form):
choices=[
('govuk', 'GOV.UK only'),
('both', 'GOV.UK and organisation'),
('org', 'Organisation only')
('org', 'Organisation only'),
('org_banner', 'Organisation banner')
],
validators=[
DataRequired()

View File

@@ -13,11 +13,7 @@ from app.notify_client.api_key_api_client import KEY_TYPE_NORMAL, KEY_TYPE_TEST,
def api_integration(service_id):
return render_template(
'views/api/index.html',
api_notifications=notification_api_client.get_notifications_for_service(
service_id=service_id,
include_jobs=False,
include_from_test_key=True
)
api_notifications=notification_api_client.get_api_notifications_for_service(service_id)
)

View File

@@ -71,7 +71,9 @@ def manage_org(logo=None):
return redirect(
url_for('.manage_org', logo=upload_filename))
logo = persist_logo(logo, session["user_id"])
if logo:
logo = persist_logo(logo, session["user_id"])
delete_temp_files_created_by(session["user_id"])
if org:

View File

@@ -66,3 +66,14 @@ class NotificationApiClient(NotifyAdminAPIClient):
def get_notification(self, service_id, notification_id):
return self.get(url='/service/{}/notifications/{}'.format(service_id, notification_id))
def get_api_notifications_for_service(self, service_id):
ret = self.get_notifications_for_service(service_id, include_jobs=False, include_from_test_key=True)
return self.map_letters_to_accepted(ret)
@staticmethod
def map_letters_to_accepted(notifications):
for notification in notifications['notifications']:
if notification['notification_type'] == 'letter' and notification['status'] in ('created', 'sending'):
notification['status'] = 'accepted'
return notifications

View File

@@ -6,13 +6,12 @@
secondary_link=False,
secondary_link_text=None,
delete_link=False,
delete_link_text="delete",
button_disabled=False
delete_link_text="delete"
) %}
<div class="page-footer">
{% if button_text %}
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
<input type="submit" class="button{% if destructive %}-destructive{% endif %}" value="{{ button_text }}"{% if button_disabled %} disabled{% endif %}/>
<input type="submit" class="button{% if destructive %}-destructive{% endif %}" value="{{ button_text }}" />
{% endif %}
{% if back_link %}
<a class="page-footer-back-link" href="{{ back_link }}">{{ back_link_text }}</a>

View File

@@ -26,14 +26,13 @@
<form method="post">
<div class="form-group">
<div style='margin-top:15px;'>{{textbox(form.name)}}</div>
<div>{{textbox(form.colour, width='1-4')}}
<div>{{textbox(form.colour, width='1-4')}}
<span id='colour_span' style="background: {{ organisation.colour }}; {% if not organisation.colour %}visibility:hidden; {% endif %}border:1px black solid; width: 3px; height: 25px;position:absolute;margin-top:138px;margin-left:135px;display:block;"></span>
</div>
{{ page_footer(
'Save',
back_link=url_for('.organisations', organisation_id=organisation.id if organisation else 'None'),
back_link_text='Back to organisation selection',
button_disabled=True if not logo else False
) }}
</div>
</form>

View File

@@ -187,6 +187,8 @@
GOV.UK and {{ organisation.name if organisation else None }}
{% elif current_service.branding == 'org' %}
Only {{ organisation.name if organisation else None }}
{% elif current_service.branding == 'org_banner' %}
Only {{ organisation.name if organisation else None }} banner
{% endif %}
{% endcall %}
{{ edit_field('Change', url_for('.service_set_branding_and_org', service_id=current_service.id)) }}

View File

@@ -117,12 +117,12 @@
<div class="grid-row bottom-gutter">
<div class="column-half">
<h3 class="visually-hidden">Services</h3>
<div class="product-page-big-number">77</div>
<div class="product-page-big-number">79</div>
services
</div>
<div class="column-half">
<h3 class="visually-hidden">Departments</h3>
<div class="product-page-big-number">37</div>
<div class="product-page-big-number">38</div>
departments
</div>
</div>