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 %} +
Updates and changes to the site will be documented here, with the most recent changes listed first.
+ + +