support articles
This commit is contained in:
@@ -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"""
|
||||
|
||||
Reference in New Issue
Block a user