From 4210d6066c830964f26c70258b07fe75fb7335d7 Mon Sep 17 00:00:00 2001 From: vismayajochem Date: Wed, 15 Jul 2026 16:17:05 +0200 Subject: [PATCH 1/7] Create .md file #2382 --- .../static/release_info_startpage/release_v1.8.0 | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 dataedit/static/release_info_startpage/release_v1.8.0 diff --git a/dataedit/static/release_info_startpage/release_v1.8.0 b/dataedit/static/release_info_startpage/release_v1.8.0 new file mode 100644 index 000000000..f493c415d --- /dev/null +++ b/dataedit/static/release_info_startpage/release_v1.8.0 @@ -0,0 +1,16 @@ + + +### ✨ Highlights + +* **Redesigned Tables listings & Search:** Introduced a dedicated search field for user tables and reworked the table listing UI to display additional metadata directly on the table cards. +* **Updated OEO Viewer & Entity Pages:** Reorganized the OEO Viewer layout for better hierarchy and mobile responsiveness. Added a language toggle for English/German synonyms, automatic entity-type detection, and an updated Graph View widget that supports graph comparisons. +* **Scenario Comparison App (Prototype) Update:** Refactored the quantitative scenario comparison prototype to work with the updated OEKG and OEO. The app now uses E-Charts as its graph library. +* **Automated Metadata Syncing:** The metadata API now synchronizes the documented data schema in the metadata with the actual table schema available in the database. +* **Bug Fixes & General Improvements:** Fixed an issue in the oemetaBuilder tool that removed specific references on save, corrected the Reviewer & Contributor progress calculations to account for empty fields, and patched an OEO loading bug related to version 2.12.0. + +👉 **Check out the full changelog and explore what’s new!** +[Full Changelog](https://github.com/OpenEnergyPlatform/oeplatform/blob/master/versions/changelogs/1_8_0.md) From c8046d39336b53ee1372894b4cba77ed47ee7e63 Mon Sep 17 00:00:00 2001 From: vismayajochem Date: Mon, 20 Jul 2026 11:50:48 +0200 Subject: [PATCH 2/7] First try of implementing, not working #9 --- base/templates/base/index.html | 78 +++++++++++++++++++--------------- base/templatetags/base_tags.py | 18 ++++++++ 2 files changed, 61 insertions(+), 35 deletions(-) diff --git a/base/templates/base/index.html b/base/templates/base/index.html index 0972d3fbb..ca7d055a0 100644 --- a/base/templates/base/index.html +++ b/base/templates/base/index.html @@ -2,6 +2,7 @@ {% load django_bootstrap5 %} {% load static %} {% load compress %} +{% load base_tags %} {% block after-head %} {% compress css %} Academy style="font-size: 16px" href="{{ EXTERNAL_URLS.tutorials_index }}">Academy +
+ {% render_markdown 'startpage-info.md' %} +
+ + -
-
-
- - API - - Learn how to download and publish open data on the OEP using the - API. - - Learn more -
-
- - Open Science - - Good scientific practice needs open licenses for software, data and - content. - - Learn more -
-
- - Open Energy Community - - Collaborate and contribute to the development on GitHub. - - Learn - more -
+
+
+
+
+
+ + API + + Learn how to download and publish open data on the OEP using the + API. + + Learn more +
+
+ + Open Science + + Good scientific practice needs open licenses for software, data and + content. + + Learn more +
+
+ + Open Energy Community + + Collaborate and contribute to the development on GitHub. + + Learn + more
+
{% endblock %} diff --git a/base/templatetags/base_tags.py b/base/templatetags/base_tags.py index 4ff288fa8..119aa22f9 100644 --- a/base/templatetags/base_tags.py +++ b/base/templatetags/base_tags.py @@ -3,7 +3,11 @@ SPDX-License-Identifier: AGPL-3.0-or-later """ # noqa: 501 +import os + +import markdown2 from django import template +from django.utils.safestring import mark_safe register = template.Library() @@ -11,3 +15,17 @@ @register.filter(name="addclass") def addclass(field, css): return field.as_widget(attrs={"class": css}) + + +@register.simple_tag +def render_markdown(filename): + """Read a markdown file from static/content/ and render it as HTML.""" + base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) + md_path = os.path.join(base_dir, "static", "content", filename) + try: + with open(md_path, encoding="utf-8") as f: + content = f.read() + markdowner = markdown2.Markdown() + return mark_safe(markdowner.convert(content)) + except FileNotFoundError: + return "" From adfc96bbd84016dea4e7ccf10c1217572d1c5148 Mon Sep 17 00:00:00 2001 From: vismayajochem Date: Mon, 20 Jul 2026 11:58:50 +0200 Subject: [PATCH 3/7] Add css styles, rename to .md #2382 --- base/static/css/index-style.css | 14 ++++++++++ .../release_info_startpage/release_v1.8.0 | 16 ----------- .../release_info_startpage/release_v1.8.0.md | 28 +++++++++++++++++++ 3 files changed, 42 insertions(+), 16 deletions(-) delete mode 100644 dataedit/static/release_info_startpage/release_v1.8.0 create mode 100644 dataedit/static/release_info_startpage/release_v1.8.0.md diff --git a/base/static/css/index-style.css b/base/static/css/index-style.css index 21a19ea49..cf25f1d22 100644 --- a/base/static/css/index-style.css +++ b/base/static/css/index-style.css @@ -204,3 +204,17 @@ grid-template-rows: repeat(2, auto); } } + +.index-startpage-info { + padding: 2rem 0; + max-width: 900px; + margin: 0 auto; +} +.index-startpage-info h2 { + color: #333; + margin-top: 1.5rem; +} +.index-startpage-info p { + line-height: 1.6; + color: #555; +} diff --git a/dataedit/static/release_info_startpage/release_v1.8.0 b/dataedit/static/release_info_startpage/release_v1.8.0 deleted file mode 100644 index f493c415d..000000000 --- a/dataedit/static/release_info_startpage/release_v1.8.0 +++ /dev/null @@ -1,16 +0,0 @@ - - -### ✨ Highlights - -* **Redesigned Tables listings & Search:** Introduced a dedicated search field for user tables and reworked the table listing UI to display additional metadata directly on the table cards. -* **Updated OEO Viewer & Entity Pages:** Reorganized the OEO Viewer layout for better hierarchy and mobile responsiveness. Added a language toggle for English/German synonyms, automatic entity-type detection, and an updated Graph View widget that supports graph comparisons. -* **Scenario Comparison App (Prototype) Update:** Refactored the quantitative scenario comparison prototype to work with the updated OEKG and OEO. The app now uses E-Charts as its graph library. -* **Automated Metadata Syncing:** The metadata API now synchronizes the documented data schema in the metadata with the actual table schema available in the database. -* **Bug Fixes & General Improvements:** Fixed an issue in the oemetaBuilder tool that removed specific references on save, corrected the Reviewer & Contributor progress calculations to account for empty fields, and patched an OEO loading bug related to version 2.12.0. - -👉 **Check out the full changelog and explore what’s new!** -[Full Changelog](https://github.com/OpenEnergyPlatform/oeplatform/blob/master/versions/changelogs/1_8_0.md) diff --git a/dataedit/static/release_info_startpage/release_v1.8.0.md b/dataedit/static/release_info_startpage/release_v1.8.0.md new file mode 100644 index 000000000..650b912e8 --- /dev/null +++ b/dataedit/static/release_info_startpage/release_v1.8.0.md @@ -0,0 +1,28 @@ + + +### ✨ Highlights + +- **Redesigned Tables listings & Search:** Introduced a dedicated search field + for user tables and reworked the table listing UI to display additional + metadata directly on the table cards. +- **Updated OEO Viewer & Entity Pages:** Reorganized the OEO Viewer layout for + better hierarchy and mobile responsiveness. Added a language toggle for + English/German synonyms, automatic entity-type detection, and an updated Graph + View widget that supports graph comparisons. +- **Scenario Comparison App (Prototype) Update:** Refactored the quantitative + scenario comparison prototype to work with the updated OEKG and OEO. The app + now uses E-Charts as its graph library. +- **Automated Metadata Syncing:** The metadata API now synchronizes the + documented data schema in the metadata with the actual table schema available + in the database. +- **Bug Fixes & General Improvements:** Fixed an issue in the oemetaBuilder tool + that removed specific references on save, corrected the Reviewer & Contributor + progress calculations to account for empty fields, and patched an OEO loading + bug related to version 2.12.0. + +👉 **Check out the full changelog and explore what’s new!** +[Full Changelog](https://github.com/OpenEnergyPlatform/oeplatform/blob/master/versions/changelogs/1_8_0.md) From efcc765386ce853033ad7c0748a084c40ce7f9cc Mon Sep 17 00:00:00 2001 From: vismayajochem Date: Mon, 20 Jul 2026 12:51:04 +0200 Subject: [PATCH 4/7] Second try, small fixes #2382 --- base/static/css/index-style.css | 35 +++++++++++++++++++++++--------- base/templates/base/index.html | 9 +++++---- base/templatetags/base_tags.py | 36 ++++++++++++++++++++++++--------- 3 files changed, 57 insertions(+), 23 deletions(-) diff --git a/base/static/css/index-style.css b/base/static/css/index-style.css index cf25f1d22..445c05af0 100644 --- a/base/static/css/index-style.css +++ b/base/static/css/index-style.css @@ -174,7 +174,7 @@ .index-tile-container { display: grid; - grid-template-columns: repeat(5, auto); + grid-template-columns: repeat(4, auto); grid-gap: 2em; padding: 2em 0; @@ -204,17 +204,32 @@ grid-template-rows: repeat(2, auto); } } - .index-startpage-info { - padding: 2rem 0; - max-width: 900px; - margin: 0 auto; + width: min(900px, calc(100% - 2rem)); + margin: 0 auto 2rem; + padding: 1.5rem 2rem; + text-align: left; + background-color: var(--white); + border: 2px groove var(--primaryColor1); + border-radius: 5px; } + .index-startpage-info h2 { - color: #333; - margin-top: 1.5rem; + margin-top: 0; + color: var(--primaryColor2); + text-align: center; } -.index-startpage-info p { - line-height: 1.6; - color: #555; + +.index-startpage-info h3 { + color: var(--primaryColor4); +} + +.index-startpage-info p, +.index-startpage-info li { + line-height: 1.6; + color: var(--grey1); +} + +.index-startpage-info ul { + padding-left: 1.25rem; } diff --git a/base/templates/base/index.html b/base/templates/base/index.html index ca7d055a0..780ac30b5 100644 --- a/base/templates/base/index.html +++ b/base/templates/base/index.html @@ -43,7 +43,7 @@

Database

+ alt="Factsheets"> --> Scenario Bundle
@@ -103,9 +103,10 @@

Academy

style="font-size: 16px" href="{{ EXTERNAL_URLS.tutorials_index }}">Academy
-
- {% render_markdown 'startpage-info.md' %} -
+
+
+

What’s new in OEP v1.8.0?

+ {% render_markdown 'dataedit/static/release_info_startpage/release_v1.8.0.md' %}
diff --git a/base/templatetags/base_tags.py b/base/templatetags/base_tags.py index 119aa22f9..981b5b743 100644 --- a/base/templatetags/base_tags.py +++ b/base/templatetags/base_tags.py @@ -3,10 +3,11 @@ SPDX-License-Identifier: AGPL-3.0-or-later """ # noqa: 501 -import os +from pathlib import Path, PurePosixPath import markdown2 from django import template +from django.contrib.staticfiles import finders from django.utils.safestring import mark_safe register = template.Library() @@ -17,15 +18,32 @@ def addclass(field, css): return field.as_widget(attrs={"class": css}) +def _is_safe_static_path(filename): + path = PurePosixPath(filename) + return not path.is_absolute() and ".." not in path.parts + + @register.simple_tag def render_markdown(filename): - """Read a markdown file from static/content/ and render it as HTML.""" - base_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) - md_path = os.path.join(base_dir, "static", "content", filename) + """Find a markdown file in staticfiles and render it as HTML. + + The staticfiles lookup allows markdown content to live in any Django app's + static directory. The fallback keeps the old ``base/static/content`` lookup + behaviour for existing callers that pass only a filename. + """ + if not _is_safe_static_path(filename): + return "" + + md_path = finders.find(filename) + if not md_path: + md_path = ( + Path(__file__).resolve().parent.parent / "static" / "content" / filename + ) + try: - with open(md_path, encoding="utf-8") as f: - content = f.read() - markdowner = markdown2.Markdown() - return mark_safe(markdowner.convert(content)) - except FileNotFoundError: + content = Path(md_path).read_text(encoding="utf-8") + except OSError: return "" + + markdowner = markdown2.Markdown() + return mark_safe(markdowner.convert(content)) From 7d875f5a290baee07d57008955c3ad8fe3b6e3fb Mon Sep 17 00:00:00 2001 From: vismayajochem Date: Mon, 20 Jul 2026 13:01:11 +0200 Subject: [PATCH 5/7] Fix path #2382 --- base/templates/base/index.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/base/templates/base/index.html b/base/templates/base/index.html index 780ac30b5..8bcb732fe 100644 --- a/base/templates/base/index.html +++ b/base/templates/base/index.html @@ -105,8 +105,7 @@

