Move the breadcrumb inside the link

Putting the background image on the preceding breadcrumb item will allow
us to replace it with a pseudo element in a subsequent commit.
This commit is contained in:
Chris Hill-Scott
2019-06-21 14:12:19 +01:00
parent 27f1eeca0b
commit 96bd0a55b2
5 changed files with 21 additions and 25 deletions

View File

@@ -4,7 +4,6 @@
&-service {
padding: 11px 0 9px 0;
border-bottom: 1px solid $border-colour;
margin: 0 0 10px;
position: relative;
@@ -41,16 +40,6 @@
}
&-breadcrumb {
display: inline-block;
width: 6px;
height: 11px;
margin: 0 5px;
background-image: file-url("separator-2x.png");
background-size: 6px 11px;
background-repeat: no-repeat;
}
&-organisation-link {
@include core-19;
display: inline-block;
@@ -60,6 +49,12 @@
text-overflow: ellipsis;
font-weight: normal;
text-decoration: none;
background-image: file-url("separator-2x.png");
background-size: 6px 11px;
background-repeat: no-repeat;
background-position: right 10px top 5px;
padding-right: 25px;
box-sizing: border-box;
}
li {

View File

@@ -7,11 +7,10 @@
{% block fullwidth_content %}
<div id="content">
<div class="navigation-service">
{% if current_user.platform_admin %}
<a href="{{ url_for('.organisations') }}" class="navigation-organisation-link">All organisations</a>
{% endif %}
<div class="navigation-service-name">
{% if current_user.platform_admin %}
<a href="{{ url_for('.organisations') }}">Organisations</a>
<span class="navigation-breadcrumb"></span>
{% endif %}
{{ current_org.name }}
</div>
<a href="{{ url_for('main.choose_account') }}" class="navigation-service-switch">Switch service</a>

View File

@@ -12,9 +12,7 @@
{% block fullwidth_content %}
<div id="content">
<div class="navigation-service">
<div class="navigation-service-name">
<a href="{{ url_for('.organisations') }}">All organisations</a>
</div>
<a href="{{ url_for('.organisations') }}" class="navigation-service-back-to">All organisations</a>
<a href="{{ url_for('main.choose_account') }}" class="navigation-service-switch">Switch service</a>
</div>

View File

@@ -10,8 +10,7 @@
{% if current_service.organisation_id %}
{% if current_user.platform_admin or
(current_user.belongs_to_organisation(current_service.organisation_id) and current_service.live) %}
<a href="{{ url_for('.organisation_dashboard', org_id=current_service.organisation.id) }}" class="navigation-organisation-link">{{ current_service.organisation.name }}</a>
<span class="navigation-breadcrumb"></span>
<a href="{{ url_for('.organisation_dashboard', org_id=current_service.organisation_id) }}" class="navigation-organisation-link">{{ current_service.organisation.name }}</a>
{% endif %}
{% endif %}
<div class="navigation-service-name">

View File

@@ -1346,7 +1346,7 @@ def test_org_breadcrumbs_do_not_show_if_service_has_no_org(
):
page = client_request.get('main.service_dashboard', service_id=SERVICE_ONE_ID)
assert not page.select('.navigation-breadcrumb')
assert not page.select('.navigation-organisation-link')
def test_org_breadcrumbs_do_not_show_if_user_is_not_an_org_member(
@@ -1369,7 +1369,7 @@ def test_org_breadcrumbs_do_not_show_if_user_is_not_an_org_member(
client_request.login(active_caseworking_user, service=service_one_json)
page = client_request.get('main.service_dashboard', service_id=SERVICE_ONE_ID, _follow_redirects=True)
assert not page.select('.navigation-breadcrumb')
assert not page.select('.navigation-organisation-link')
def test_org_breadcrumbs_show_if_user_is_a_member_of_the_services_org(
@@ -1391,8 +1391,10 @@ def test_org_breadcrumbs_show_if_user_is_a_member_of_the_services_org(
mocker.patch('app.models.service.Organisation')
page = client_request.get('main.service_dashboard', service_id=SERVICE_ONE_ID)
assert page.select('.navigation-breadcrumb')
assert page.select_one('.navigation-organisation-link')['href'] == url_for(
'main.organisation_dashboard',
org_id=ORGANISATION_ID,
)
def test_org_breadcrumbs_do_not_show_if_user_is_a_member_of_the_services_org_but_service_is_in_trial_mode(
@@ -1435,4 +1437,7 @@ def test_org_breadcrumbs_show_if_user_is_platform_admin(
response = logged_in_platform_admin_client.get(url_for('main.service_dashboard', service_id=SERVICE_ONE_ID))
page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser')
assert page.select('.navigation-breadcrumb')
assert page.select_one('.navigation-organisation-link')['href'] == url_for(
'main.organisation_dashboard',
org_id=ORGANISATION_ID,
)