diff --git a/routes/__pycache__/admin.cpython-313.pyc b/routes/__pycache__/admin.cpython-313.pyc index 1c23c7e..6b9b3b4 100644 Binary files a/routes/__pycache__/admin.cpython-313.pyc and b/routes/__pycache__/admin.cpython-313.pyc differ diff --git a/routes/admin.py b/routes/admin.py index df1e99a..f885eb0 100644 --- a/routes/admin.py +++ b/routes/admin.py @@ -1,6 +1,6 @@ -from flask import Blueprint, jsonify +from flask import Blueprint, jsonify, request from flask_login import login_required, current_user -from models import db, Room, RoomFile, User, DocuPulseSettings +from models import db, Room, RoomFile, User, DocuPulseSettings, HelpArticle import os from datetime import datetime @@ -253,9 +253,9 @@ def get_usage_stats(): stats = DocuPulseSettings.get_usage_stats() return jsonify(stats) except Exception as e: - return jsonify({'error': str(e)}), 500 - -@admin.route('/help-articles/', methods=['PUT']) + return jsonify({'error': str(e)}), 500 + +@admin.route('/api/admin/help-articles/', methods=['PUT']) @login_required def update_help_article(article_id): """Update a help article""" @@ -307,7 +307,7 @@ def update_help_article(article_id): db.session.rollback() return jsonify({'error': str(e)}), 500 -@admin.route('/help-articles/', methods=['DELETE']) +@admin.route('/api/admin/help-articles/', methods=['DELETE']) @login_required def delete_help_article(article_id): """Delete a help article""" @@ -339,7 +339,7 @@ def delete_help_article(article_id): return jsonify({'error': str(e)}), 500 # Help Articles API endpoints -@admin.route('/help-articles', methods=['GET']) +@admin.route('/api/admin/help-articles', methods=['GET']) @login_required def get_help_articles(): """Get all help articles""" @@ -364,7 +364,7 @@ def get_help_articles(): return jsonify({'articles': articles_data}) -@admin.route('/help-articles', methods=['POST']) +@admin.route('/api/admin/help-articles', methods=['POST']) @login_required def create_help_article(): """Create a new help article""" @@ -417,7 +417,7 @@ def create_help_article(): db.session.rollback() return jsonify({'error': str(e)}), 500 -@admin.route('/help-articles/', methods=['GET']) +@admin.route('/api/admin/help-articles/', methods=['GET']) @login_required def get_help_article(article_id): """Get a specific help article""" diff --git a/templates/admin/support_articles.html b/templates/admin/support_articles.html index 5f2df94..fb0e7fb 100644 --- a/templates/admin/support_articles.html +++ b/templates/admin/support_articles.html @@ -30,6 +30,37 @@ .note-editor .note-editing-area { background-color: var(--white); } + .note-editor .note-toolbar { + background-color: var(--bg-color); + border-bottom: 1px solid var(--border-color); + border-radius: 0.375rem 0.375rem 0 0; + } + .note-editor .note-btn { + border: 1px solid var(--border-color); + background-color: var(--white); + color: var(--text-dark); + } + .note-editor .note-btn:hover { + background-color: var(--primary-color); + color: var(--white); + border-color: var(--primary-color); + } + .note-editor .note-btn.active { + background-color: var(--primary-color); + color: var(--white); + border-color: var(--primary-color); + } + .note-editor .note-editing-area .note-editable { + color: var(--text-dark); + font-family: inherit; + line-height: 1.6; + padding: 15px; + } + .note-editor .note-status-output { + background-color: var(--bg-color); + border-top: 1px solid var(--border-color); + color: var(--text-muted); + } {% endblock %} @@ -207,70 +238,83 @@ {% endblock %} {% block extra_js %} + {% endblock %} \ No newline at end of file