Added current_service to flask context and template context.

Fix all tests and conflicts.

Removed comment line.
This commit is contained in:
Nicholas Staples
2016-04-04 16:53:52 +01:00
parent f444284580
commit c31c55666b
37 changed files with 207 additions and 202 deletions

View File

@@ -1,23 +1,22 @@
{% extends "withnav_template.html" %}
{% block page_title %}
{{ session.get('service_name', 'Dashboard') }} GOV.UK Notify
{{ current_service.name }} GOV.UK Notify
{% endblock %}
{% block maincolumn_content %}
{% if not templates and current_user.has_permissions(['send_texts', 'send_emails', 'send_letters'], any_=True) %}
{% include 'views/dashboard/get-started.html' %}
{% elif service.restricted %}
{% elif current_service.restricted %}
<div class="dashboard">
{% include 'views/dashboard/trial-mode-banner.html' %}
</div>
{% endif %}
<div
data-module="update-content"
data-resource="{{url_for(".service_dashboard_updates", service_id=service_id)}}"
data-resource="{{url_for(".service_dashboard_updates", service_id=current_service.id)}}"
data-key="today"
data-interval-seconds="10"
>

View File

@@ -4,12 +4,12 @@
{% call banner_wrapper(type='tour') %}
<h2 class="heading-large">Youre ready to get started</h2>
<p>
<a href='{{ url_for(".add_service_template", service_id=service_id, template_type="sms") }}'>
<a href='{{ url_for(".add_service_template", service_id=current_service.id, template_type="sms") }}'>
Set up a text message template
</a>
</p>
<p>
<a href='{{ url_for(".add_service_template", service_id=service_id, template_type="email") }}'>
<a href='{{ url_for(".add_service_template", service_id=current_service.id, template_type="email") }}'>
Set up an email template
</a>
</p>

View File

@@ -7,7 +7,7 @@
field_headings=['File', 'Started', right_aligned_field_heading('Rows')]
) %}
{% call field() %}
<a href="{{ url_for('.view_job', service_id=service_id, job_id=item.id) }}">{{ item.original_file_name }}</a>
<a href="{{ url_for('.view_job', service_id=current_service.id, job_id=item.id) }}">{{ item.original_file_name }}</a>
{% endcall %}
{% call field() %}
{{ item.created_at|format_datetime }}
@@ -19,7 +19,7 @@
{% if more_jobs_to_show %}
{% if current_user.has_permissions(['send_texts', 'send_emails', 'send_letters']) %}
<p class="table-show-more-link">
<a href="{{ url_for('.view_jobs', service_id=service_id) }}">See all sent batch messages</a>
<a href="{{ url_for('.view_jobs', service_id=current_service.id) }}">See all sent batch messages</a>
</p>
{% endif %}
{% endif %}