mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-24 16:24:08 -04:00
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:
@@ -4,7 +4,6 @@
|
|||||||
|
|
||||||
&-service {
|
&-service {
|
||||||
|
|
||||||
padding: 11px 0 9px 0;
|
|
||||||
border-bottom: 1px solid $border-colour;
|
border-bottom: 1px solid $border-colour;
|
||||||
margin: 0 0 10px;
|
margin: 0 0 10px;
|
||||||
position: relative;
|
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 {
|
&-organisation-link {
|
||||||
@include core-19;
|
@include core-19;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
@@ -60,6 +49,12 @@
|
|||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
font-weight: normal;
|
font-weight: normal;
|
||||||
text-decoration: none;
|
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 {
|
li {
|
||||||
|
|||||||
@@ -7,11 +7,10 @@
|
|||||||
{% block fullwidth_content %}
|
{% block fullwidth_content %}
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<div class="navigation-service">
|
<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">
|
<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 }}
|
{{ current_org.name }}
|
||||||
</div>
|
</div>
|
||||||
<a href="{{ url_for('main.choose_account') }}" class="navigation-service-switch">Switch service</a>
|
<a href="{{ url_for('main.choose_account') }}" class="navigation-service-switch">Switch service</a>
|
||||||
|
|||||||
@@ -12,9 +12,7 @@
|
|||||||
{% block fullwidth_content %}
|
{% block fullwidth_content %}
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<div class="navigation-service">
|
<div class="navigation-service">
|
||||||
<div class="navigation-service-name">
|
<a href="{{ url_for('.organisations') }}" class="navigation-service-back-to">All organisations</a>
|
||||||
<a href="{{ url_for('.organisations') }}">All organisations</a>
|
|
||||||
</div>
|
|
||||||
<a href="{{ url_for('main.choose_account') }}" class="navigation-service-switch">Switch service</a>
|
<a href="{{ url_for('main.choose_account') }}" class="navigation-service-switch">Switch service</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,7 @@
|
|||||||
{% if current_service.organisation_id %}
|
{% if current_service.organisation_id %}
|
||||||
{% if current_user.platform_admin or
|
{% if current_user.platform_admin or
|
||||||
(current_user.belongs_to_organisation(current_service.organisation_id) and current_service.live) %}
|
(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>
|
<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>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="navigation-service-name">
|
<div class="navigation-service-name">
|
||||||
|
|||||||
@@ -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)
|
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(
|
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)
|
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)
|
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(
|
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')
|
mocker.patch('app.models.service.Organisation')
|
||||||
|
|
||||||
page = client_request.get('main.service_dashboard', service_id=SERVICE_ONE_ID)
|
page = client_request.get('main.service_dashboard', service_id=SERVICE_ONE_ID)
|
||||||
|
assert page.select_one('.navigation-organisation-link')['href'] == url_for(
|
||||||
assert page.select('.navigation-breadcrumb')
|
'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(
|
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))
|
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')
|
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,
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user