From c0279fa97af71ffc1000fd9c25e7f5a03ac9c135 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 3 Sep 2021 22:52:40 +0200 Subject: [PATCH] fd --- files/classes/user.py | 2 ++ files/routes/settings.py | 4 ++++ files/templates/settings_filters.html | 2 +- files/templates/settings_profile.html | 19 +++++++++++++++++++ files/templates/submission_listing.html | 18 +++++++++--------- 5 files changed, 35 insertions(+), 10 deletions(-) diff --git a/files/classes/user.py b/files/classes/user.py index 120e78fe8..e03e78b0d 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -20,6 +20,7 @@ site = environ.get("DOMAIN").strip() defaulttheme = environ.get("DEFAULT_THEME", "light").strip() defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip() defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "day").strip() +cardview = bool(int(environ.get("CARD_VIEW", 1))) class User(Base, Stndrd, Age_times): __tablename__ = "users" @@ -33,6 +34,7 @@ class User(Base, Stndrd, Age_times): titlecolor = Column(String, default=defaultcolor) theme = Column(String, default=defaulttheme) themecolor = Column(String, default=defaultcolor) + cardview = Column(Boolean, default=cardview) song = Column(String) highres = Column(String) profileurl = Column(String) diff --git a/files/routes/settings.py b/files/routes/settings.py index f8859ac93..695b782ed 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -58,6 +58,10 @@ def settings_profile_post(v): updated = True v.hidevotedon = request.values.get("hidevotedon", None) == 'true' + if request.values.get("cardview", v.cardview) != v.cardview: + updated = True + v.cardview = request.values.get("cardview", None) == 'true' + if request.values.get("newtab", v.newtab) != v.newtab: updated = True v.newtab = request.values.get("newtab", None) == 'true' diff --git a/files/templates/settings_filters.html b/files/templates/settings_filters.html index d8b0a4136..30889547a 100644 --- a/files/templates/settings_filters.html +++ b/files/templates/settings_filters.html @@ -32,7 +32,7 @@ - +
diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 84c3d3f1e..957a11c6d 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -45,6 +45,25 @@
+
+ +
+ +
+ +
+ +
+ + +
+ + Enable if you would like to display images in full size in the frontpage. + +
+ +
+
diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index 79145224c..03074f41a 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -216,18 +216,18 @@
-{% if "pcm" in request.host and p.is_image %} - +{% if p.is_image and (not v or v.cardview) %} +
+ + Unable to load image + +
{% endif %} {% if p.realbody(v) %} -
- {{p.realbody(v) | safe}} -
+
+ {{p.realbody(v) | safe}} +
{% endif %}