From 2465cad005d932f024dae2a71d1b92f0c94eaf77 Mon Sep 17 00:00:00 2001 From: Peter Stockings Date: Sun, 30 Mar 2025 21:30:25 +1100 Subject: [PATCH] feat: Add static changelog page Adds a new static page accessible at /changelog to display site updates and changes manually. - Creates a new Flask Blueprint in `routes/changelog.py` to handle the route logic. - Registers the `changelog_bp` blueprint in `app.py`. - Creates the corresponding template `templates/changelog/changelog.html` extending the base layout. - Adds a link to the Changelog page in the main sidebar navigation in `templates/base.html`, using an archive icon for consistency. - Applies basic card styling to the changelog page content for improved visual structure. --- app.py | 4 ++-- routes/changelog.py | 15 +++++++++++++ templates/base.html | 14 ++++++++++++ templates/changelog/changelog.html | 35 ++++++++++++++++++++++++++++++ 4 files changed, 66 insertions(+), 2 deletions(-) create mode 100644 routes/changelog.py create mode 100644 templates/changelog/changelog.html diff --git a/app.py b/app.py index 5ba25fe..51b2b9c 100644 --- a/app.py +++ b/app.py @@ -6,6 +6,7 @@ import jinja_partials from jinja2_fragments import render_block from decorators import validate_person, validate_topset, validate_workout from routes.auth import auth, get_person_by_id +from routes.changelog import changelog_bp from extensions import db from utils import convert_str_to_date, generate_plot from flask_htmx import HTMX @@ -32,8 +33,7 @@ def load_user(person_id): return get_person_by_id(person_id) app.register_blueprint(auth, url_prefix='/auth') - - +app.register_blueprint(changelog_bp, url_prefix='/changelog') @app.after_request def response_minify(response): diff --git a/routes/changelog.py b/routes/changelog.py new file mode 100644 index 0000000..a4cfb99 --- /dev/null +++ b/routes/changelog.py @@ -0,0 +1,15 @@ +from flask import Blueprint, render_template, current_app +from flask_htmx import htmx +from jinja2_fragments import render_block + +changelog_bp = Blueprint('changelog', __name__) + +@changelog_bp.route('/') +def show_changelog(): + """Renders the changelog page.""" + template_name = 'changelog/changelog.html' # Path relative to templates/ + if htmx: + # If request is from HTMX, render only the content block + return render_block(current_app.jinja_env, template_name, 'content') + # Otherwise, render the full page + return render_template(template_name) \ No newline at end of file diff --git a/templates/base.html b/templates/base.html index 849b987..b4bddf0 100644 --- a/templates/base.html +++ b/templates/base.html @@ -198,6 +198,20 @@ Settings + + + + + + Changelog + diff --git a/templates/changelog/changelog.html b/templates/changelog/changelog.html new file mode 100644 index 0000000..fc64cf5 --- /dev/null +++ b/templates/changelog/changelog.html @@ -0,0 +1,35 @@ +{% extends "base.html" %} + +{% block content %} +
{# Add some overall padding for the page content area #} +
{# Card container #} +

Changelog

{# Added bottom border to + heading #} + + {# Container for the actual changelog entries with prose styling #} +
+

Updates and changes to the site will be documented here, with the most recent changes listed first.

+ + +
{# Increased margin for HR #} +

March 30, 2025

{# Reduced margin-bottom for H2 #} +
    {# Added space between list items #} +
  • Added the initial changelog page.
  • +
  • Fixed a minor styling issue on the dashboard.
  • +
  • Improved visual styling of the changelog page itself.
  • {# Added an entry for this change #} +
+ + {# Add more entries below, following the pattern above #} + + +
+
+
+{% endblock %} \ No newline at end of file