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
31 changes: 30 additions & 1 deletion base/static/css/index-style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -204,3 +204,32 @@
grid-template-rows: repeat(2, auto);
}
}
.index-startpage-info {
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 {
margin-top: 0;
color: var(--primaryColor2);
text-align: center;
}

.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;
}
82 changes: 46 additions & 36 deletions base/templates/base/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
{% load django_bootstrap5 %}
{% load static %}
{% load compress %}
{% load base_tags %}
{% block after-head %}
{% compress css %}
<link rel="stylesheet"
Expand Down Expand Up @@ -42,7 +43,7 @@ <h2>Database</h2>
</div>
<div class="index-tile index-tile-colored index-tile-color-2">
<!-- <img src="{% static 'img/welcome/OpenEnergyFamily_Logo_Factsheets_icon.svg' %}"
alt="Factsheets"> -->
alt="Factsheets"> -->
<img src="{% static 'img/welcome/bundles.png' %}" alt="Scenario Bundle" />
<div class="inner-index-tile">
<div class="panel-description">
Expand Down Expand Up @@ -103,44 +104,53 @@ <h2>Academy</h2>
href="{{ EXTERNAL_URLS.tutorials_index }}">Academy</a>
</div>
</div>
<section class="index-startpage-info" aria-labelledby="release-info-heading">
<h2 id="release-info-heading">Latest release</h2>
{% render_latest_release_highlights %}
</section>
</div>
<!-- /.index-padding -->
</div>
<div class="index-about-container-background">
<div class="index-about-container">
<div class="index-about-column">
<img src="{% static 'img/welcome/about-process-modelling.svg' %}" alt="" />
<b>API</b>
<span class="alternative">
Learn how to download and publish open data on the OEP using the
API.
</span>
<a role="button"
class="btn btn-primary btn-sm"
href="{{ EXTERNAL_URLS.tutorials_api1 }}">Learn more</a>
</div>
<div class="index-about-column">
<img src="{% static 'img/welcome/about-openscience.svg' %}" alt="" />
<b>Open Science</b>
<span class="alternative">
Good scientific practice needs open licenses for software, data and
content.
</span>
<a role="button"
class="btn btn-primary btn-sm"
href="{{ EXTERNAL_URLS.tutorials_licenses }}">Learn more</a>
</div>
<div class="index-about-column">
<img src="{% static 'img/welcome/about-community.svg' %}" alt="" />
<b>Open Energy Community</b>
<span class="alternative">
Collaborate and contribute to the development on GitHub.
</span>
<a role="button"
class="btn btn-primary btn-sm"
href="{{ EXTERNAL_URLS.github_openenergyplatform }}">Learn
more</a>
</div>
<!-- /.index-group -->
</div>
<div class="index-about-container-background"></div>
</div>
<div class="index-about-container-background">
<div class="index-about-container">
<div class="index-about-column">
<img src="{% static 'img/welcome/about-process-modelling.svg' %}" alt="" />
<b>API</b>
<span class="alternative">
Learn how to download and publish open data on the OEP using the
API.
</span>
<a role="button"
class="btn btn-primary btn-sm"
href="{{ EXTERNAL_URLS.tutorials_api1 }}">Learn more</a>
</div>
<div class="index-about-column">
<img src="{% static 'img/welcome/about-openscience.svg' %}" alt="" />
<b>Open Science</b>
<span class="alternative">
Good scientific practice needs open licenses for software, data and
content.
</span>
<a role="button"
class="btn btn-primary btn-sm"
href="{{ EXTERNAL_URLS.tutorials_licenses }}">Learn more</a>
</div>
<div class="index-about-column">
<img src="{% static 'img/welcome/about-community.svg' %}" alt="" />
<b>Open Energy Community</b>
<span class="alternative">
Collaborate and contribute to the development on GitHub.
</span>
<a role="button"
class="btn btn-primary btn-sm"
href="{{ EXTERNAL_URLS.github_openenergyplatform }}">Learn
more</a>
</div>
</div>
</div>
</div>
{% endblock %}
105 changes: 105 additions & 0 deletions base/templatetags/base_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,116 @@
SPDX-License-Identifier: AGPL-3.0-or-later
""" # noqa: 501

import re
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()


@register.filter(name="addclass")
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


_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<content>.*?)(?=^##\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.

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:
content = Path(md_path).read_text(encoding="utf-8")
except OSError:
return ""

markdowner = markdown2.Markdown()
return mark_safe(markdowner.convert(content))
28 changes: 28 additions & 0 deletions dataedit/static/release_info_startpage/release_v1.8.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
SPDX-FileCopyrightText: 2026 Vismaya Jochem <https://github.com/vismayajochem> © Reiner Lemoine Institut,

SPDX-License-Identifier: CC0-1.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)
14 changes: 14 additions & 0 deletions versions/changelogs/1_8_0.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions versions/changelogs/current.template.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ SPDX-License-Identifier: CC0-1.0

# Changes to the oeplatform code

## Startpage Highlights

<!--
Add three to five short, user-facing highlights for the OEP start page.
Avoid technical implementation details.
-->

## Changes

## Features
Expand Down
Loading