2024-04-24 12:31:00 -07:00
|
|
|
{% extends "base.html" %}
|
2023-08-30 11:07:38 -04:00
|
|
|
{% from "components/components/button/macro.njk" import usaButton %}
|
2016-01-13 14:43:21 +00:00
|
|
|
|
2019-06-09 11:31:47 +01:00
|
|
|
{% macro service_list(
|
|
|
|
|
heading,
|
|
|
|
|
show_heading,
|
2023-07-12 12:09:44 -04:00
|
|
|
organizations=[],
|
2019-06-09 11:31:47 +01:00
|
|
|
services=[]
|
|
|
|
|
) %}
|
2023-07-12 12:09:44 -04:00
|
|
|
{% if show_heading and (services or organizations) %}
|
2023-08-23 16:18:25 -04:00
|
|
|
<div class="grid-row">
|
|
|
|
|
<div class="grid-col-3">
|
2019-06-09 11:22:47 +01:00
|
|
|
<h2>
|
|
|
|
|
{{ heading }}
|
|
|
|
|
</h2>
|
|
|
|
|
</div>
|
2023-08-23 16:18:25 -04:00
|
|
|
<div class="grid-col-9">
|
2019-06-09 11:22:47 +01:00
|
|
|
<ul>
|
|
|
|
|
{% else %}
|
|
|
|
|
<ul>
|
2019-06-07 10:16:21 +01:00
|
|
|
{% endif %}
|
2023-07-12 12:09:44 -04:00
|
|
|
{% for org in organizations|sort %}
|
2019-06-07 10:16:21 +01:00
|
|
|
<li class="browse-list-item">
|
2023-07-12 12:09:44 -04:00
|
|
|
<a href="{{ url_for('.organization_dashboard', org_id=org.id) }}" class="usa-link">{{ 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 %}
|
2021-09-27 15:20:56 +01:00
|
|
|
{% for service in services|sort %}
|
2019-06-07 10:16:21 +01:00
|
|
|
<li class="browse-list-item">
|
2023-06-16 14:55:24 -04:00
|
|
|
<a href="{{ url_for('.service_dashboard', service_id=service.id) }}" class="usa-link">{{ service.name }}</a>
|
2019-06-07 10:16:21 +01:00
|
|
|
</li>
|
|
|
|
|
{% endfor %}
|
2023-07-12 12:09:44 -04:00
|
|
|
{% if show_heading and (services or organizations) %}
|
2019-06-09 11:22:47 +01:00
|
|
|
</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
|
|
|
|
2023-06-16 14:55:24 -04:00
|
|
|
<h1 class="heading-large {% if current_user.has_access_to_live_and_trial_mode_services %}usa-sr-only{% 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 %}
|
2023-08-23 16:18:25 -04:00
|
|
|
<div class="grid-row">
|
|
|
|
|
<div class="grid-col-3">
|
2019-06-09 11:22:47 +01:00
|
|
|
<h2>
|
|
|
|
|
Platform admin
|
|
|
|
|
</h2>
|
|
|
|
|
</div>
|
2023-08-23 16:18:25 -04:00
|
|
|
<ul class="grid-col-9">
|
2019-06-09 11:22:47 +01:00
|
|
|
<li class="browse-list-item">
|
2023-07-12 12:09:44 -04:00
|
|
|
<a href="{{ url_for('.organizations') }}" class="usa-link">All organizations</a>
|
2019-07-08 12:00:40 +01:00
|
|
|
<p class="browse-list-hint">
|
2023-07-12 12:09:44 -04:00
|
|
|
{{ org_count|format_thousands }} organizations, {{ live_service_count|format_thousands }} live services
|
2019-07-08 12:00:40 +01:00
|
|
|
</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 %}
|
|
|
|
|
|
2023-07-12 12:09:44 -04:00
|
|
|
{% if current_user.organizations %}
|
2019-06-07 10:16:21 +01:00
|
|
|
{{ 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,
|
2023-07-12 12:09:44 -04:00
|
|
|
organizations=current_user.organizations,
|
2021-03-16 15:34:35 +00:00
|
|
|
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',
|
2023-07-12 12:09:44 -04:00
|
|
|
show_heading=(current_user.organizations 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
|
|
|
|
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 %}
|
2023-08-23 16:18:25 -04:00
|
|
|
<div class="grid-row">
|
|
|
|
|
<div class="grid-col-3">
|
2019-06-09 11:31:47 +01:00
|
|
|
|
|
|
|
|
</div>
|
2023-08-23 16:18:25 -04:00
|
|
|
<div class="grid-col-9">
|
2019-06-09 11:31:47 +01:00
|
|
|
{% endif %}
|
2023-08-30 11:07:38 -04:00
|
|
|
{{ usaButton({
|
2020-01-30 14:01:13 +00:00
|
|
|
"element": "a",
|
|
|
|
|
"text": "Add a new service",
|
|
|
|
|
"href": url_for('.add_service'),
|
2023-06-08 13:12:00 -04:00
|
|
|
"classes": ""
|
2020-01-30 14:01:13 +00:00
|
|
|
}) }}
|
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 %}
|