diff --git a/.env.example b/.env.example index b74e45c..1836796 100644 --- a/.env.example +++ b/.env.example @@ -14,6 +14,8 @@ REDLIB_PUSHSHIFT_FRONTEND=undelete.pullpush.io # Default user settings # Set the default theme (options: system, light, dark, black, dracula, nord, laserwave, violet, gold, rosebox, gruvboxdark, gruvboxlight) REDLIB_DEFAULT_THEME=system +# Set the default mascot +REDLIB_DEFAULT_MASCOT=none # 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/config.rs b/src/config.rs index e345537..22ed70a 100644 --- a/src/config.rs +++ b/src/config.rs @@ -28,6 +28,10 @@ pub struct Config { #[serde(alias = "LIBREDDIT_DEFAULT_THEME")] pub(crate) default_theme: Option, + #[serde(rename = "REDLIB_DEFAULT_MASCOT")] + #[serde(alias = "LIBREDDIT_DEFAULT_MASCOT")] + pub(crate) default_mascot: Option, + #[serde(rename = "REDLIB_DEFAULT_FRONT_PAGE")] #[serde(alias = "LIBREDDIT_DEFAULT_FRONT_PAGE")] pub(crate) default_front_page: Option, @@ -121,6 +125,7 @@ impl Config { Self { sfw_only: parse("REDLIB_SFW_ONLY"), default_theme: parse("REDLIB_DEFAULT_THEME"), + default_mascot: parse("REDLIB_DEFAULT_MASCOT"), default_front_page: parse("REDLIB_DEFAULT_FRONT_PAGE"), default_layout: parse("REDLIB_DEFAULT_LAYOUT"), default_post_sort: parse("REDLIB_DEFAULT_POST_SORT"), @@ -146,6 +151,7 @@ fn get_setting_from_config(name: &str, config: &Config) -> Option { match name { "REDLIB_SFW_ONLY" => config.sfw_only.clone(), "REDLIB_DEFAULT_THEME" => config.default_theme.clone(), + "REDLIB_DEFAULT_MASCOT" => config.default_mascot.clone(), "REDLIB_DEFAULT_FRONT_PAGE" => config.default_front_page.clone(), "REDLIB_DEFAULT_LAYOUT" => config.default_layout.clone(), "REDLIB_DEFAULT_COMMENT_SORT" => config.default_comment_sort.clone(), diff --git a/src/instance_info.rs b/src/instance_info.rs index 462e09c..a798d89 100644 --- a/src/instance_info.rs +++ b/src/instance_info.rs @@ -136,6 +136,7 @@ impl InstanceInfo { ["Hide awards", &convert(&self.config.default_hide_awards)], ["Hide score", &convert(&self.config.default_hide_score)], ["Theme", &convert(&self.config.default_theme)], + ["Mascot", &convert(&self.config.default_mascot)], ["Front page", &convert(&self.config.default_front_page)], ["Layout", &convert(&self.config.default_layout)], ["Wide", &convert(&self.config.default_wide)], @@ -168,6 +169,7 @@ impl InstanceInfo { Hide awards: {:?}\n Hide score: {:?}\n Default theme: {:?}\n + Default mascot: {:?}\n Default front page: {:?}\n Default layout: {:?}\n Default wide: {:?}\n @@ -190,6 +192,7 @@ impl InstanceInfo { self.config.default_hide_awards, self.config.default_hide_score, self.config.default_theme, + self.config.default_mascot, self.config.default_front_page, self.config.default_layout, self.config.default_wide, diff --git a/templates/settings.html b/templates/settings.html index 48ec089..b487a35 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -153,7 +153,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.