support articles

This commit is contained in:
2025-06-24 09:43:31 +02:00
parent fed00ff2a0
commit 875e20304b
11 changed files with 1018 additions and 21 deletions

View File

@@ -1,5 +1,5 @@
from flask import Blueprint, render_template, redirect, url_for
from models import SiteSettings
from flask import Blueprint, render_template, redirect, url_for, request
from models import SiteSettings, HelpArticle
import os
def init_public_routes(public_bp):
@@ -38,6 +38,30 @@ def init_public_routes(public_bp):
"""Help Center page"""
return render_template('public/help.html')
@public_bp.route('/help/articles')
def help_articles():
"""Display help articles by category"""
category = request.args.get('category', '')
# Get all published articles grouped by category
all_articles = HelpArticle.get_all_published()
categories = HelpArticle.get_categories()
# If a specific category is requested, filter to that category
if category and category in categories:
articles = HelpArticle.get_articles_by_category(category)
category_name = categories[category]
else:
articles = []
category_name = None
return render_template('public/help_articles.html',
articles=articles,
all_articles=all_articles,
categories=categories,
current_category=category,
category_name=category_name)
@public_bp.route('/contact')
def contact():
"""Contact page"""