Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions i18n/da.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Home": "Hjem",
"News": "Nyheder",
"News": "Arkiv",
"Dashboard": "instrumentbræt",
"Collection": "Emner",
"Tags": "Tags",
Expand All @@ -26,7 +26,7 @@
"Catalogue of datasets for a particular project or team, or on a particular theme, or as a very simple way to help people find and search your own published datasets.": "Du kan bruge CKAN Emner til at oprette og håndtere samlinger af datasæt. Dette kan være datasæt for et givent projekt eller team, efter et bestemt tema eller som en meget simpel måde at hjælpe folk med at finde og søge efter dine egne publicerede datasæt",
"Organizations": "Dataudstillere",
"title": "titel",
"Blog": "Nyheder",
"Blog": "Arkiv",
"More": "Læs mere",
"Page Not Found": "Siden blev ikke fundet",
"Not Found": "Ikke fundet",
Expand Down Expand Up @@ -54,12 +54,11 @@
"Groups": "Emner",
"Internationale spørgsmål": "Internationale spørgsmål",
"This is a preview version. There might be more data in the original version.": "Dette er eksempeldata. Klik på linket ovenfor for at hente alle.",
"View all news": "Se flere nyheder",
"View all news": "Se flere arkivindlæg",
"Featured blog posts": "Fremhævede indlæg",
"Calendar": "Calendar",
"Uncategorized": "Uncategorized",
"Use-case": "Use-case",
"Nyheder": "Nyheder",
"Use-cases": "Use-cases",
"At opendata.dk we use cookies to collect statistics and improve the website.": "På opendata.dk bruger vi cookies til at samle statistik og forbedre hjemmesiden.",
"You accept cookies by clicking further.": "Du accepterer cookies ved at klikke videre.",
Expand Down Expand Up @@ -90,7 +89,7 @@
"til udviklingen af Open Data DK og vind en sensor": "til udviklingen af Open Data DK og vind en sensor",
"Website navigation": "Webstedsnavigation",
"Blog posts": "Blogindlæg",
"Navigate to news": "Naviger til nyheder",
"Navigate to news": "Naviger til arkiv",
"Featured groups": "Udvalgte grupper",
"Skip to main content": "Gå til hovedindhold",
"Page found: elements.css": "Page found: elements.css",
Expand Down Expand Up @@ -145,7 +144,7 @@
"Subscribe to newsletter": "Tilmeld nyhedsbrev",
"Find more data at": "Find flere data på",
"Powered by": "Drevet af",
"About us": "Om os",
"About us": "Om",
"Association": "Foreningen",
"Cooperation partners": "Samarbejdspartnere",
"Datavejviser": "Datavejviser",
Expand All @@ -160,14 +159,14 @@
"research": "lab",
"Exhibition site for open public data that you can freely experiment with.": "Udstillingssted for åbne offentlige data som du frit kan eksperimentere med.",
"Find a dataset": "Find et datasæt",
"Blogs": "Nyheder",
"Blogs": "Arkiv",
"What is open data?": "Hvad er åbne data?",
"Apply data": "Anvend data",
"Display data": "Udstil data",
"Contact": "Kontakt",
"Availability statement": "Tilgængelighedserklæring",
"PAGE NOT FOUND: favicon.ico": "PAGE NOT FOUND: favicon.ico",
"Search news": "Søg i nyheder",
"Search news": "Søg i arkiv",
"Vejle": "Vejle",
"Kort": "Kort",
"RKSK": "RKSK",
Expand Down Expand Up @@ -308,5 +307,6 @@
"Temporal coverage start": "Dækningsperiode start",
"Temporal coverage end": "Dækningsperiode end",
"Temporal coverage": "Dækningsperiode",
"Planned availability": "Tilgængeligstype"
"Planned availability": "Tilgængeligstype",
"Accessibility statement": "Tilgængelighedserklæring"
}
3 changes: 2 additions & 1 deletion i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,5 +400,6 @@
"EuroGeographics Open Data Licence v.2022": "EuroGeographics Open Data Licence v.2022",
"GEOJSON": "GEOJSON",
"Open Data Commons Attribution License 1.0": "Open Data Commons Attribution License 1.0",
"JPEG": "JPEG"
"JPEG": "JPEG",
"Accessibility statement": "Accessibility statement"
}
1 change: 0 additions & 1 deletion i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
"Calendar": "Calendrier",
"Uncategorized": "Non classé",
"Use-case": "Cas d'utilisation",
"Nyheder": "Nyheder",
"Use-cases": "Cas d'utilisation",
"At opendata.dk we use cookies to collect statistics and improve the website.": "Chez opendata.dk, nous utilisons des cookies pour collecter des statistiques et améliorer le site Web.",
"You accept cookies by clicking further.": "Vous acceptez les cookies en cliquant plus loin.",
Expand Down
19 changes: 13 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ function getCurrentLocale(req) {
return currentLocale;
}

