diff --git a/hub/static/css/_area.scss b/hub/static/css/_area.scss index 78025dca9..93e45010e 100644 --- a/hub/static/css/_area.scss +++ b/hub/static/css/_area.scss @@ -33,23 +33,100 @@ } } -.area-section { - padding-top: 4rem; // leave space for the sticky subnav when jumping to section +.area-tabs { + overflow-x: auto; + background: linear-gradient(0deg, var(--bs-border-color-translucent) 1px, transparent 1px); + + .nav { + --bs-nav-tabs-link-active-bg: var(--bs-light); + --bs-nav-tabs-border-color: var(--bs-border-color-translucent); + --bs-nav-tabs-link-active-border-color: var(--bs-nav-tabs-border-color) var(--bs-nav-tabs-border-color) var(--bs-light); + --bs-nav-link-padding-y: 1em; + --bs-nav-link-padding-x: 1.5em; + + flex-wrap: nowrap; + align-items: flex-end; + border-bottom: none; + } + + .nav-link { + margin-bottom: 0; + border-bottom: none; + white-space: nowrap; + + display: flex; + align-items: center; + flex-wrap: nowrap; + gap: map-get($spacers, 2); + + // TODO: Better :focus style + } +} + +.area-data-grid { + display: grid; + grid-gap: 1rem; + grid-template-columns: 1fr; + grid-auto-flow: row dense; + + @include media-breakpoint-up('md') { + grid-template-columns: repeat(2, 1fr); + grid-gap: $grid-gutter-width; + } @include media-breakpoint-up('lg') { - padding-top: 2rem; // no sticky subnav, but still want a bit of clear space below window top when jumping - margin-top: 2rem; // compensate for smaller padding, still want lots of space between sections + grid-template-columns: repeat(3, 1fr); } +} + +.area-data--sm { + grid-row: span 1; +} - &:first-child { - margin-top: -4rem; // don't want to see the padding, but still want it there when we jump +.area-data--md { + grid-row: span 2; +} - @include media-breakpoint-up('lg') { - margin-top: -2rem; +.area-data--lg { + grid-row: span 3; +} + +.area-data-more { + display: none; // will be shown later on + margin-top: map-get($spacers, 3); + + a { + display: flex; + align-items: center; + justify-content: center; + gap: map-get($spacers, 1); + border-radius: $border-radius; + background: rgba(#fff, 0.5); + border: 1px solid rgba(#000, 0.1); + padding: $card-spacer-y $card-spacer-x; + + &:hover, &:focus { + background: $card-bg; + border-color: $card-border-color; } } +} + +@each $tab in ("mp", "opinion", "place", "movement") { + .area-content[data-section="#{$tab}"] { + .area-section:not(##{$tab}), + .area-data-more { + display: none; + } + } +} + +.area-content[data-section="featured"] { + .area-data-more { + display: block; + } - .row .card + .card { - margin-top: var(--bs-gutter-y); // vertical space between cards in a column + .area-data-grid > :not(.area-data--featured) { + display: none; } } diff --git a/hub/static/css/_dataset-card.scss b/hub/static/css/_dataset-card.scss index 8f72100c3..fc693fa98 100644 --- a/hub/static/css/_dataset-card.scss +++ b/hub/static/css/_dataset-card.scss @@ -37,50 +37,61 @@ } } } -} - -.dataset-card--favourite { - .js-unfavourite-this-dataset { - display: block; - } - - .js-favourite-this-dataset { - display: none; - } -} -.dataset-card-header { - display: flex; - - h5 { - margin-bottom: 0; - margin-right: auto; - padding: var(--bs-card-spacer-y) 0 var(--bs-card-spacer-y) var(--bs-card-spacer-x); - - // If not followed by a favouriting control - &:last-child { - padding-right: var(--bs-card-spacer-x); + .card-header { + display: flex; + padding: var(--bs-card-spacer-y) var(--bs-card-spacer-x) 0; + border-bottom: none; + + h1, h2, h3, h4, h5 { + margin-bottom: 0; + margin-right: auto; + } + + form { + margin: calc(var(--bs-card-spacer-y) * -1) calc(var(--bs-card-spacer-x) * -1); + } + + button { + background: transparent; + border: none; + line-height: 1.25em; // match h5 + font-size: 1em; + color: $gray-500; + padding: var(--bs-card-spacer-y) var(--bs-card-spacer-x); + + &:focus { + color: inherit; + } + + &:hover { + color: $link-color; + } } } - button { - background: transparent; - border: none; - line-height: 1.25em; // match h5 - font-size: 1em; - color: $gray-500; - padding: var(--bs-card-spacer-y) var(--bs-card-spacer-x); + .card-footer { + color: $text-muted; + font-size: map-get($font-sizes, 8); - &:focus { + a { color: inherit; - } + text-decoration: none; - &:hover { - color: $link-color; + &:hover, &:focus { + color: $link-color; + text-decoration: underline; + } } } +} - & + .card-body { - padding-top: 0; +.dataset-card--favourite { + .js-unfavourite-this-dataset { + display: block; + } + + .js-favourite-this-dataset { + display: none; } } diff --git a/hub/static/css/_variables.scss b/hub/static/css/_variables.scss index 433a085ab..4e00f9c50 100644 --- a/hub/static/css/_variables.scss +++ b/hub/static/css/_variables.scss @@ -106,23 +106,8 @@ $link-hover-color: shift-color($link-color, $link-shade-percentage); // Grid breakpoints -$grid-breakpoints: ( - xs: 0, - sm: 576px, - md: 768px, - lg: 992px, - xl: 1200px -); - // Grid containers -$container-max-widths: ( - sm: 540px, - md: 720px, - lg: 960px, - xl: 1140px -); - // Grid columns // Container padding @@ -222,6 +207,9 @@ $navbar-light-toggler-icon-bg: url("data:image/svg+xml, \ No newline at end of file diff --git a/hub/templates/hub/includes/icons/share.html b/hub/templates/hub/includes/icons/share.html new file mode 100644 index 000000000..17e64204e --- /dev/null +++ b/hub/templates/hub/includes/icons/share.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/hub/templates/hub/new_area_page.html b/hub/templates/hub/new_area_page.html new file mode 100644 index 000000000..49200c0ee --- /dev/null +++ b/hub/templates/hub/new_area_page.html @@ -0,0 +1,760 @@ +{% extends 'hub/base.html' %} + +{% load humanize %} +{% load hub_filters %} + +{% block content %} + +
Current parliamentary constituency
+{{ mp.party }}
+ {% endif %} +Vote | +Position | +
---|---|
{{ vote.name }} | +{{ vote.vote }} | +
{{ item.name }} | +{{ item.position }} | +
+ {{ mp.mp_election_majority|intcomma }} +
++ {{ mp.mp_first_elected|naturalday:"jS M Y" }} +
+53%
+57% national average
+36%
+39% national average
+Party | +% | +Votes | +
---|---|---|
Conservative Party | +49% | +20488 | +
Labour Party | +40% | +16312 | +
Reform UK | +4% | +1749 | +
Liberal Democrats | +4% | +1525 | +
Other | +2% | +929 | +
Green Party of England and Wales | +1% | +596 | +
55%
+58% national average
+61%
+51.8% national average
+50%
+53.9% national average
+24.9%
+21.6% national average
+24.4%
+28.2% national average
+Status | +This area | +UK average | +
---|---|---|
Full-time students | +29.3% | +7.4% | +
Higher managerial, administrative and professional occupations | +10.5% | +12.9% | +
Intermediate occupations | +8.0% | +11.5% | +
Lower managerial, administrative and professional occupations | +15.3% | +19.9% | +
Lower supervisory and technical occupations | +3.3% | +5.5% | +
Never worked / long-term unemployed | +10.9% | +8.5% | +
Routine occupations | +9.4% | +12.2% | +
Semi-routine occupations | +7.8% | +11.5% | +
Small employers and own account workers | +5.5% | +10.6% | +
High
+Above average NO2
+High
+42% of this area is at high risk of flooding
+2
+Very deprived
+England
+242
+193 national average
+1551
+1468 national average
+4105
+9473 national average
+6
+4.3 national average
+3
+1
+Year | +Total events | +UK average | +
---|---|---|
2022 | +6 | +5 | +
2023 | +9 | +6 | +
5
+1.4 national average
+9
+2.3 national average
+0
+0.2 national average
+