From e853bb6a86795f734de4db0aed9026a63e95b9c0 Mon Sep 17 00:00:00 2001 From: Kobe Date: Sun, 25 May 2025 12:20:02 +0200 Subject: [PATCH] restructure file system --- routes/__init__.py | 2 +- routes/__pycache__/__init__.cpython-313.pyc | Bin 1422 -> 1429 bytes routes/__pycache__/auth.cpython-313.pyc | Bin 3976 -> 3988 bytes routes/__pycache__/contacts.cpython-313.pyc | Bin 15917 -> 15917 bytes routes/__pycache__/main.cpython-313.pyc | Bin 21102 -> 21139 bytes routes/__pycache__/rooms.cpython-313.pyc | Bin 14682 -> 14716 bytes routes/auth.py | 4 ++-- routes/main.py | 12 ++++++------ routes/rooms.py | 10 +++++----- templates/{ => auth}/login.html | 0 templates/{ => auth}/register.html | 0 templates/{ => common}/base.html | 0 templates/{ => common}/macros.html | 0 templates/components/storage_overview.html | 2 +- templates/components/storage_usage.html | 2 +- templates/components/trash.html | 2 +- templates/{ => contacts}/contacts.html | 2 +- templates/contacts/form.html | 2 +- templates/contacts/list.html | 2 +- templates/{ => dashboard}/dashboard.html | 2 +- templates/{ => profile}/profile.html | 2 +- templates/{ => rooms}/create_room.html | 2 +- templates/{ => rooms}/edit_room.html | 2 +- templates/{ => rooms}/room.html | 2 +- templates/{ => rooms}/room_members.html | 2 +- templates/{ => rooms}/rooms.html | 2 +- templates/{ => starred}/starred.html | 2 +- templates/{ => trash}/trash.html | 2 +- 28 files changed, 29 insertions(+), 29 deletions(-) rename templates/{ => auth}/login.html (100%) rename templates/{ => auth}/register.html (100%) rename templates/{ => common}/base.html (100%) rename templates/{ => common}/macros.html (100%) rename templates/{ => contacts}/contacts.html (83%) rename templates/{ => dashboard}/dashboard.html (99%) rename templates/{ => profile}/profile.html (99%) rename templates/{ => rooms}/create_room.html (98%) rename templates/{ => rooms}/edit_room.html (98%) rename templates/{ => rooms}/room.html (99%) rename templates/{ => rooms}/room_members.html (99%) rename templates/{ => rooms}/rooms.html (99%) rename templates/{ => starred}/starred.html (96%) rename templates/{ => trash}/trash.html (96%) diff --git a/routes/__init__.py b/routes/__init__.py index 1a2087c..1bbbb03 100644 --- a/routes/__init__.py +++ b/routes/__init__.py @@ -26,7 +26,7 @@ def init_app(app: Flask): @app.route('/rooms//trash') @login_required def trash_page(room_id): - return render_template('trash.html') + return render_template('trash/trash.html') return app diff --git a/routes/__pycache__/__init__.cpython-313.pyc b/routes/__pycache__/__init__.cpython-313.pyc index 4bf5c4d9d7ce31faf4c321c0acc65a4a82a2883b..3bc641f57282ed6da5b60ac3e1f8cd7bf934ecec 100644 GIT binary patch delta 82 zcmeC;q4CITXKKd>;e8c*hDtp@H delta 75 zcmbQr-N()MnU|M~0SJn37-jrr-pF^EiIHpa3#L|KexP6j!xuIN0r?ppCZrunU|M~0SG?6HOg4Ek@p%48-HSHNrwL9CoI1h?@hkXdV}+VyuoFD!wVdS zoAiYz~XSd;hhodN*$kT076 delta 133 zcmbOt-yzTYnU|M~0SF#T8e}Zk$a{^2k!$ixmS0SF872$zs88l$+rTlS<}$y|1rD9f zN7*u27^nsY`pEUjjyTU`*b+U((@&IspCuJHBem{E6`U+)5k-sB6u{fs=5GyMF7`GMv(FnnQS z5Riw^7q3V&o`WJRcw|G)y|PQDNzDxeG3D*F*AsJr=Vzzjw<-6DCQO91gMN00yj diff --git a/routes/__pycache__/rooms.cpython-313.pyc b/routes/__pycache__/rooms.cpython-313.pyc index e9290d208b7e972d00f56ae1eb52bc430635836f..d5674e930d55628f96828579c9d2140700407a61 100644 GIT binary patch delta 408 zcmcar^rwjTGcPX}0}w2IXOt1Yk(ZZ^U7#pGKet$avNYRA#_f}N+1GPlkk;K0dXd}f z0*lw;W9-cAVh|OZk8>?yg<%%I9I2q;`;R0ONzV{~MO8>{qz1;qcL09U7RnNbt0j+ar;lL@X+ c>jMifqvvENi#0-?2y1{gu!t~vPO^*w0J%kYjQ{`u delta 364 zcmexUbgPK>GcPX}0}zNWG0bq>$ji&d$TeA!?IYv1$-?aGxn|g`D80z-a)HHV@mY3e zMuE*&xRx+->TYnk$ZdIn#d32aPa6{>=VU(qJ4|;NCLh$0njB!pIhkKzmf{TS6(JWQ zlRq#pcrXPq0jWZ!DyEMN3_R5!4r?{j=F=*sv( zjDd-(U9M4X0_OtP6=nH diff --git a/routes/auth.py b/routes/auth.py index 5690b5f..f6c96d4 100644 --- a/routes/auth.py +++ b/routes/auth.py @@ -22,7 +22,7 @@ def init_routes(auth_bp): login_user(user, remember=remember) return redirect(url_for('main.dashboard')) - return render_template('login.html') + return render_template('auth/login.html') @auth_bp.route('/register', methods=['GET', 'POST']) def register(): @@ -53,7 +53,7 @@ def init_routes(auth_bp): flash('Registration successful! Please login.', 'success') return redirect(url_for('auth.login')) - return render_template('register.html') + return render_template('auth/register.html') @auth_bp.route('/logout') @login_required diff --git a/routes/main.py b/routes/main.py index 40eae0c..9e00e9a 100644 --- a/routes/main.py +++ b/routes/main.py @@ -237,7 +237,7 @@ def init_routes(main_bp): RoomFile.deleted==True ).group_by('extension').all() - return render_template('dashboard.html', + return render_template('dashboard/dashboard.html', recent_contacts=recent_contacts, active_count=active_count, inactive_count=inactive_count, @@ -279,7 +279,7 @@ def init_routes(main_bp): existing_user = User.query.filter_by(email=new_email).first() if existing_user: flash('A user with this email already exists.', 'error') - return render_template('profile.html') + return render_template('profile/profile.html') # Handle profile picture upload file = request.files.get('profile_picture') if file and file.filename: @@ -301,7 +301,7 @@ def init_routes(main_bp): if new_password: if new_password != confirm_password: flash('Passwords do not match.', 'error') - return render_template('profile.html') + return render_template('profile/profile.html') current_user.set_password(new_password) flash('Password updated successfully.', 'success') try: @@ -311,14 +311,14 @@ def init_routes(main_bp): db.session.rollback() flash('An error occurred while updating your profile.', 'error') return redirect(url_for('main.profile')) - return render_template('profile.html') + return render_template('profile/profile.html') @main_bp.route('/starred') @login_required def starred(): - return render_template('starred.html') + return render_template('starred/starred.html') @main_bp.route('/trash') @login_required def trash(): - return render_template('trash.html') \ No newline at end of file + return render_template('trash/trash.html') \ No newline at end of file diff --git a/routes/rooms.py b/routes/rooms.py index 1f30b20..c60ab42 100644 --- a/routes/rooms.py +++ b/routes/rooms.py @@ -17,7 +17,7 @@ def rooms(): if search: query = query.filter(Room.name.ilike(f'%{search}%')) rooms = query.order_by(Room.created_at.desc()).all() - return render_template('rooms.html', rooms=rooms, search=search) + return render_template('rooms/rooms.html', rooms=rooms, search=search) @rooms_bp.route('/create', methods=['GET', 'POST']) @login_required @@ -46,7 +46,7 @@ def create_room(): flash('Room created successfully!', 'success') return redirect(url_for('rooms.rooms')) - return render_template('create_room.html', form=form) + return render_template('rooms/create_room.html', form=form) @rooms_bp.route('/') @login_required @@ -64,7 +64,7 @@ def room(room_id): can_rename = user_has_permission(room, 'can_rename') can_move = user_has_permission(room, 'can_move') can_share = user_has_permission(room, 'can_share') - return render_template('room.html', room=room, can_download=can_download, can_upload=can_upload, can_delete=can_delete, can_rename=can_rename, can_move=can_move, can_share=can_share) + return render_template('rooms/room.html', room=room, can_download=can_download, can_upload=can_upload, can_delete=can_delete, can_rename=can_rename, can_move=can_move, can_share=can_share) @rooms_bp.route('//members') @login_required @@ -81,7 +81,7 @@ def room_members(room_id): return redirect(url_for('rooms.room', room_id=room_id)) member_permissions = {p.user_id: p for p in room.member_permissions} available_users = User.query.filter(~User.id.in_(member_permissions.keys())).all() - return render_template('room_members.html', room=room, available_users=available_users, member_permissions=member_permissions) + return render_template('rooms/room_members.html', room=room, available_users=available_users, member_permissions=member_permissions) @rooms_bp.route('//members/add', methods=['POST']) @login_required @@ -181,7 +181,7 @@ def edit_room(room_id): form.name.data = room.name form.description.data = room.description - return render_template('edit_room.html', form=form, room=room) + return render_template('rooms/edit_room.html', form=form, room=room) @rooms_bp.route('//delete', methods=['POST']) @login_required diff --git a/templates/login.html b/templates/auth/login.html similarity index 100% rename from templates/login.html rename to templates/auth/login.html diff --git a/templates/register.html b/templates/auth/register.html similarity index 100% rename from templates/register.html rename to templates/auth/register.html diff --git a/templates/base.html b/templates/common/base.html similarity index 100% rename from templates/base.html rename to templates/common/base.html diff --git a/templates/macros.html b/templates/common/macros.html similarity index 100% rename from templates/macros.html rename to templates/common/macros.html diff --git a/templates/components/storage_overview.html b/templates/components/storage_overview.html index f16dc3e..07aabf4 100644 --- a/templates/components/storage_overview.html +++ b/templates/components/storage_overview.html @@ -1,4 +1,4 @@ -{% from 'macros.html' import format_size %} +{% from 'common/macros.html' import format_size %} {% macro storage_overview(room_count, file_count, folder_count, total_size) %}
diff --git a/templates/components/storage_usage.html b/templates/components/storage_usage.html index 6641211..aa3005d 100644 --- a/templates/components/storage_usage.html +++ b/templates/components/storage_usage.html @@ -1,4 +1,4 @@ -{% from 'macros.html' import format_size %} +{% from 'common/macros.html' import format_size %} {% macro storage_usage(storage_by_type) %}
diff --git a/templates/components/trash.html b/templates/components/trash.html index b8faafa..c68fd69 100644 --- a/templates/components/trash.html +++ b/templates/components/trash.html @@ -1,4 +1,4 @@ -{% from 'macros.html' import format_size %} +{% from 'common/macros.html' import format_size %} {% macro trash(trash_count, pending_deletion, oldest_trash_date, trash_size) %}
diff --git a/templates/contacts.html b/templates/contacts/contacts.html similarity index 83% rename from templates/contacts.html rename to templates/contacts/contacts.html index b98334f..1906e2f 100644 --- a/templates/contacts.html +++ b/templates/contacts/contacts.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "common/base.html" %} {% block title %}Contacts - DocuPulse{% endblock %} diff --git a/templates/contacts/form.html b/templates/contacts/form.html index 6814beb..7574a66 100644 --- a/templates/contacts/form.html +++ b/templates/contacts/form.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "common/base.html" %} {% block content %}
diff --git a/templates/contacts/list.html b/templates/contacts/list.html index da32ced..a56122f 100644 --- a/templates/contacts/list.html +++ b/templates/contacts/list.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "common/base.html" %} {% block head %} {{ super() }} diff --git a/templates/dashboard.html b/templates/dashboard/dashboard.html similarity index 99% rename from templates/dashboard.html rename to templates/dashboard/dashboard.html index f1b4e85..2e3976f 100644 --- a/templates/dashboard.html +++ b/templates/dashboard/dashboard.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "common/base.html" %} {% block title %}Dashboard - DocuPulse{% endblock %} diff --git a/templates/profile.html b/templates/profile/profile.html similarity index 99% rename from templates/profile.html rename to templates/profile/profile.html index 6bc28f9..45840af 100644 --- a/templates/profile.html +++ b/templates/profile/profile.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "common/base.html" %} {% block title %}Profile - DocuPulse{% endblock %} diff --git a/templates/create_room.html b/templates/rooms/create_room.html similarity index 98% rename from templates/create_room.html rename to templates/rooms/create_room.html index 211c909..7dce929 100644 --- a/templates/create_room.html +++ b/templates/rooms/create_room.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "common/base.html" %} {% block title %}Create Room - DocuPulse{% endblock %} diff --git a/templates/edit_room.html b/templates/rooms/edit_room.html similarity index 98% rename from templates/edit_room.html rename to templates/rooms/edit_room.html index 2d6a65c..1b89ca6 100644 --- a/templates/edit_room.html +++ b/templates/rooms/edit_room.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "common/base.html" %} {% block title %}Edit Room - {{ room.name }}{% endblock %} diff --git a/templates/room.html b/templates/rooms/room.html similarity index 99% rename from templates/room.html rename to templates/rooms/room.html index c893d00..4f3cfa8 100644 --- a/templates/room.html +++ b/templates/rooms/room.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "common/base.html" %} {% block title %}Room - DocuPulse{% endblock %} diff --git a/templates/room_members.html b/templates/rooms/room_members.html similarity index 99% rename from templates/room_members.html rename to templates/rooms/room_members.html index a9e96e5..550691c 100644 --- a/templates/room_members.html +++ b/templates/rooms/room_members.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "common/base.html" %} {% block title %}Room Members - {{ room.name }}{% endblock %} diff --git a/templates/rooms.html b/templates/rooms/rooms.html similarity index 99% rename from templates/rooms.html rename to templates/rooms/rooms.html index 76b016c..b7abe35 100644 --- a/templates/rooms.html +++ b/templates/rooms/rooms.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "common/base.html" %} {% block title %}Rooms - DocuPulse{% endblock %} diff --git a/templates/starred.html b/templates/starred/starred.html similarity index 96% rename from templates/starred.html rename to templates/starred/starred.html index 528cd54..db0a838 100644 --- a/templates/starred.html +++ b/templates/starred/starred.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "common/base.html" %} {% block title %}Starred - DocuPulse{% endblock %} diff --git a/templates/trash.html b/templates/trash/trash.html similarity index 96% rename from templates/trash.html rename to templates/trash/trash.html index 2c8faae..a1f8841 100644 --- a/templates/trash.html +++ b/templates/trash/trash.html @@ -1,4 +1,4 @@ -{% extends "base.html" %} +{% extends "common/base.html" %} {% block title %}Trash - DocuPulse{% endblock %}