diff --git a/routes/__pycache__/admin.cpython-313.pyc b/routes/__pycache__/admin.cpython-313.pyc index 8a2bdfa..d7c90a3 100644 Binary files a/routes/__pycache__/admin.cpython-313.pyc and b/routes/__pycache__/admin.cpython-313.pyc differ diff --git a/routes/__pycache__/main.cpython-313.pyc b/routes/__pycache__/main.cpython-313.pyc index 4a9675d..23b05ba 100644 Binary files a/routes/__pycache__/main.cpython-313.pyc and b/routes/__pycache__/main.cpython-313.pyc differ diff --git a/routes/admin.py b/routes/admin.py index 7f55005..b780b03 100644 --- a/routes/admin.py +++ b/routes/admin.py @@ -1,6 +1,8 @@ from flask import Blueprint, jsonify, request from flask_login import login_required, current_user from models import db, Room, RoomFile, User, DocuPulseSettings, HelpArticle +from extensions import csrf +from utils.event_logger import log_event import os from datetime import datetime import json @@ -258,6 +260,7 @@ def get_usage_stats(): @admin.route('/api/admin/help-articles/', methods=['PUT']) @login_required +@csrf.exempt def update_help_article(article_id): """Update a help article""" if not current_user.is_admin: @@ -310,6 +313,7 @@ def update_help_article(article_id): @admin.route('/api/admin/help-articles/', methods=['DELETE']) @login_required +@csrf.exempt def delete_help_article(article_id): """Delete a help article""" if not current_user.is_admin: @@ -342,6 +346,7 @@ def delete_help_article(article_id): # Help Articles API endpoints @admin.route('/api/admin/help-articles', methods=['GET']) @login_required +@csrf.exempt def get_help_articles(): """Get all help articles""" if not current_user.is_admin: @@ -367,6 +372,7 @@ def get_help_articles(): @admin.route('/api/admin/help-articles', methods=['POST']) @login_required +@csrf.exempt def create_help_article(): """Create a new help article""" if not current_user.is_admin: @@ -420,6 +426,7 @@ def create_help_article(): @admin.route('/api/admin/help-articles/', methods=['GET']) @login_required +@csrf.exempt def get_help_article(article_id): """Get a specific help article""" if not current_user.is_admin: diff --git a/routes/public.py b/routes/public.py index bc1a276..2d56fff 100644 --- a/routes/public.py +++ b/routes/public.py @@ -57,7 +57,12 @@ def init_public_routes(public_bp): articles = HelpArticle.get_articles_by_category(category) category_name = categories[category] else: + # Show all articles when no specific category is requested articles = [] + for category_articles in all_articles.values(): + articles.extend(category_articles) + # Sort by order_index and then by created_at + articles.sort(key=lambda x: (x.order_index, x.created_at)) category_name = None return render_template('public/help_articles.html', diff --git a/templates/admin/support_articles.html b/templates/admin/support_articles.html index fb0e7fb..e5ba066 100644 --- a/templates/admin/support_articles.html +++ b/templates/admin/support_articles.html @@ -2,6 +2,10 @@ {% block title %}Support Articles - DocuPulse{% endblock %} +{% block head %} + +{% endblock %} + {% block extra_css %}