async function getSortedAboutPages(CmsModel) {
const pages = await CmsModel.getListOfPosts({ type: "page" });
return pages
.filter((p) => p.parent && p.parent.ID === 11)
.sort((a, b) => (b.menu_order || 0) - (a.menu_order || 0));
}

module.exports = function (app) {
const utils = app.get("utils");
const dms = app.get("dms");
Expand Down Expand Up @@ -49,9 +56,7 @@ module.exports = function (app) {

app.use(async (req, res, next) => {
// Get links for the navbar from CMS (WP)
res.locals.aboutPages = (
await CmsModel.getListOfPosts({ type: "page" })
).filter((page) => page.parent && page.parent.ID === 11);
res.locals.aboutPages = await getSortedAboutPages(CmsModel);
next();
});

Expand All @@ -65,9 +70,11 @@ module.exports = function (app) {
}

if (!res.locals.aboutPages) {
res.locals.aboutPages = (
await CmsModel.getListOfPosts({ type: "page" })
).filter((page) => page.parent && page.parent.ID === 11);
res.locals.aboutPages = await getSortedAboutPages(CmsModel);
}
for (let page of res.locals.aboutPages) {
console.log("About page:", page.title);
console.log("ORDER:", page.menu_order);
}
Comment on lines +75 to 78
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Remove debug console.log statements before merging.

The diagnostic logging on lines 76-77 appears to be for debugging purposes and should be removed before merging to production to avoid polluting console output.

Apply this diff to remove the debug statements:

     if (!res.locals.aboutPages) {
       res.locals.aboutPages = await getSortedAboutPages(CmsModel);
     }
-    for (let page of res.locals.aboutPages) {
-      console.log("About page:", page.title);
-      console.log("ORDER:", page.menu_order);
-    }
     // Add featured posts
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
for (let page of res.locals.aboutPages) {
console.log("About page:", page.title);
console.log("ORDER:", page.menu_order);
}
🤖 Prompt for AI Agents
In index.js around lines 75 to 78, the two console.log debug statements printing
"About page:" and "ORDER:" should be removed; delete those console.log lines so
the loop only performs its intended production work (no other changes), ensuring
no debug output remains before merging.

// Add featured posts
res.locals.featuredPosts = (
Expand Down
Binary file added public/img/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/os2-oddk.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/img/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/stylesheets/app.css

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions src/css/components/main-nav.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,7 @@
}

#nav-oddk-title {
width: 206px !important;
height: 16px !important;
min-width: 206px !important;
max-height: 38px !important;
}

#nav-search-mag-glass {
Expand Down
42 changes: 28 additions & 14 deletions views/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<header class="header-color" style="background-color: #f5f5f5;">
<div class="container mx-auto lg:flex justify-between items-center relative">
<a href="/" class="flex content-center items-center h-6 mr-16 p-gutter" aria-label="{{__('Navigate')}} {{__('Home')}}" id="nav-oddk-logo">
<img src="/static/img/logo.svg" alt="Open Data DK" id="nav-oddk-title"/>
<img src="/static/img/[email protected]" alt="OS2 logo" id="nav-oddk-title"/>
Comment on lines 35 to +36
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Remove duplicate IDs from header and footer logo sections.

Both the header logo (lines 35–36) and footer logo (lines 82–83) use identical IDs (id="nav-oddk-logo" and id="nav-oddk-title"). HTML IDs must be unique within a document, and duplicates will break CSS selectors, JavaScript queries, and accessibility features.

Apply this diff to make footer IDs unique:

                <div class="px-gutter md:p-gutter md:w-2/4">
                  <div>
-                    <a href="/" class="flex content-center items-center h-6 mr-16 p-gutter" aria-label="{{__('Navigate')}} {{__('Home')}}" id="nav-oddk-logo">
-                        <img src="/static/img/[email protected]" alt="OS2 logo" id="nav-oddk-title" />
+                    <a href="/" class="flex content-center items-center h-6 mr-16 p-gutter" aria-label="{{__('Navigate')}} {{__('Home')}}" id="footer-oddk-logo">
+                        <img src="/static/img/[email protected]" alt="OS2 logo" id="footer-oddk-title" />
                    </a>
                  </div>
                </div>

Also applies to: 82-83

🤖 Prompt for AI Agents
In views/base.html around lines 35-36 and 82-83 the header and footer use
duplicate IDs (nav-oddk-logo and nav-oddk-title); change the footer IDs to
unique names (for example nav-oddk-logo-footer and nav-oddk-title-footer) and
update any CSS or JS selectors that reference the old footer IDs to the new
names so IDs are unique in the document.

</a>

<button id="nav-toggle" class="absolute top-0 right-0 outline-none focus:outline-none focus:text-secondary lg:hidden invisible">
Expand All @@ -44,9 +44,6 @@

<nav class="main-nav mt-4 py-2 lg:my-2 right-0 z-10 lg:relative" aria-label="{{__('Website navigation')}}">
<ul class="lg:flex md:text-xl lg:text-2xl">
<li class="mt-1 mr-6">
<a class="text-white px-2 py-2 whitespace-no-wrap" target="_blank" href="https://www.survey-xact.dk/LinkCollector?key=X3LGR2APJJ15" style="background-color: #C82A0F; padding: 2px 12px 2px 12px;">{{__('Request data')}}</a>
</li>
<li class="main-nav_item lg:mx-3">
<a class="main-nav_link" href="/blog">{{__('News')}}</a>
</li>
Expand Down Expand Up @@ -80,18 +77,34 @@
<!-- Footer -->
<footer class="site-footer bg-primary text-white-75 mt-10 py-gutter text-sm">
<div class="container mx-auto md:flex md:justify-between">
<div class="px-gutter md:p-gutter md:w-1/3">
<div class="px-gutter md:p-gutter md:w-2/4">
<div>
<a href="/" class="flex content-center items-center h-6 mr-16 p-gutter" aria-label="{{__('Navigate')}} {{__('Home')}}" id="nav-oddk-logo">
<img src="/static/img/[email protected]" alt="OS2 logo" id="nav-oddk-title" />
</a>
</div>
</div>

<div class="px-gutter md:p-gutter md:w-1/4">
<div>
<p>
<span class="home-about-text" id="home-about-text-stacked-top">{{ __('About us') }}</span></br></br>
{# We're using dynamic about page links now. If this introduces issues, just uncomment the static ones below and remove the loop.
<a href="/hvad-er-open-data-dk" class="home-about-links">{{ __('What is Open Data DK?') }}</a></br>
<a href="/hvad-er-aabne-data" class="home-about-links">{{ __('What is open data?') }}</a></br>
<a href="/hvad-er-aabne-data" class="home-about-links">{{ __('What is open data?') }}</a></br>
<a href="/anvend-data" class="home-about-links">{{ __('Apply data') }}</a></br>
<a href="/udstil-data" class="home-about-links">{{ __('Display data') }}</a></br>
<a href="/udstil-data" class="home-about-links">{{ __('Display data') }}</a></br>#}
{% for page in aboutPages %}
{% if loop.index <= 4 %}
<a href="/{{ page.slug }}" class="home-about-links" aria-label="{{ page.title }}">{{ page.title }}</a><br>
{% endif %}
{% endfor %}
<a href="https://www.was.digst.dk/opendata-dk" class="home-about-links">{{ __('Accessibility statement') }}</a>
</p>
</div>
</div>

{# Partners section
<div class="px-gutter md:p-gutter md:w-1/3">
<div>
<p>
Expand All @@ -103,26 +116,27 @@
</p>
</div>
</div>
#}

<div class="px-gutter md:p-gutter md:w-1/3">
<div class="px-gutter md:p-gutter md:w-1/4">
<div>
<p>
<span class="home-about-text home-about-text-stacked">{{ __('Contact') }}</span></br></br>
<a href="mailto:[email protected]" class="home-about-links">[email protected]</a></br>
<a href="https://app.heyloyalty.com/subscribe/10738/3609" class="home-about-links">{{ __('Subscribe to our newsletter') }}</a>
<a href="mailto:[email protected]" class="home-about-links">[email protected]</a></br>
{#<a href="https://app.heyloyalty.com/subscribe/10738/3609" class="home-about-links">{{ __('Subscribe to our newsletter') }}</a>#}
</p>
<p class="home-about-text-address">Open Data DK<br>Hack Kampmanns Plads 2<br>8000 Aarhus C</p>
<a href="https://www.was.digst.dk/opendata-dk" class="home-about-links">{{ __('Availability statement') }}</a>
<p class="home-about-text-address">OS2 – Offentligt digitaliseringsfællesskab<br>c/o ITK, Aarhus Kommune<br>Hack Kampmanns Plads 2<br>8000 Aarhus C</p>
{#<a href="https://www.was.digst.dk/opendata-dk" class="home-about-links">{{ __('Availability statement') }}</a>#}
</div></br>

<ul class="flex">
{#<ul class="flex">
<li>
<a target="_blank" href="https://www.linkedin.com/company/open-data-dk" class="site-footer_link" aria-label="LinkedIn">
<svg class="social-svg" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--! Font Awesome Pro 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. --><path d="M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z"/>
</svg>
</a>
</li>
</ul>
</ul>#}

</div>
</div>
Expand Down
2 changes: 2 additions & 0 deletions views/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ <h2 class="home_h1" id="home-find-dataset-text">{{ __('Find a dataset') }} </h1>
</div>
</header>

{# Uncomment to re-enable the Blogs section on the home page
<h2 class="home_h1" id="blog-h1">{{ __('Blogs') }}</h2>
<section id="article-preview" class="md:flex md:-mx-gutter" aria-label="{{__('Blog posts')}}">
<div class="blog-posts-container">
Expand Down Expand Up @@ -168,6 +169,7 @@ <h1 class="article-preview_heading">
</div>
</section>
<!-- End of link to all news -->
#}

</div>
</main>
Expand Down