From 09baece2d2652051f3df345d545c2724521b4e30 Mon Sep 17 00:00:00 2001 From: Paulo Vareiro <58229468+paulovareiro29@users.noreply.github.com> Date: Thu, 5 Sep 2024 10:01:28 +0100 Subject: [PATCH] feat: STADTKLN-67 dataset detail page (#6) * feat: implement dataset page * feat: improvements on mobile * chore: remove dead code * chore: translation changes --- src/pages/dataset-detail.twig | 246 ------------------ src/pages/dataset.twig | 175 +++++++++++++ src/pages/overview.twig | 6 +- src/partials/base/b_card.twig | 4 +- src/partials/base/b_download.twig | 8 + src/partials/base/b_hero.twig | 3 + src/partials/base/b_highlight-teaser.twig | 2 +- .../content-layout/cl_card-showcase.twig | 6 +- .../content-layout/cl_dataset-hero.twig | 17 ++ .../content-layout/cl_section-header.twig | 2 +- src/styles/base/_index.scss | 1 + src/styles/base/_mixins.scss | 5 + src/styles/base/_theme.scss | 8 +- src/styles/components/_badge.scss | 30 +++ src/styles/components/_button.scss | 18 -- src/styles/components/_hero.scss | 31 +++ src/styles/components/_index.scss | 6 +- src/styles/components/_tile.scss | 2 + src/styles/styles.scss | 5 + src/styles/themes/default.css | 16 -- 20 files changed, 295 insertions(+), 296 deletions(-) delete mode 100644 src/pages/dataset-detail.twig create mode 100644 src/pages/dataset.twig create mode 100644 src/partials/base/b_download.twig create mode 100644 src/partials/base/b_hero.twig create mode 100644 src/partials/content-layout/cl_dataset-hero.twig create mode 100644 src/styles/base/_mixins.scss create mode 100644 src/styles/components/_badge.scss create mode 100644 src/styles/components/_hero.scss diff --git a/src/pages/dataset-detail.twig b/src/pages/dataset-detail.twig deleted file mode 100644 index 3cb0791..0000000 --- a/src/pages/dataset-detail.twig +++ /dev/null @@ -1,246 +0,0 @@ -{% extends 'layouts::base.twig' %} -{% set theme = 'default' %} - -{% block content %} - - -
-
-
-

Baumkataster Köln 2020

- SERIES -
- -
- -
-

Über diesen Datensatz

- -

- Aktualisierung: - 15.08.2022 -

-
- -
-
- Virtual Identity AG -
-

- Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et - dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet - clita kasd gubergren, no sea takimata sanctus. -

- {% - include 'partials::icon-link.twig' with { - href: '#', - text: 'Mehr', - icon: 'chevron-down' - } - %} -
-
- -
-
-

Dateien und Quellen

-
-
-
- -
-

Personal Planstellen Ordnungsamt Koeln CSV

-
- DOWNLOAD -
-
-
-
- -
-

Personal Planstellen Ordnungsamt Koeln JSON

-
- DOWNLOAD -
-
-
-
- -
-

Personal Planstellen Ordnungsamt Koeln XLSX

-
- DOWNLOAD -
-
-
-

Herausgeber

-
- Virtual Identity AG -
-
-
- -
-
-
-

Weitere Datensätze der Datenserie

- SERIES -
- -
- -

Baumkataster Köln 2019

-
-

- - JSON - PDF - -

-
- -
- -

Baumkataster Köln 2018

-
-

- - JSON - PDF - -

-
- - -
-
- -
-
-

Weitere Formate

- -

- Datensatz Inhalt: - - JSON - PDF - -

- -

- Datensatz Metadaten im DCAT-AP.de-Format: - - JSON - PDF - -

-
-
- -
-
-

Kategorien

- -

Lorem

-

Lorem

-

Lorem

-
-
- -
-
-

Zusätzliche Informationen

- -
-

Feldbeschreibung, e.g. "Veröffentlichungsdatum"

-

Wert, e.g. 2022-07-26

-
- -
-

Feldbeschreibung, e.g. "Veröffentlichungsdatum"

-

Wert, e.g. 2022-07-26

-
- -
-

Feldbeschreibung, e.g. "Veröffentlichungsdatum"

-

Wert, e.g. 2022-07-26

-
- -
-

Feldbeschreibung, e.g. "Veröffentlichungsdatum"

-

Wert, e.g. 2022-07-26

-
-
-
- -
-
-

DCAT-AP.de Datensatzinformation

- -
-

Feldbeschreibung, e.g. "Herausgeber"

-

Wert, e.g. Redaktion offenedaten-koeln

-
-
-
- -
-
-

Tags

- -
-

LOREM, LOREM, LOREM

-
-
-
- -
-
-
-
-

- -

-
-
-

- Haben Sie eine Frage oder Feedback zu diesem Datensatz? Wir freuen uns, von Ihnen zu hören und bemühen - uns, zeitnah zu antworten. Geben Sie Ihre Frage bitte in das Formular ein. -

- -
-
- - -
-
- - -
- -
-
-
-
-
-
-
-{% endblock %} diff --git a/src/pages/dataset.twig b/src/pages/dataset.twig new file mode 100644 index 0000000..1b3cce1 --- /dev/null +++ b/src/pages/dataset.twig @@ -0,0 +1,175 @@ +{% extends 'layouts::base.twig' %} +{% set theme = 'default' %} + +{% block content %} + {% + include 'partials::base/b_breadcrumbs.twig' with { + links: [ + { + href: './', + text: 'Startseite' + }, + { + href: './overview', + text: 'Daten' + }, + { + text: 'Dataset' + } + ] + } + %} + +
+
+
+

Baumkataster Köln 2020

+ SERIES +
+ +
+ +
+
+

Über diesen Datensatz

+ +

+ Aktualisierung: + 15.08.2022 +

+
+ +
+ +
+ {% include 'partials::content-layout/cl_dataset-hero.twig' %} +
+
+ +
+
+

Dateien und Quellen

+ +
+ {% + include 'partials::base/b_download.twig' with { + type: 'csv', + name: 'Personal Planstellen Ordnungsamt Koeln CSV' + } + %} + + {% + include 'partials::base/b_download.twig' with { + type: 'xml', + name: 'Personal Planstellen Ordnungsamt Koeln XML' + } + %} + + {% + include 'partials::base/b_download.twig' with { + type: 'xlsx', + name: 'Personal Planstellen Ordnungsamt Koeln XLSX' + } + %} +
+
+
+
+

Kategorien

+
+ +
+ Lorem + Lorem + Lorem +
+
+
+ +
+
+
+

Weitere Datensätze der Datenserie

+ SERIES +
+ +
+ {% for i in 0..2 %} + +

Baumkataster Köln 2018

+

+ Formate: + JSON + RDF +

+
+ {% endfor %} +
+ + +
+
+ +
+
+
+

Zusätzliche Informationen

+
+ +
+ {% for i in 0..3 %} +
+

Feldbeschreibung, e.g. "Veröffentlichungsdatum"

+

Wert, e.g. 2022-07-26

+
+ {% endfor %} +
+
+
+ +
+
+
+

Metadaten Formate

+ SERIE +
+ +
+ {% for i in 0..1 %} +
+

+ Datensatz Inhalt: + JSON + RDF +

+

+ Datensatz Metadaten im DCAT-AP.de-Format: + JSON + RDF + TTL +

+
+ {% endfor %} +
+
+
+ +
+
+
+

Tags

+
+ +
+ Lorem + Lorem + Lorem +
+
+
+{% endblock %} diff --git a/src/pages/overview.twig b/src/pages/overview.twig index 08ec6ce..7d846b6 100644 --- a/src/pages/overview.twig +++ b/src/pages/overview.twig @@ -176,7 +176,7 @@ {% include 'partials::base/b_card.twig' with { direction: 'horizontal', - href: './dataset-detail', + href: './dataset', title: 'Baumkataster Köln 2020', subtitle: 'Herausgeber: Stadt Köln', description: 'Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua.Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua.', @@ -187,7 +187,7 @@ {% include 'partials::base/b_card.twig' with { direction: 'horizontal', - href: './dataset-detail', + href: './dataset', title: 'Baumkataster Köln 2020', subtitle: 'Herausgeber: Stadt Köln', description: 'Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua.Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua.', @@ -213,7 +213,7 @@ {% include 'partials::base/b_card.twig' with { direction: 'horizontal', - href: './dataset-detail', + href: './dataset', title: 'Baumkataster Köln 2020', subtitle: 'Herausgeber: Stadt Köln', description: 'Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua.Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua.', diff --git a/src/partials/base/b_card.twig b/src/partials/base/b_card.twig index 44e191b..764a16e 100644 --- a/src/partials/base/b_card.twig +++ b/src/partials/base/b_card.twig @@ -14,7 +14,7 @@

{{ title }} {% if tag %} - {{ tag }} + {{ tag }} {% endif %}

{{ subtitle }}

@@ -25,7 +25,7 @@ {% if formats %}
{% for format in formats %} - {{ format | upper }} + {{ format | upper }} {% endfor %}
{% endif %} diff --git a/src/partials/base/b_download.twig b/src/partials/base/b_download.twig new file mode 100644 index 0000000..fc9a7f5 --- /dev/null +++ b/src/partials/base/b_download.twig @@ -0,0 +1,8 @@ +
+
+
{{ type }}
+

{{ name }}

+
+ + Herunterladen +
diff --git a/src/partials/base/b_hero.twig b/src/partials/base/b_hero.twig new file mode 100644 index 0000000..c4022ff --- /dev/null +++ b/src/partials/base/b_hero.twig @@ -0,0 +1,3 @@ +
+ {{ alt }} +
diff --git a/src/partials/base/b_highlight-teaser.twig b/src/partials/base/b_highlight-teaser.twig index f65bf20..4ee084b 100644 --- a/src/partials/base/b_highlight-teaser.twig +++ b/src/partials/base/b_highlight-teaser.twig @@ -9,7 +9,7 @@ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua...

- Weiterlesen + Weiterlesen diff --git a/src/partials/content-layout/cl_card-showcase.twig b/src/partials/content-layout/cl_card-showcase.twig index 846579e..1e09687 100644 --- a/src/partials/content-layout/cl_card-showcase.twig +++ b/src/partials/content-layout/cl_card-showcase.twig @@ -6,7 +6,7 @@ src: 'https://picsum.photos/960/540', alt: 'Virtual Identity AG' }, - 'href': './dataset-detail', + 'href': './dataset', 'title': 'Baumkataster Köln 2020', 'subtitle': 'Herausgeber: Stadt Köln', 'description': 'Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua...', @@ -23,7 +23,7 @@ src: 'https://picsum.photos/960/540', alt: 'Virtual Identity AG' }, - 'href': './dataset-detail', + 'href': './dataset', 'title': 'Baumkataster Köln 2020', 'subtitle': 'Herausgeber: Stadt Köln', 'description': 'Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua...', @@ -37,7 +37,7 @@ src: 'https://picsum.photos/960/540', alt: 'Virtual Identity AG' }, - 'href': './dataset-detail', + 'href': './dataset', 'title': 'Baumkataster Köln 2020', 'subtitle': 'Herausgeber: Stadt Köln', 'description': 'Lorem ipsum dolor sit amet, consetetur sadipscin invidunt ut labore et erat, sed diam voluptua...', diff --git a/src/partials/content-layout/cl_dataset-hero.twig b/src/partials/content-layout/cl_dataset-hero.twig new file mode 100644 index 0000000..a224794 --- /dev/null +++ b/src/partials/content-layout/cl_dataset-hero.twig @@ -0,0 +1,17 @@ +
+ {% + include 'partials::base/b_hero.twig' with { + src: 'https://picsum.photos/960/540', + alt: 'Stadt Koeln' + } + %} + +
+

+ Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et + dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita + kasd gubergren, no sea takimata sanctus. +

+ +
+
diff --git a/src/partials/content-layout/cl_section-header.twig b/src/partials/content-layout/cl_section-header.twig index 1122466..25ef302 100644 --- a/src/partials/content-layout/cl_section-header.twig +++ b/src/partials/content-layout/cl_section-header.twig @@ -2,7 +2,7 @@

{{ title }}

{% if link is defined %} -

+

{{ link.text }}

{% endif %} diff --git a/src/styles/base/_index.scss b/src/styles/base/_index.scss index e18d396..9fe2113 100644 --- a/src/styles/base/_index.scss +++ b/src/styles/base/_index.scss @@ -1,3 +1,4 @@ +@import 'mixins'; @import 'font'; @import 'theme'; @import 'positions'; diff --git a/src/styles/base/_mixins.scss b/src/styles/base/_mixins.scss new file mode 100644 index 0000000..91ef4c5 --- /dev/null +++ b/src/styles/base/_mixins.scss @@ -0,0 +1,5 @@ +@mixin device-without-touchscreen { + @media (any-pointer: fine) { + @content; + } +} diff --git a/src/styles/base/_theme.scss b/src/styles/base/_theme.scss index 47100b7..66dd4c1 100644 --- a/src/styles/base/_theme.scss +++ b/src/styles/base/_theme.scss @@ -2,9 +2,9 @@ color: var(--color-on-primary) !important; background-color: var(--primary) !important; --focus-ring-color: var(--color-on-primary); -} -.text-bg-secondary { - color: var(--color-on-secondary) !important; - background-color: var(--secondary) !important; + .btn-primary { + --btn-bg: var(--color-on-primary); + --btn-color: var(--primary); + } } diff --git a/src/styles/components/_badge.scss b/src/styles/components/_badge.scss new file mode 100644 index 0000000..42ae070 --- /dev/null +++ b/src/styles/components/_badge.scss @@ -0,0 +1,30 @@ +.badge { + font-weight: 400; + padding: 8px 16px; + font-size: 1rem; + line-height: 1.3; + + &.badge-small { + font-size: 0.9rem; + padding: 4px 8px; + } + + &.badge-large { + font-size: 1.25rem; + padding: 8px 16px; + } + + @each $breakpoint, $breakpoint-size in $grid-breakpoints { + @include media-breakpoint-up($breakpoint) { + &.badge-#{$breakpoint}-small { + font-size: 0.9rem; + padding: 4px 8px; + } + + &.badge-#{$breakpoint}-large { + font-size: 1.25rem; + padding: 8px 16px; + } + } + } +} diff --git a/src/styles/components/_button.scss b/src/styles/components/_button.scss index 1062854..3695a2e 100644 --- a/src/styles/components/_button.scss +++ b/src/styles/components/_button.scss @@ -37,21 +37,3 @@ --btn-disabled-color: var(--color-on-primary); --btn-disabled-border-color: var(--primary); } - -.btn-secondary { - --btn-bg: var(--secondary); - --btn-color: var(--color-on-secondary); - --btn-border-color: var(--secondary); - - --btn-hover-bg: var(--secondary-hover); - --btn-hover-color: var(--color-on-secondary); - --btn-hover-border-color: var(--secondary-hover); - - --btn-active-bg: var(--secondary-active); - --btn-active-color: var(--color-on-secondary); - --btn-active-border-color: var(--secondary-active); - - --btn-disabled-bg: var(--secondary); - --btn-disabled-color: var(--color-on-secondary); - --btn-disabled-border-color: var(--secondary); -} diff --git a/src/styles/components/_hero.scss b/src/styles/components/_hero.scss new file mode 100644 index 0000000..ab0e056 --- /dev/null +++ b/src/styles/components/_hero.scss @@ -0,0 +1,31 @@ +.hero { + --hero-overflow: 160px; + --hero-m-bottom: -10%; + + display: flex; + justify-content: center; + aspect-ratio: 4 / 3; + margin-bottom: var(--hero-m-bottom); + + @include media-breakpoint-up(md) { + aspect-ratio: 21 / 9; + } + + ~ * { + position: relative; + z-index: 10; + } + + > img { + margin: 0 calc(var(--hero-overflow) * -1); + object-fit: cover; + width: 100vw; + min-width: $body-min-width; + max-width: calc(100% + var(--hero-overflow) * 2); + + @include device-without-touchscreen { + $scrollbar-width: 15px; + width: calc(100vw - $scrollbar-width); + } + } +} diff --git a/src/styles/components/_index.scss b/src/styles/components/_index.scss index e685260..c005beb 100644 --- a/src/styles/components/_index.scss +++ b/src/styles/components/_index.scss @@ -1,7 +1,9 @@ @import 'header'; @import 'footer'; +@import 'badge'; @import 'button'; -@import 'link'; @import 'form'; -@import 'tile'; +@import 'hero'; +@import 'link'; @import 'pagination'; +@import 'tile'; diff --git a/src/styles/components/_tile.scss b/src/styles/components/_tile.scss index f811892..8f05adf 100644 --- a/src/styles/components/_tile.scss +++ b/src/styles/components/_tile.scss @@ -1,5 +1,6 @@ .tile { --tile-background: var(--secondary-bg); + --tile-border-color: var(--secondary-bg); --tile-color: var(--black); --tile-hover-background: var(--primary); --tile-hover-color: var(--white); @@ -21,6 +22,7 @@ > div { background-color: var(--tile-background); + border: 1px solid var(--tile-border-color); color: var(--tile-color); transition: background-color 0.15s, diff --git a/src/styles/styles.scss b/src/styles/styles.scss index 707f208..e344138 100644 --- a/src/styles/styles.scss +++ b/src/styles/styles.scss @@ -2,6 +2,7 @@ $prefix: ''; $enable-negative-margins: true; +$body-min-width: 375px; // Required @import 'bootstrap/scss/variables'; @@ -49,3 +50,7 @@ $enable-negative-margins: true; @import 'base'; @import 'components'; + +body { + min-width: $body-min-width; +} diff --git a/src/styles/themes/default.css b/src/styles/themes/default.css index 7b6ffc8..52637d0 100644 --- a/src/styles/themes/default.css +++ b/src/styles/themes/default.css @@ -11,14 +11,6 @@ --primary-active: #f23333; --primary-shadow-rgb: 203, 0, 0; --color-on-primary: #fff; - - --secondary: #fff; - --secondary-rgb: 255, 255, 255; - --secondary-hover: #e7e7e7; - --secondary-hover-rgb: 231, 231, 231; - --secondary-active: #e7e7e7; - --secondary-shadow-rgb: 203, 0, 0; - --color-on-secondary: #ef0000; } [data-bs-theme='dark'] { @@ -34,12 +26,4 @@ --primary-active: #f23333; --primary-shadow-rgb: 255, 255, 255; --color-on-primary: #fff; - - --secondary: #fff; - --secondary-rgb: 255, 255, 255; - --secondary-hover: #e7e7e7; - --secondary-hover-rgb: 231, 231, 231; - --secondary-active: #e7e7e7; - --secondary-shadow-rgb: 203, 0, 0; - --color-on-secondary: #ef0000; }