diff --git a/eveai_app/templates/navbar.html b/eveai_app/templates/navbar.html index 6728254..534aae4 100644 --- a/eveai_app/templates/navbar.html +++ b/eveai_app/templates/navbar.html @@ -120,6 +120,7 @@ {% if current_user.is_authenticated %} {{ dropdown(current_user.user_name, 'person', [ {'name': 'Session Defaults', 'url': '/session_defaults', 'roles': ['Super User', 'Tenant Admin']}, + {'name': 'Release Notes', 'url': '/release_notes', 'roles': ['Super User', 'Partner Admin', 'Tenant Admin']}, {'name': 'Logout', 'url': '/logout'} ]) }} {% else %} @@ -133,4 +134,4 @@ - \ No newline at end of file + diff --git a/eveai_app/views/basic_views.py b/eveai_app/views/basic_views.py index b5e0fed..6e0302c 100644 --- a/eveai_app/views/basic_views.py +++ b/eveai_app/views/basic_views.py @@ -1,6 +1,8 @@ -from flask import request, render_template, Blueprint, session, current_app, jsonify, flash, redirect +from flask import request, render_template, Blueprint, session, current_app, jsonify, flash, redirect, url_for from flask_security import roles_required, roles_accepted from flask_wtf.csrf import generate_csrf +import os +import requests from common.models.document import Catalog from common.models.user import Tenant @@ -101,3 +103,29 @@ def check_csrf(): 'session_data': dict(session) }) + +@basic_bp.route('/release_notes', methods=['GET']) +@roles_accepted('Super User', 'Partner Admin', 'Tenant Admin') +def release_notes(): + """Display the CHANGELOG.md file.""" + try: + # Construct the URL to the CHANGELOG.md file in the static directory + static_url = url_for('static', filename='docs/CHANGELOG.md', _external=True) + + # Make a request to get the content of the CHANGELOG.md file + response = requests.get(static_url) + response.raise_for_status() # Raise an exception for HTTP errors + + # Get the content of the response + markdown_content = response.text + + return render_template( + 'basic/view_markdown.html', + title='Release Notes', + description='EveAI Release Notes and Change History', + markdown_content=markdown_content + ) + except Exception as e: + current_app.logger.error(f"Error displaying release notes: {str(e)}") + flash(f'Error displaying release notes: {str(e)}', 'danger') + return redirect(prefixed_url_for('basic_bp.index'))