diff --git a/__pycache__/app.cpython-312.pyc b/__pycache__/app.cpython-312.pyc new file mode 100644 index 0000000..41f7a9b Binary files /dev/null and b/__pycache__/app.cpython-312.pyc differ diff --git a/app.py b/app.py index ef34a5f..e84a4e4 100644 --- a/app.py +++ b/app.py @@ -22,10 +22,13 @@ bcrypt = Bcrypt(app) UPLOAD_FOLDER = 'static/uploads' app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER +UPLOAD_FOLDERLOGO = 'static/resurse' +app.config['UPLOAD_FOLDERLOGO'] = UPLOAD_FOLDERLOGO # Ensure the upload folder exists if not os.path.exists(UPLOAD_FOLDER): os.makedirs(UPLOAD_FOLDER) + os.makedirs(UPLOAD_FOLDERLOGO) login_manager = LoginManager(app) login_manager.login_view = 'login' @@ -84,7 +87,7 @@ def convert_ppt_to_pdf(input_file, output_file): def dashboard(): players = Player.query.all() groups = Group.query.all() - logo_exists = os.path.exists(os.path.join(app.config['UPLOAD_FOLDER'], 'logo.png')) + logo_exists = os.path.exists(os.path.join(app.config['UPLOAD_FOLDERLOGO'], 'logo.png')) return render_template('dashboard.html', players=players, groups=groups, logo_exists=logo_exists) @app.route('/register', methods=['GET', 'POST']) @@ -111,7 +114,7 @@ def login(): else: flash('Login Unsuccessful. Please check username and password', 'danger') - login_picture_exists = os.path.exists(os.path.join(app.config['UPLOAD_FOLDER'], 'login_picture.png')) + login_picture_exists = os.path.exists(os.path.join(app.config['UPLOAD_FOLDERLOGO'], 'login_picture.png')) return render_template('login.html', login_picture_exists=login_picture_exists) @app.route('/logout') @@ -180,8 +183,8 @@ def upload_content(): @login_required @admin_required def admin(): - logo_exists = os.path.exists(os.path.join(app.config['UPLOAD_FOLDER'], 'logo.png')) - login_picture_exists = os.path.exists(os.path.join(app.config['UPLOAD_FOLDER'], 'login_picture.png')) + logo_exists = os.path.exists(os.path.join(app.config['UPLOAD_FOLDERLOGO'], 'logo.png')) + login_picture_exists = os.path.exists(os.path.join(app.config['UPLOAD_FOLDERLOGO'], 'login_picture.png')) users = User.query.all() return render_template('admin.html', users=users, logo_exists=logo_exists, login_picture_exists=login_picture_exists) @@ -449,7 +452,7 @@ def upload_logo(): if file: filename = secure_filename(file.filename) - file_path = os.path.join(app.config['UPLOAD_FOLDER'], 'logo.png') + file_path = os.path.join(app.config['UPLOAD_FOLDERLOGO'], 'logo.png') file.save(file_path) return redirect(url_for('admin')) @@ -462,12 +465,12 @@ def upload_personalization_pictures(): if logo_file and logo_file.filename != '': logo_filename = secure_filename(logo_file.filename) - logo_file_path = os.path.join(app.config['UPLOAD_FOLDER'], 'logo.png') + logo_file_path = os.path.join(app.config['UPLOAD_FOLDERLOGO'], 'logo.png') logo_file.save(logo_file_path) if login_picture_file and login_picture_file.filename != '': login_picture_filename = secure_filename(login_picture_file.filename) - login_picture_file_path = os.path.join(app.config['UPLOAD_FOLDER'], 'login_picture.png') + login_picture_file_path = os.path.join(app.config['UPLOAD_FOLDERLOGO'], 'login_picture.png') login_picture_file.save(login_picture_file_path) return redirect(url_for('admin')) diff --git a/enviroment.txt b/enviroment.txt index 194b5ff..a3c8edc 100644 --- a/enviroment.txt +++ b/enviroment.txt @@ -1,4 +1,4 @@ -python -m venv digiscreen +python3 -m venv digiscreen source digiscreen/bin/activate diff --git a/instance/dashboard.db b/instance/dashboard.db index 1de7a97..bc16192 100644 Binary files a/instance/dashboard.db and b/instance/dashboard.db differ diff --git a/static/uploads/login_picture.png b/static/resurse/login_picture.png similarity index 100% rename from static/uploads/login_picture.png rename to static/resurse/login_picture.png diff --git a/static/uploads/logo.png b/static/resurse/logo.png similarity index 100% rename from static/uploads/logo.png rename to static/resurse/logo.png diff --git a/templates/admin.html b/templates/admin.html index c360939..8e03b88 100644 --- a/templates/admin.html +++ b/templates/admin.html @@ -41,7 +41,7 @@
+
{% endif %}
+
{% endif %}
+
{% endif %}