2016-02-01 12:15:38 +00:00
|
|
|
{% extends "withoutnav_template.html" %}
|
2020-01-30 14:01:13 +00:00
|
|
|
{% from "components/button/macro.njk" import govukButton %}
|
2016-01-13 14:43:21 +00:00
|
|
|
|
2019-06-09 11:31:47 +01:00
|
|
|
{% macro service_list(
|
|
|
|
|
heading,
|
|
|
|
|
show_heading,
|
|
|
|
|
organisations=[],
|
|
|
|
|
services=[]
|
|
|
|
|
) %}
|
2019-06-07 10:16:21 +01:00
|
|
|
{% if show_heading %}
|
2020-02-19 11:57:15 +00:00
|
|
|
<div class="govuk-grid-row">
|
2020-02-19 12:53:59 +00:00
|
|
|
<div class="govuk-grid-column-one-quarter">
|
2019-06-09 11:22:47 +01:00
|
|
|
<h2>
|
|
|
|
|
{{ heading }}
|
|
|
|
|
</h2>
|
|
|
|
|
</div>
|
2020-02-20 16:55:56 +00:00
|
|
|
<div class="govuk-grid-column-three-quarters">
|
2019-06-09 11:22:47 +01:00
|
|
|
<ul>
|
|
|
|
|
{% else %}
|
|
|
|
|
<ul>
|
2019-06-07 10:16:21 +01:00
|
|
|
{% endif %}
|
|
|
|
|
{% for org in organisations %}
|
|
|
|
|
<li class="browse-list-item">
|
2019-12-11 15:29:50 +00:00
|
|
|
<a href="{{ url_for('.organisation_dashboard', org_id=org.id) }}" class="govuk-link govuk-link--no-visited-state">{{ org.name }}</a>
|
2019-06-07 10:16:21 +01:00
|
|
|
<p class="browse-list-hint">
|
2019-06-12 12:09:26 +01:00
|
|
|
{{ org.count_of_live_services }}
|
|
|
|
|
live service{% if org.count_of_live_services != 1 %}s{% endif %}
|
2019-06-07 10:16:21 +01:00
|
|
|
</p>
|
|
|
|
|
</li>
|
|
|
|
|
{% endfor %}
|
|
|
|
|
{% for service in services %}
|
|
|
|
|
<li class="browse-list-item">
|
2019-12-11 15:29:50 +00:00
|
|
|
<a href="{{ url_for('.service_dashboard', service_id=service.id) }}" class="govuk-link govuk-link--no-visited-state">{{ service.name }}</a>
|
2019-06-07 10:16:21 +01:00
|
|
|
</li>
|
|
|
|
|
{% endfor %}
|
2019-06-09 11:22:47 +01:00
|
|
|
{% if show_heading %}
|
|
|
|
|
</ul>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{% else %}
|
|
|
|
|
</ul>
|
|
|
|
|
{% endif %}
|
|
|
|
|
<div class="keyline-block"></div>
|
2019-06-07 10:16:21 +01:00
|
|
|
{% endmacro %}
|
|
|
|
|
|
2017-02-13 10:45:15 +00:00
|
|
|
{% block per_page_title %}
|
2018-03-15 11:02:05 +00:00
|
|
|
Choose service
|
2016-01-13 14:43:21 +00:00
|
|
|
{% endblock %}
|
|
|
|
|
|
2016-02-01 12:15:38 +00:00
|
|
|
{% block maincolumn_content %}
|
2016-01-13 14:43:21 +00:00
|
|
|
|
2019-10-21 15:18:25 +01:00
|
|
|
<h1 class="heading-large {% if current_user.has_access_to_live_and_trial_mode_services %}govuk-visually-hidden{% endif %}">
|
2018-03-15 11:02:05 +00:00
|
|
|
Choose service
|
2016-01-13 14:43:21 +00:00
|
|
|
</h1>
|
2019-06-09 11:31:47 +01:00
|
|
|
|
2019-06-13 13:40:29 +01:00
|
|
|
<nav class="browse-list {% if current_user.has_access_to_live_and_trial_mode_services %}top-gutter-2-3{% endif %}">
|
2019-06-07 10:16:21 +01:00
|
|
|
|
|
|
|
|
{% if current_user.platform_admin %}
|
2020-02-19 11:57:15 +00:00
|
|
|
<div class="govuk-grid-row">
|
2020-02-19 12:53:59 +00:00
|
|
|
<div class="govuk-grid-column-one-quarter">
|
2019-06-09 11:22:47 +01:00
|
|
|
<h2>
|
|
|
|
|
Platform admin
|
|
|
|
|
</h2>
|
|
|
|
|
</div>
|
2020-02-20 16:55:56 +00:00
|
|
|
<ul class="govuk-grid-column-three-quarters">
|
2019-06-09 11:22:47 +01:00
|
|
|
<li class="browse-list-item">
|
2019-12-11 15:29:50 +00:00
|
|
|
<a href="{{ url_for('.organisations') }}" class="govuk-link govuk-link--no-visited-state">All organisations</a>
|
2019-07-08 12:00:40 +01:00
|
|
|
<p class="browse-list-hint">
|
|
|
|
|
{{ org_count|format_thousands }} organisations, {{ live_service_count|format_thousands }} live services
|
|
|
|
|
</p>
|
2019-06-09 11:22:47 +01:00
|
|
|
</li>
|
2019-06-09 11:31:47 +01:00
|
|
|
</ul>
|
2019-06-09 11:22:47 +01:00
|
|
|
</div>
|
|
|
|
|
<div class="keyline-block"></div>
|
2019-06-07 10:16:21 +01:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% if current_user.organisations %}
|
|
|
|
|
{{ service_list(
|
|
|
|
|
heading='Live services',
|
|
|
|
|
show_heading=current_user.trial_mode_services,
|
|
|
|
|
organisations=current_user.organisations,
|
|
|
|
|
services=current_user.live_services_not_belonging_to_users_organisations
|
|
|
|
|
) }}
|
|
|
|
|
{% else %}
|
|
|
|
|
{{ service_list(
|
|
|
|
|
heading='Live services',
|
|
|
|
|
show_heading=(current_user.trial_mode_services and current_user.live_services),
|
|
|
|
|
services=current_user.live_services
|
|
|
|
|
) }}
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
|
|
{% if current_user.trial_mode_services %}
|
|
|
|
|
{{ service_list(
|
|
|
|
|
heading='Trial mode services',
|
|
|
|
|
show_heading=(current_user.organisations or current_user.live_services),
|
|
|
|
|
services=current_user.trial_mode_services
|
|
|
|
|
) }}
|
|
|
|
|
{% endif %}
|
|
|
|
|
|
2019-06-07 09:07:11 +01:00
|
|
|
</nav>
|
2019-06-09 11:31:47 +01:00
|
|
|
|
2016-10-25 18:12:46 +01:00
|
|
|
{% if can_add_service %}
|
2019-04-30 11:32:36 +01:00
|
|
|
<div class="js-stick-at-bottom-when-scrolling">
|
2019-06-13 13:40:29 +01:00
|
|
|
{% if current_user.has_access_to_live_and_trial_mode_services %}
|
2020-02-19 11:57:15 +00:00
|
|
|
<div class="govuk-grid-row">
|
2020-02-19 12:53:59 +00:00
|
|
|
<div class="govuk-grid-column-one-quarter">
|
2019-06-09 11:31:47 +01:00
|
|
|
|
|
|
|
|
</div>
|
2020-02-20 16:55:56 +00:00
|
|
|
<div class="govuk-grid-column-three-quarters">
|
2019-06-09 11:31:47 +01:00
|
|
|
{% endif %}
|
2020-01-30 14:01:13 +00:00
|
|
|
{{ govukButton({
|
|
|
|
|
"element": "a",
|
|
|
|
|
"text": "Add a new service",
|
|
|
|
|
"href": url_for('.add_service'),
|
|
|
|
|
"classes": "govuk-button--secondary"
|
|
|
|
|
}) }}
|
2019-06-13 13:40:29 +01:00
|
|
|
{% if current_user.has_access_to_live_and_trial_mode_services %}
|
2019-06-09 11:31:47 +01:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{% endif %}
|
2019-04-30 11:32:36 +01:00
|
|
|
</div>
|
2016-10-25 18:12:46 +01:00
|
|
|
{% endif %}
|
2016-01-13 14:43:21 +00:00
|
|
|
|
|
|
|
|
{% endblock %}
|