From 10c7327c39b24b1a3df280518f84f672aa9b4234 Mon Sep 17 00:00:00 2001 From: ayaka Date: Mon, 6 Jan 2025 07:15:24 +1300 Subject: [PATCH 1/4] colorway toggle --- .env.example | 2 ++ src/settings.rs | 3 ++- src/utils.rs | 2 ++ templates/base.html | 4 +++- templates/settings.html | 7 ++++++- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index b63be36..5ba6d05 100644 --- a/.env.example +++ b/.env.example @@ -16,6 +16,8 @@ REDLIB_PUSHSHIFT_FRONTEND=undelete.pullpush.io REDLIB_DEFAULT_THEME=system # Set the default mascot REDLIB_DEFAULT_MASCOT=none +# Enable showing redsublib colorway by default +REDLIB_DEFAULT_REDSUBLIB_COLORWAY=off # Set the default front page (options: default, popular, all) REDLIB_DEFAULT_FRONT_PAGE=default # Set the default layout (options: card, clean, compact) diff --git a/src/settings.rs b/src/settings.rs index c7882a1..84db59f 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -21,9 +21,10 @@ struct SettingsTemplate { // CONSTANTS -const PREFS: [&str; 20] = [ +const PREFS: [&str; 21] = [ "theme", "mascot", + "redsublib_colorway", "front_page", "layout", "wide", diff --git a/src/utils.rs b/src/utils.rs index 5b72a89..0e019f2 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -607,6 +607,7 @@ pub struct Preferences { pub available_mascots: Vec, pub theme: String, pub mascot: String, + pub redsublib_colorway: String, pub front_page: String, pub layout: String, pub wide: String, @@ -661,6 +662,7 @@ impl Preferences { available_mascots: mascots, theme: setting(req, "theme"), mascot: setting(req, "mascot"), + redsublib_colorway: setting(req, "redsublib_colorway"), front_page: setting(req, "front_page"), layout: setting(req, "layout"), wide: setting(req, "wide"), diff --git a/templates/base.html b/templates/base.html index d71b337..00756d6 100644 --- a/templates/base.html +++ b/templates/base.html @@ -40,7 +40,9 @@ From 5959464bbe02629d872f66702f064d49b39b8efb Mon Sep 17 00:00:00 2001 From: ayaka Date: Mon, 6 Jan 2025 08:04:41 +1300 Subject: [PATCH 3/4] fix typo, lol.. --- .env.example | 4 ++-- src/settings.rs | 2 +- src/utils.rs | 4 ++-- templates/base.html | 2 +- templates/settings.html | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.env.example b/.env.example index 5ba6d05..81d034a 100644 --- a/.env.example +++ b/.env.example @@ -16,8 +16,8 @@ REDLIB_PUSHSHIFT_FRONTEND=undelete.pullpush.io REDLIB_DEFAULT_THEME=system # Set the default mascot REDLIB_DEFAULT_MASCOT=none -# Enable showing redsublib colorway by default -REDLIB_DEFAULT_REDSUBLIB_COLORWAY=off +# Enable showing redsunlib colorway by default +REDLIB_DEFAULT_REDSUNLIB_COLORWAY=off # Set the default front page (options: default, popular, all) REDLIB_DEFAULT_FRONT_PAGE=default # Set the default layout (options: card, clean, compact) diff --git a/src/settings.rs b/src/settings.rs index 84db59f..6b65b40 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -24,7 +24,7 @@ struct SettingsTemplate { const PREFS: [&str; 21] = [ "theme", "mascot", - "redsublib_colorway", + "redsunlib_colorway", "front_page", "layout", "wide", diff --git a/src/utils.rs b/src/utils.rs index 0e019f2..32f73a7 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -607,7 +607,7 @@ pub struct Preferences { pub available_mascots: Vec, pub theme: String, pub mascot: String, - pub redsublib_colorway: String, + pub redsunlib_colorway: String, pub front_page: String, pub layout: String, pub wide: String, @@ -662,7 +662,7 @@ impl Preferences { available_mascots: mascots, theme: setting(req, "theme"), mascot: setting(req, "mascot"), - redsublib_colorway: setting(req, "redsublib_colorway"), + redsunlib_colorway: setting(req, "redsunlib_colorway"), front_page: setting(req, "front_page"), layout: setting(req, "layout"), wide: setting(req, "wide"), diff --git a/templates/base.html b/templates/base.html index e63569d..68e2eb8 100644 --- a/templates/base.html +++ b/templates/base.html @@ -41,7 +41,7 @@ {% if prefs.fixed_navbar == "on" %} fixed_navbar{% endif %}"> diff --git a/templates/settings.html b/templates/settings.html index 25822dc..861a9ca 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -30,9 +30,9 @@
- - - + + +
@@ -158,7 +158,7 @@

Note: settings and subscriptions are saved in browser cookies. Clearing your cookies will reset them.


-

You can restore your current settings and subscriptions after clearing your cookies using this link.

+

You can restore your current settings and subscriptions after clearing your cookies using this link.

{% if prefs.subscriptions.len() > 0 %}
From e94d07274dc03d835c46d5ed4fd3557294f4b25d Mon Sep 17 00:00:00 2001 From: Ayaka Date: Mon, 6 Jan 2025 09:38:08 +1300 Subject: [PATCH 4/4] gimmick for "style-gimmicks" --- static/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/style.css b/static/style.css index cdc814f..85d8f46 100644 --- a/static/style.css +++ b/static/style.css @@ -218,7 +218,7 @@ nav #links { nav #links svg { /*display: none;*/ position: relative; - top: 21%; + /*What's nine plus ten?*/ top: /*Twenty one*/21%; /*You stupid.*/ } nav #redlib {