Only show live services without an organisation

In reality we shouldn’t have any live services that don’t have an
organisation. But we probably do locally, in preview, etc., and we
shouldn’t lose a way of accessing them.
This commit is contained in:
Chris Hill-Scott
2019-06-07 10:07:14 +01:00
parent 3be1f79cf9
commit f774a10e3a
4 changed files with 33 additions and 26 deletions

View File

@@ -15,28 +15,26 @@
<li class="browse-list-item">
<a href="{{ url_for('.organisations') }}" class="browse-list-link">All organisations</a>
</li>
<div class="keyline-block"></div>
<div class ="keyline-block"></div>
{% endif %}
{% for org in current_user.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.live_services|length }}
live service{% if org.live_services|length != 1 %}s{% endif %}
</p>
</li>
<div class="keyline-block"></div>
{% endfor %}
{% if services_without_organisations %}
{% for item in services_without_organisations %}
{% if current_user.organisations %}
{% for org in current_user.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.live_services|length }}
live service{% if org.live_services|length != 1 %}s{% endif %}
</p>
</li>
<div class ="keyline-block"></div>
{% endfor %}
{% for item in current_user.live_services_not_belonging_to_users_organisations %}
<li class="browse-list-item">
<a href="{{ url_for('.service_dashboard', service_id=item.id) }}" class="browse-list-link">{{ item.name }}</a>
</li>
{% endfor %}
<div class="keyline-block"></div>
{% endif %}
{% if not current_user.organisations %}
{% if current_user.trial_mode_services %}
{% else %}
{% if current_user.trial_mode_services and current_user.live_services %}
</ul>
<h2 class="heading-small">
Live services