Academy

-

What’s new in OEP v1.8.0?

- {% render_markdown 'dataedit/static/release_info_startpage/release_v1.8.0.md' %} + {% render_markdown 'release_info_startpage/release_v1.8.0.md' %} From 6be8849e964d108ac2610a89ec8308acaa03e875 Mon Sep 17 00:00:00 2001 From: tomi-rli Date: Mon, 3 Aug 2026 17:19:37 +0200 Subject: [PATCH 6/7] Read startpage highlights from the latest changelog --- base/templates/base/index.html | 82 +++++++++++++------------ base/templatetags/base_tags.py | 69 +++++++++++++++++++++ versions/changelogs/1_8_0.md | 14 +++++ versions/changelogs/current.template.md | 7 +++ 4 files changed, 132 insertions(+), 40 deletions(-) diff --git a/base/templates/base/index.html b/base/templates/base/index.html index 8bcb732fe..9a7475b6f 100644 --- a/base/templates/base/index.html +++ b/base/templates/base/index.html @@ -105,50 +105,52 @@

Academy

- {% render_markdown 'release_info_startpage/release_v1.8.0.md' %} - - +

Latest release

+ {% render_latest_release_highlights %} +
- + -
+ -
-
-
- - API - - Learn how to download and publish open data on the OEP using the - API. - - Learn more -
-
- - Open Science - - Good scientific practice needs open licenses for software, data and - content. - - Learn more -
-
- - Open Energy Community - - Collaborate and contribute to the development on GitHub. - - Learn - more -
+
+
+
+
+
+ + API + + Learn how to download and publish open data on the OEP using the + API. + + Learn more +
+
+ + Open Science + + Good scientific practice needs open licenses for software, data and + content. + + Learn more +
+
+ + Open Energy Community + + Collaborate and contribute to the development on GitHub. + + Learn + more
+
{% endblock %} diff --git a/base/templatetags/base_tags.py b/base/templatetags/base_tags.py index 981b5b743..781a526f7 100644 --- a/base/templatetags/base_tags.py +++ b/base/templatetags/base_tags.py @@ -3,6 +3,7 @@ SPDX-License-Identifier: AGPL-3.0-or-later """ # noqa: 501 +import re from pathlib import Path, PurePosixPath import markdown2 @@ -23,6 +24,74 @@ def _is_safe_static_path(filename): return not path.is_absolute() and ".." not in path.parts +_RELEASE_FILE_PATTERN = re.compile(r"^(\d+)_(\d+)_(\d+)\.md$") + +_CHANGELOG_DIRECTORY = Path(__file__).resolve().parents[2] / "versions" / "changelogs" + + +def _get_release_version(path): + """Read the version from a filename such as 1_8_0.md.""" + match = _RELEASE_FILE_PATTERN.fullmatch(path.name) + + if match is None: + return None + + return tuple(int(number) for number in match.groups()) + + +def _find_latest_release_changelog(): + """Find the newest published changelog.""" + release_files = [] + + for path in _CHANGELOG_DIRECTORY.glob("*.md"): + version = _get_release_version(path) + + if version is not None: + release_files.append((version, path)) + + if not release_files: + return None + + return max(release_files, key=lambda item: item[0])[1] + + +def _extract_startpage_highlights(markdown_content): + """Read only the Startpage Highlights section.""" + pattern = re.compile( + r"^## Startpage Highlights\s*$\n" r"(?P.*?)(?=^##\s|\Z)", + flags=re.MULTILINE | re.DOTALL, + ) + + match = pattern.search(markdown_content) + + if match is None: + return "" + + return match.group("content").strip() + + +@register.simple_tag +def render_latest_release_highlights(): + """Render highlights from the newest published changelog.""" + latest_changelog = _find_latest_release_changelog() + + if latest_changelog is None: + return "" + + try: + markdown_content = latest_changelog.read_text(encoding="utf-8") + except OSError: + return "" + + highlights = _extract_startpage_highlights(markdown_content) + + if not highlights: + return "" + + markdowner = markdown2.Markdown() + return mark_safe(markdowner.convert(highlights)) + + @register.simple_tag def render_markdown(filename): """Find a markdown file in staticfiles and render it as HTML. diff --git a/versions/changelogs/1_8_0.md b/versions/changelogs/1_8_0.md index 5918b8eba..b906540f3 100644 --- a/versions/changelogs/1_8_0.md +++ b/versions/changelogs/1_8_0.md @@ -8,6 +8,20 @@ SPDX-License-Identifier: CC0-1.0 # Changes to the oeplatform code +## Startpage Highlights + +- **Redesigned Tables listings & Search:** The table search and listing were + improved. +- **Updated OEO Viewer:** The layout and mobile view were improved. +- **Scenario Comparison App Update:** The application was updated for the + current OEKG and OEO. +- **Automated Metadata Syncing:** Metadata and table schemas are now + synchronized. +- **Bug Fixes:** Several issues were corrected. + +- Check out the full changelog and explore whats's new! + [Full Changelog](https://github.com/OpenEnergyPlatform/oeplatform/blob/master/versions/changelogs/1_8_0.md) + ## Changes - Create tables_sections.html, delete user_partial_tables diff --git a/versions/changelogs/current.template.md b/versions/changelogs/current.template.md index 599d6500c..f1f24e1b6 100644 --- a/versions/changelogs/current.template.md +++ b/versions/changelogs/current.template.md @@ -8,6 +8,13 @@ SPDX-License-Identifier: CC0-1.0 # Changes to the oeplatform code +## Startpage Highlights + + + ## Changes ## Features From 92a8b8b9330cc3d8ea26fd94752ea1d4a93840b8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 4 Aug 2026 11:00:19 +0000 Subject: [PATCH 7/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- base/templates/base/index.html | 74 +++++++++++++++++----------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/base/templates/base/index.html b/base/templates/base/index.html index 9a7475b6f..efba202f7 100644 --- a/base/templates/base/index.html +++ b/base/templates/base/index.html @@ -114,43 +114,43 @@

Latest release

- -
-
-
- - API - - Learn how to download and publish open data on the OEP using the - API. - - Learn more -
-
- - Open Science - - Good scientific practice needs open licenses for software, data and - content. - - Learn more -
-
- - Open Energy Community - - Collaborate and contribute to the development on GitHub. - - Learn - more +
+
+
+
+ + API + + Learn how to download and publish open data on the OEP using the + API. + + Learn more +
+
+ + Open Science + + Good scientific practice needs open licenses for software, data and + content. + + Learn more +
+
+ + Open Energy Community + + Collaborate and contribute to the development on GitHub. + + Learn + more +
-
-
+ {% endblock %}