Hide H1 for grid layout

With the `<h2>`s on this page it’s fairly explicit what the page is
listing, so user doesn’t need the context provided by the `<h1>`.
This commit is contained in:
Chris Hill-Scott
2019-06-09 11:31:47 +01:00
parent 8b6b8c6165
commit 451fadb1b3
4 changed files with 43 additions and 6 deletions

View File

@@ -49,6 +49,11 @@
margin-top: $gutter / 3;
}
.top-gutter-2-3 {
@extend %top-gutter;
margin-top: $gutter * 2 / 3;
}
%bottom-gutter,
.bottom-gutter {
@extend %contain-floats;

View File

@@ -37,6 +37,7 @@
&-hint {
@include core-19;
margin-top: 5px;
margin: 5px 0 10px 0;
color: $secondary-text-colour;
}
}

View File

@@ -318,6 +318,14 @@ class User(JSONModel, UserMixin):
return 'nhs'
return None
@property
def has_multiple_services_or_organisations(self):
return (
self.organisations or self.live_services
) and (
self.trial_mode_services
)
@property
def has_nhs_email_address(self):
return self.email_address.lower().endswith((

View File

@@ -1,6 +1,11 @@
{% extends "withoutnav_template.html" %}
{% macro service_list(heading, show_heading, organisations=[], services=[]) %}
{% macro service_list(
heading,
show_heading,
organisations=[],
services=[]
) %}
{% if show_heading %}
<div class="grid-row">
<div class="column-one-quarter">
@@ -34,6 +39,11 @@
{% else %}
</ul>
{% endif %}
{% 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>
{% endmacro %}
@@ -43,10 +53,11 @@
{% block maincolumn_content %}
<h1 class="heading-large">
<h1 class="heading-large {% if current_user.has_multiple_services_or_organisations %}visually-hidden{% endif %}">
Choose service
</h1>
<nav class="browse-list">
<nav class="browse-list {% if current_user.has_multiple_services_or_organisations %}top-gutter-2-3{% endif %}">
{% if current_user.platform_admin %}
<div class="grid-row">
@@ -55,11 +66,11 @@
Platform admin
</h2>
</div>
<div class="column-three-quarters">
<ul class="column-three-quarters">
<li class="browse-list-item">
<a href="{{ url_for('.organisations') }}" class="browse-list-link">All organisations</a>
</li>
</div>
</ul>
</div>
<div class="keyline-block"></div>
{% endif %}
@@ -88,9 +99,21 @@
{% endif %}
</nav>
{% if can_add_service %}
<div class="js-stick-at-bottom-when-scrolling">
{% if current_user.has_multiple_services_or_organisations %}
<div class="grid-row">
<div class="column-one-quarter">
&nbsp;
</div>
<div class="column-three-quarters">
{% endif %}
<a href="{{ url_for('.add_service') }}" class="button-secondary">Add a new service</a>
{% if current_user.has_multiple_services_or_organisations %}
</div>
</div>
{% endif %}
</div>
{% endif %}