From 13039dcf07dbae49aa59d0a9a788dd74566559aa Mon Sep 17 00:00:00 2001 From: augustin64 Date: Thu, 22 Jun 2023 16:06:48 +0200 Subject: [PATCH] Various small fixes --- partitioncloud/__init__.py | 2 +- partitioncloud/modules/admin.py | 3 +- partitioncloud/static/style.css | 17 +++++++- partitioncloud/templates/albums/album.html | 48 +++++++++++---------- partitioncloud/templates/albums/search.html | 6 +-- 5 files changed, 47 insertions(+), 29 deletions(-) diff --git a/partitioncloud/__init__.py b/partitioncloud/__init__.py index 15148eb..a76e837 100644 --- a/partitioncloud/__init__.py +++ b/partitioncloud/__init__.py @@ -4,7 +4,7 @@ Main file """ import os -from flask import Flask, g, redirect, render_template, request, send_file, flash +from flask import Flask, g, redirect, render_template, request, send_file, flash, session from werkzeug.security import generate_password_hash from .modules.utils import User, Album, get_all_albums diff --git a/partitioncloud/modules/admin.py b/partitioncloud/modules/admin.py index 924f22e..1ef1781 100644 --- a/partitioncloud/modules/admin.py +++ b/partitioncloud/modules/admin.py @@ -3,7 +3,7 @@ Admin Panel """ import os -from flask import Blueprint, abort, send_file, render_template +from flask import Blueprint, abort, send_file, render_template, session from .db import get_db from .auth import admin_required @@ -16,6 +16,7 @@ bp = Blueprint("admin", __name__, url_prefix="/admin") @admin_required def index(): current_user = User(user_id=session.get("user_id")) + current_user.get_albums() # We need to do that before we close the db db = get_db() users_id = db.execute( """ diff --git a/partitioncloud/static/style.css b/partitioncloud/static/style.css index f7f19df..f44a704 100644 --- a/partitioncloud/static/style.css +++ b/partitioncloud/static/style.css @@ -454,7 +454,7 @@ textarea { } textarea { - resize: vertical; + resize: both; } input[type="submit"] { @@ -491,6 +491,21 @@ input[type="file"] { padding: 5px 5px; } +/** Search results */ +.add-partition-form select { + width: 178px; + margin: 0px; +} + +.add-partition-form { + align-items: center; + display: grid; +} + +.add-partition-form input[type="submit"] { + margin: 5px 0; + width: 178px; +} /** Flashed messages */ .flash { diff --git a/partitioncloud/templates/albums/album.html b/partitioncloud/templates/albums/album.html index 3d2df22..1fa3e15 100644 --- a/partitioncloud/templates/albums/album.html +++ b/partitioncloud/templates/albums/album.html @@ -29,31 +29,33 @@ {% block content %}

{{ album.name }}

-
-
- {% for album_user in album.users %} - - {% endfor %} -
-

{% if partitions|length != 0 %} diff --git a/partitioncloud/templates/albums/search.html b/partitioncloud/templates/albums/search.html index ee4efa8..e886324 100644 --- a/partitioncloud/templates/albums/search.html +++ b/partitioncloud/templates/albums/search.html @@ -21,7 +21,7 @@
@@ -46,9 +46,9 @@ - +