Files
notifications-admin/app/templates/views/choose-account.html
T

125 lines
3.8 KiB
HTML
Raw Normal View History

{% extends "withoutnav_template.html" %}
{% 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=[]
) %}
2021-10-26 15:06:43 +01:00
{% if show_heading and (services or organisations) %}
2020-02-19 11:57:15 +00:00
<div class="govuk-grid-row">
<div class="govuk-grid-column-one-quarter">
<h2>
{{ heading }}
</h2>
</div>
<div class="govuk-grid-column-three-quarters">
<ul>
{% else %}
<ul>
2019-06-07 10:16:21 +01:00
{% endif %}
{% for org in organisations|sort %}
2019-06-07 10:16:21 +01:00
<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">
{{ 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|sort %}
2019-06-07 10:16:21 +01:00
<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 %}
2021-10-26 15:06:43 +01:00
{% if show_heading and (services or organisations) %}
</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 %}
Choose service
2016-01-13 14:43:21 +00:00
{% endblock %}
{% 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 %}">
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">
<div class="govuk-grid-column-one-quarter">
<h2>
Platform admin
</h2>
</div>
<ul class="govuk-grid-column-three-quarters">
<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>
<p class="browse-list-hint">
{{ org_count|format_thousands }} organisations, {{ live_service_count|format_thousands }} live services
</p>
</li>
2019-06-09 11:31:47 +01:00
</ul>
</div>
<div class="keyline-block"></div>
2019-06-07 10:16:21 +01:00
{% endif %}
{% if current_user.organisations %}
{{ service_list(
heading='Live services',
2021-10-26 15:06:43 +01:00
show_heading=current_user.trial_mode_services or current_user.platform_admin,
2019-06-07 10:16:21 +01:00
organisations=current_user.organisations,
services=current_user.live_services
2019-06-07 10:16:21 +01:00
) }}
{% else %}
{{ service_list(
heading='Live services',
2021-10-26 15:06:43 +01:00
show_heading=(current_user.trial_mode_services and current_user.live_services) or current_user.platform_admin,
2019-06-07 10:16:21 +01:00
services=current_user.live_services
) }}
{% endif %}
{% if current_user.trial_mode_services %}
{{ service_list(
heading='Trial mode services',
2021-10-26 15:06:43 +01:00
show_heading=(current_user.organisations or current_user.live_services or current_user.platform_admin),
2019-06-07 10:16:21 +01:00
services=current_user.trial_mode_services
) }}
{% endif %}
2019-06-07 09:07:11 +01:00
</nav>
2019-06-09 11:31:47 +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">
<div class="govuk-grid-column-one-quarter">
2019-06-09 11:31:47 +01:00
&nbsp;
</div>
<div class="govuk-grid-column-three-quarters">
2019-06-09 11:31:47 +01:00
{% endif %}
{{ 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>
{% endif %}
2016-01-13 14:43:21 +00:00
{% endblock %}