From 8158b70c2019b7ed38060977741c3064b47e2475 Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 19 Feb 2023 11:20:16 +0200 Subject: [PATCH] apparently cardview toggle got removed from the settings, so might as well remove it from the code --- files/classes/user.py | 1 - files/routes/settings.py | 1 - files/templates/submission_listing.html | 14 ++++---------- migrations/20230219-remove-card-view.sql | 1 + schema.sql | 2 -- seed-db.sql | 10 +++++----- 6 files changed, 10 insertions(+), 19 deletions(-) create mode 100644 migrations/20230219-remove-card-view.sql diff --git a/files/classes/user.py b/files/classes/user.py index d545ebc91..9a5ee9d5a 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -73,7 +73,6 @@ class User(Base): titlecolor = Column(String, default=DEFAULT_COLOR) theme = Column(String, default=DEFAULT_THEME) themecolor = Column(String, default=DEFAULT_COLOR) - cardview = Column(Boolean, default=False) song = Column(String) highres = Column(String) profileurl = Column(String) diff --git a/files/routes/settings.py b/files/routes/settings.py index e064b0521..67cb1bd57 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -179,7 +179,6 @@ def settings_personal_post(v): return profanity_filter_updated updated = updated or update_flag("hidevotedon", "hidevotedon") - updated = updated or update_flag("cardview", "cardview") updated = updated or update_flag("newtab", "newtab") updated = updated or update_flag("newtabexternal", "newtabexternal") updated = updated or update_flag("nitter", "nitter") diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index d10e922de..27d4675d1 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -222,24 +222,18 @@ {% endif %} - {% if p.is_image and not p.over_18 and ((v and v.cardview)) %} -
- - Unable to load image - -
- {% elif p.is_video %} -
+ {% if p.is_video %} +

{% elif p.is_audio %} -
+
{% elif p.is_youtube %} -
+
{{p.embed | safe}}
{% endif %} diff --git a/migrations/20230219-remove-card-view.sql b/migrations/20230219-remove-card-view.sql new file mode 100644 index 000000000..c20508e3f --- /dev/null +++ b/migrations/20230219-remove-card-view.sql @@ -0,0 +1 @@ +alter table users drop column cardview; diff --git a/schema.sql b/schema.sql index a69bc53d4..6c4f18baf 100644 --- a/schema.sql +++ b/schema.sql @@ -983,7 +983,6 @@ CREATE TABLE public.users ( controversial boolean DEFAULT false NOT NULL, background character varying(40), verified character varying(100), - cardview boolean NOT NULL, received_award_count integer DEFAULT 0 NOT NULL, nitter boolean, truescore integer DEFAULT 0 NOT NULL, @@ -2805,4 +2804,3 @@ ALTER TABLE ONLY public.comments -- -- PostgreSQL database dump complete -- - diff --git a/seed-db.sql b/seed-db.sql index 2e894e7e3..6dcb325aa 100644 --- a/seed-db.sql +++ b/seed-db.sql @@ -1,24 +1,24 @@ INSERT INTO public.users ( username, passhash, created_utc, admin_level, over_18, is_activated, original_username, defaultsorting, defaultsortingcomments, defaulttime, namecolor, titlecolor, theme, themecolor, - cardview, reddit, pronouns, verified, profileurl, highres, + reddit, pronouns, verified, profileurl, highres, marsify, last_viewed_post_notifs, last_viewed_log_notifs, last_viewed_reddit_notifs ) VALUES ('AutoJanny', '', extract(epoch from now()), 0, true, true, 'AutoJanny', 'hot', 'top', 'day', 'ff66ac', 'ff66ac', 'dark', 'ff66ac', - false, 'old.reddit.com', 'clean/itup', 'Verified', '/i/pfps/1.webp', '/i/pfps/1.webp', + 'old.reddit.com', 'clean/itup', 'Verified', '/i/pfps/1.webp', '/i/pfps/1.webp', 0, 0, 0, 0), ('Snappy', '', extract(epoch from now()), 0, true, true, 'Snappy', 'hot', 'top', 'day', '62ca56', 'e4432d', 'dark', '30409f', - false, 'old.reddit.com', 'beep/boop', 'Verified', '/i/pfps/2.webp', '/i/pfps/2.webp', + 'old.reddit.com', 'beep/boop', 'Verified', '/i/pfps/2.webp', '/i/pfps/2.webp', 0, 0, 0, 0), ('longpostbot', '', extract(epoch from now()), 0, true, true, 'longpostbot', 'hot', 'top', 'day', '62ca56', 'e4432d', 'dark', '30409f', - false, 'old.reddit.com', 'tl/dr', 'Verified', '/i/pfps/3.webp', '/i/pfps/3.webp', + 'old.reddit.com', 'tl/dr', 'Verified', '/i/pfps/3.webp', '/i/pfps/3.webp', 0, 0, 0, 0), ('zozbot', '', extract(epoch from now()), 0, true, true, 'zozbot', 'hot', 'top', 'day', '62ca56', 'e4432d', 'dark', '30409f', - false, 'old.reddit.com', 'zoz/zle', 'Verified', '/i/pfps/4.webp', '/i/pfps/4.webp', + 'old.reddit.com', 'zoz/zle', 'Verified', '/i/pfps/4.webp', '/i/pfps/4.webp', 0, 0, 0, 0); --