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

124 lines
3.6 KiB
HTML
Raw Normal View History

{% extends "withoutnav_template.html" %}
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 %}
<div class="grid-row">
<div class="column-one-quarter">
<h2>
{{ heading }}
</h2>
</div>
<div class="column-three-quarters">
<ul>
{% else %}
<ul>
2019-06-07 10:16:21 +01:00
{% endif %}
{% for org in organisations %}
<li class="browse-list-item">
<a href="{{ url_for('.organisation_dashboard', org_id=org.id) }}" class="browse-list-link">{{ org.name }}</a>
<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 %}
<li class="browse-list-item">
<a href="{{ url_for('.service_dashboard', service_id=service.id) }}" class="browse-list-link">{{ service.name }}</a>
</li>
{% endfor %}
{% if show_heading %}
</ul>
</div>
</div>
{% else %}
</ul>
{% endif %}
2019-06-09 11:31:47 +01:00
{% if show_add_service_button %}
<div class="js-stick-at-bottom-when-scrolling">
<a href="{{ url_for('.add_service') }}" class="button-secondary">Add a new service</a>
</div>
{% 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-06-13 13:40:29 +01:00
<h1 class="heading-large {% if current_user.has_access_to_live_and_trial_mode_services %}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 %}
<div class="grid-row">
<div class="column-one-quarter">
<h2>
Platform admin
</h2>
</div>
2019-06-09 11:31:47 +01:00
<ul class="column-three-quarters">
<li class="browse-list-item">
<a href="{{ url_for('.organisations') }}" class="browse-list-link">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',
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
{% 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 %}
2019-06-09 11:31:47 +01:00
<div class="grid-row">
<div class="column-one-quarter">
&nbsp;
</div>
<div class="column-three-quarters">
{% endif %}
2019-04-30 11:32:36 +01:00
<a href="{{ url_for('.add_service') }}" class="button-secondary">Add a new service</a>
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 %}