diff --git a/app.py b/app.py index a105145..d1335a0 100644 --- a/app.py +++ b/app.py @@ -6,6 +6,7 @@ from flask_sqlalchemy import SQLAlchemy from flask_login import LoginManager, login_manager, current_user, login_user, \ logout_user, login_required from flask_wtf import FlaskForm +from flask_cache_buster import CacheBuster from wtforms import StringField, PasswordField, BooleanField, SubmitField from wtforms.validators import DataRequired from flask_bootstrap import Bootstrap @@ -48,6 +49,15 @@ login_manager.login_view = 'login' db.create_all() +config = { + 'extensions': ['.js', '.css', '.csv'], + 'hash_size': 10 +} + +cache_buster = CacheBuster(config=config) +cache_buster.register_cache_buster(app) + + server = Server(app.config['LDAP_HOST']) conn = Connection(server, app.config['LDAP_USERNAME'], app.config['LDAP_PASSWORD'], auto_bind=True) @@ -57,12 +67,10 @@ class User(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(100)) - password = db.Column(db.String(128)) authenticated = db.Column(db.Boolean, default=False) - def __init__(self, username, password): + def __init__(self, username): self.username = username - self.password = password @staticmethod def try_login(username, password): diff --git a/requirements.txt b/requirements.txt index 562983f..c2b13a4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,3 +7,4 @@ ldap3==2.8.1 short_url==1.2.2 Flask-SQLAlchemy==2.4.4 Flask-WTF==0.14.3 +Flask-Cache-Buster==1.0.1 \ No newline at end of file diff --git a/static/icons/feathericons/LICENSE b/static/icons/feathericons/LICENSE new file mode 100644 index 0000000..c2f512f --- /dev/null +++ b/static/icons/feathericons/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013-2017 Cole Bemis + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/static/icons/feathericons/feather-sprite.svg b/static/icons/feathericons/feather-sprite.svg new file mode 100644 index 0000000..327fbbb --- /dev/null +++ b/static/icons/feathericons/feather-sprite.svg @@ -0,0 +1 @@ + diff --git a/static/icons/lucide-icons/LICENSE b/static/icons/lucide-icons/LICENSE new file mode 100644 index 0000000..66cc022 --- /dev/null +++ b/static/icons/lucide-icons/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright (c) 2020, Lucide Contributors + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/static/icons/lucide-icons/gamepad-2.svg b/static/icons/lucide-icons/gamepad-2.svg new file mode 100644 index 0000000..a8268a2 --- /dev/null +++ b/static/icons/lucide-icons/gamepad-2.svg @@ -0,0 +1,7 @@ + diff --git a/static/icons/lucide-icons/snowflake.svg b/static/icons/lucide-icons/snowflake.svg new file mode 100644 index 0000000..5242809 --- /dev/null +++ b/static/icons/lucide-icons/snowflake.svg @@ -0,0 +1,12 @@ + diff --git a/static/style.css b/static/style.css index b619e59..b1ed63f 100644 --- a/static/style.css +++ b/static/style.css @@ -115,3 +115,23 @@ opacity: 1; } } + +.overlay-frame { + z-index: 1050; + position: fixed; + top: 55px; + right: 10px; + border-radius: .25rem; + border: 1px solid #6c757d; +} + +#overlay { + width: 100%; + height: 100%; + z-index: 1040; + background-color: rgba(0, 0, 0, 0); + position: fixed; + top: 0; + left: 0; + overflow: hidden; +} \ No newline at end of file diff --git a/templates/fragments/navbar.j2 b/templates/fragments/navbar.j2 new file mode 100644 index 0000000..59a51ac --- /dev/null +++ b/templates/fragments/navbar.j2 @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/templates/login.j2 b/templates/login.j2 index 4822917..20d7d53 100644 --- a/templates/login.j2 +++ b/templates/login.j2 @@ -8,12 +8,12 @@ {% endblock %} {% block navbar %} - +{% include "fragments/navbar.j2" %} {% endblock %} {% block content %} + +