diff --git a/app/assets/stylesheets/components/pill.scss b/app/assets/stylesheets/components/pill.scss index 224a56d98..056f38a4b 100644 --- a/app/assets/stylesheets/components/pill.scss +++ b/app/assets/stylesheets/components/pill.scss @@ -2,24 +2,19 @@ display: flex; + li { + width: 25%; + flex-grow: 1; + text-align: left; + } + a, span { display: block; - width: 25%; - box-sizing: border-box; float: left; + box-sizing: border-box; + width: 100%; padding: 10px; - flex-grow: 1; - text-align: left; - - &:first-child { - margin-left: 0; - } - - &:last-child { - margin-right: 0; - } - } a { @@ -56,6 +51,12 @@ position: relative; z-index: 1000; color: $text-colour; + + &:focus { + z-index: 10; + outline: 3px solid $yellow; + } + } } diff --git a/app/templates/components/pill.html b/app/templates/components/pill.html index c77810e5c..498c32bd5 100644 --- a/app/templates/components/pill.html +++ b/app/templates/components/pill.html @@ -1,26 +1,27 @@ {% from 'components/big-number.html' import big_number %} {% macro pill( - title, items=[], current_value=None, big_number_args={'smaller': True} ) %} - + {% endmacro %} diff --git a/app/templates/partials/jobs/count.html b/app/templates/partials/jobs/count.html index 78003a22e..eb2990161 100644 --- a/app/templates/partials/jobs/count.html +++ b/app/templates/partials/jobs/count.html @@ -1,5 +1,5 @@ {% from "components/pill.html" import pill %}
diff --git a/app/templates/views/activity/counts.html b/app/templates/views/activity/counts.html index b396bb064..b73738966 100644 --- a/app/templates/views/activity/counts.html +++ b/app/templates/views/activity/counts.html @@ -2,7 +2,6 @@
diff --git a/tests/app/main/views/test_dashboard.py b/tests/app/main/views/test_dashboard.py index bd2b4b895..8f55970c6 100644 --- a/tests/app/main/views/test_dashboard.py +++ b/tests/app/main/views/test_dashboard.py @@ -250,11 +250,11 @@ def test_usage_page( page = BeautifulSoup(response.data.decode('utf-8'), 'html.parser') cols = page.find_all('div', {'class': 'column-half'}) - nav = page.find('nav', {'class': 'pill'}) + nav = page.find('ul', {'class': 'pill', 'role': 'tablist'}) nav_links = nav.find_all('a') assert normalize_spaces(nav_links[0].text) == '2010 to 2011 financial year' - assert normalize_spaces(nav.find('span').text) == '2011 to 2012 financial year' + assert normalize_spaces(nav.find('li', {'aria-selected': 'true'}).text) == '2011 to 2012 financial year' assert normalize_spaces(nav_links[1].text) == '2012 to 2013 financial year' assert '123' in cols[0].text