From 9faf5a9fc0df0408568d35d7ae84b23b29dad8db Mon Sep 17 00:00:00 2001 From: Josako Date: Mon, 29 Apr 2024 15:18:22 +0200 Subject: [PATCH] Add index file - / route --- eveai_app/__init__.py | 2 ++ eveai_app/templates/base.html | 33 ++----------------- eveai_app/templates/footer.html | 0 eveai_app/templates/head.html | 21 ++++++++++++ eveai_app/templates/index.html | 55 ++++++++++++++++++++++++++++++++ eveai_app/templates/scripts.html | 7 ++++ eveai_app/utils/security.py | 2 +- eveai_app/views/basic_views.py | 14 ++++++++ eveai_app/views/user_views.py | 4 +-- 9 files changed, 105 insertions(+), 33 deletions(-) create mode 100644 eveai_app/templates/footer.html create mode 100644 eveai_app/templates/head.html create mode 100644 eveai_app/templates/index.html create mode 100644 eveai_app/templates/scripts.html create mode 100644 eveai_app/views/basic_views.py diff --git a/eveai_app/__init__.py b/eveai_app/__init__.py index ff69824..c5cc42f 100644 --- a/eveai_app/__init__.py +++ b/eveai_app/__init__.py @@ -62,6 +62,8 @@ def register_extensions(app): def register_blueprints(app): from .views.user_views import user_bp app.register_blueprint(user_bp) + from .views.basic_views import basic_bp + app.register_blueprint(basic_bp) def register_api(app): diff --git a/eveai_app/templates/base.html b/eveai_app/templates/base.html index 984bdde..e721e16 100644 --- a/eveai_app/templates/base.html +++ b/eveai_app/templates/base.html @@ -1,27 +1,7 @@ - - - - - - - {% block title %}{% endblock %} - - - - - - - - - - - - - - + {% include 'head.html' %} {% include 'navbar.html' %} @@ -69,14 +49,7 @@
-{# {% include 'footer.html' %}#} - - - - - - - {% block scripts %} - {%- endblock scripts %} + {% include 'footer.html' %} + {% include 'scripts.html' %} \ No newline at end of file diff --git a/eveai_app/templates/footer.html b/eveai_app/templates/footer.html new file mode 100644 index 0000000..e69de29 diff --git a/eveai_app/templates/head.html b/eveai_app/templates/head.html new file mode 100644 index 0000000..c369d3c --- /dev/null +++ b/eveai_app/templates/head.html @@ -0,0 +1,21 @@ + + + + + + + {% block title %}{% endblock %} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/eveai_app/templates/index.html b/eveai_app/templates/index.html new file mode 100644 index 0000000..f038e71 --- /dev/null +++ b/eveai_app/templates/index.html @@ -0,0 +1,55 @@ + + + + {% include 'head.html' %} + + + {% include 'navbar.html' %} + {% include 'header.html' %} +
+
+ +
+
+
+
+
+
+ payment +
+
Enhanced User Interaction
+

Interact with your customers in a modern and futureproof way, using the latest technololgie.

+
+
+
+ insights +
+
Modern Technology
+

Use the latest Large Language Models (think ChatGPT) to expose your knowledge and information.

+
+
+
+
+
+ access_alarms +
+
Based on Your Information
+

Ensure your virtual assistant is up to date with your information.

+
+
+
+ sentiment_satisfied +
+
Enrich Your Information
+

If required, enrich your information with the general knowledge of the world.

+
+
+
+
+
+
+
+ {% include 'footer.html' %} + {% include 'scripts.html' %} + + \ No newline at end of file diff --git a/eveai_app/templates/scripts.html b/eveai_app/templates/scripts.html new file mode 100644 index 0000000..9ab3d6a --- /dev/null +++ b/eveai_app/templates/scripts.html @@ -0,0 +1,7 @@ + + + + + + {% block scripts %} + {%- endblock scripts %} \ No newline at end of file diff --git a/eveai_app/utils/security.py b/eveai_app/utils/security.py index eef563f..b0c6fed 100644 --- a/eveai_app/utils/security.py +++ b/eveai_app/utils/security.py @@ -3,6 +3,6 @@ from ..models.user import User, Tenant # Definition of Trigger Handlers -def set_tenant_session_data(sender, user): +def set_tenant_session_data(sender, user, **kwargs): tenant = Tenant.query.filter_by(id=user.tenant_id).first() session['tenant'] = tenant diff --git a/eveai_app/views/basic_views.py b/eveai_app/views/basic_views.py new file mode 100644 index 0000000..a0489aa --- /dev/null +++ b/eveai_app/views/basic_views.py @@ -0,0 +1,14 @@ +from flask import request, redirect, url_for, flash, render_template, Blueprint, session +from flask_security import hash_password, roles_required, roles_accepted + +from ..models.user import User, Tenant, Role +from ..extensions import db +from .user_forms import TenantForm, CreateUserForm, EditUserForm +from ..utils.database import Database + +basic_bp = Blueprint('basic_bp', __name__) + + +@basic_bp.route('/', methods=['GET', ]) +def index(): + return render_template('index.html') diff --git a/eveai_app/views/user_views.py b/eveai_app/views/user_views.py index d5fa3c1..b568b79 100644 --- a/eveai_app/views/user_views.py +++ b/eveai_app/views/user_views.py @@ -2,9 +2,9 @@ import uuid from datetime import datetime as dt, timezone as tz from flask import request, redirect, url_for, flash, render_template, Blueprint, session -from flask_security import hash_password, current_user, login_required, roles_required, roles_accepted +from flask_security import hash_password, roles_required, roles_accepted -from ..models.user import User, Tenant, Role, RolesUsers +from ..models.user import User, Tenant, Role from ..extensions import db from .user_forms import TenantForm, CreateUserForm, EditUserForm from ..utils.database import Database