From f33842ead36dba7e635ade7c6ac3cf8bcd45d892 Mon Sep 17 00:00:00 2001 From: Fluffy-Bean Date: Thu, 6 Apr 2023 16:22:56 +0000 Subject: [PATCH] Move views/routes to seperate files --- gallery/__init__.py | 13 ++- gallery/{views => }/api.py | 0 gallery/templates/{groups => }/group.html | 8 +- gallery/templates/image.html | 5 +- gallery/templates/index.html | 2 +- gallery/templates/layout.html | 2 +- gallery/templates/{groups => }/list.html | 0 gallery/templates/profile.html | 2 +- gallery/views/{groups.py => group.py} | 4 +- gallery/views/image.py | 59 +++++++++++++ gallery/views/index.py | 30 +++++++ gallery/views/profile.py | 39 +++++++++ gallery/views/routing.py | 102 ---------------------- 13 files changed, 150 insertions(+), 116 deletions(-) rename gallery/{views => }/api.py (100%) rename gallery/templates/{groups => }/group.html (96%) rename gallery/templates/{groups => }/list.html (100%) rename gallery/views/{groups.py => group.py} (97%) create mode 100644 gallery/views/image.py create mode 100644 gallery/views/index.py create mode 100644 gallery/views/profile.py delete mode 100644 gallery/views/routing.py diff --git a/gallery/__init__.py b/gallery/__init__.py index 71ff39e..8746fc4 100644 --- a/gallery/__init__.py +++ b/gallery/__init__.py @@ -114,11 +114,16 @@ def create_app(test_config=None): from gallery import auth app.register_blueprint(auth.blueprint) - # Load the different routes - from gallery.views import api, groups, routing, settings + # Load the API + from gallery import api app.register_blueprint(api.blueprint) - app.register_blueprint(groups.blueprint) - app.register_blueprint(routing.blueprint) + + # Load the different views + from gallery.views import index, image, group, settings, profile + app.register_blueprint(index.blueprint) + app.register_blueprint(image.blueprint) + app.register_blueprint(group.blueprint) + app.register_blueprint(profile.blueprint) app.register_blueprint(settings.blueprint) # Log to file that the app has started diff --git a/gallery/views/api.py b/gallery/api.py similarity index 100% rename from gallery/views/api.py rename to gallery/api.py diff --git a/gallery/templates/groups/group.html b/gallery/templates/group.html similarity index 96% rename from gallery/templates/groups/group.html rename to gallery/templates/group.html index 0223f47..3756d16 100644 --- a/gallery/templates/groups/group.html +++ b/gallery/templates/group.html @@ -185,11 +185,13 @@ } .banner-filter { - background: linear-gradient(90deg, rgb({{ images.0.colours.0.0 }}, {{ images.0.colours.0.1 }}, {{ images.0.colours.0.2 }}), rgba({{ images.0.colours.0.0 }}, {{ images.0.colours.0.1 }}, {{ images.0.colours.0.2 }}, 0.3)) !important; + background: linear-gradient(90deg, rgb({{ images.0.colours.0.0 }}, {{ images.0.colours.0.1 }}, {{ images.0.colours.0.2 }}), + rgba({{ images.0.colours.1.0 }}, {{ images.0.colours.1.1 }}, {{ images.0.colours.1.2 }}, 0.3)) !important; } @media (max-width: 800px) { .banner-filter { - background: linear-gradient(180deg, rgba({{ images.0.colours.0.0 }}, {{ images.0.colours.0.1 }}, {{ images.0.colours.0.2 }}, 0.8), rgba({{ images.0.colours.0.0 }}, {{ images.0.colours.0.1 }}, {{ images.0.colours.0.2 }}, 0.5)) !important; + background: linear-gradient(180deg, rgba({{ images.0.colours.0.0 }}, {{ images.0.colours.0.1 }}, {{ images.0.colours.0.2 }}, 0.8), + rgba({{ images.0.colours.1.0 }}, {{ images.0.colours.1.1 }}, {{ images.0.colours.1.2 }}, 0.5)) !important; } } @@ -212,7 +214,7 @@