From 451fadb1b3d5ff14ab5d1bca8a07b8c36d59b9fc Mon Sep 17 00:00:00 2001 From: Chris Hill-Scott Date: Sun, 9 Jun 2019 11:31:47 +0100 Subject: [PATCH] Hide H1 for grid layout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With the `

`s on this page it’s fairly explicit what the page is listing, so user doesn’t need the context provided by the `

`. --- app/assets/stylesheets/_grids.scss | 5 +++ .../stylesheets/components/browse-list.scss | 3 +- app/models/user.py | 8 +++++ app/templates/views/choose-account.html | 33 ++++++++++++++++--- 4 files changed, 43 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/_grids.scss b/app/assets/stylesheets/_grids.scss index fd6d38bee..48c1b60aa 100644 --- a/app/assets/stylesheets/_grids.scss +++ b/app/assets/stylesheets/_grids.scss @@ -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; diff --git a/app/assets/stylesheets/components/browse-list.scss b/app/assets/stylesheets/components/browse-list.scss index 95128534f..bc63bd9a6 100644 --- a/app/assets/stylesheets/components/browse-list.scss +++ b/app/assets/stylesheets/components/browse-list.scss @@ -37,6 +37,7 @@ &-hint { @include core-19; - margin-top: 5px; + margin: 5px 0 10px 0; + color: $secondary-text-colour; } } diff --git a/app/models/user.py b/app/models/user.py index 9c03ceab6..3ffe5b076 100644 --- a/app/models/user.py +++ b/app/models/user.py @@ -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(( diff --git a/app/templates/views/choose-account.html b/app/templates/views/choose-account.html index 34cb581bc..85f13290e 100644 --- a/app/templates/views/choose-account.html +++ b/app/templates/views/choose-account.html @@ -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 %}
@@ -34,6 +39,11 @@ {% else %} {% endif %} + {% if show_add_service_button %} + + {% endif %}
{% endmacro %} @@ -43,10 +53,11 @@ {% block maincolumn_content %} -

+

Choose service

-

-
+
+
{% endif %} @@ -88,9 +99,21 @@ {% endif %} + {% if can_add_service %}
+ {% if current_user.has_multiple_services_or_organisations %} +
+
+   +
+
+ {% endif %} Add a new service + {% if current_user.has_multiple_services_or_organisations %} +
+
+ {% endif %}
{% endif %}