diff --git a/Cargo.lock b/Cargo.lock index e0c0b8c..3e257f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -994,7 +994,7 @@ checksum = "1cca32fa0182e8c0989459524dc356b8f2b5c10f1b9eb521b7d182c03cf8c5ff" [[package]] name = "libreddit" -version = "0.2.8" +version = "0.2.9" dependencies = [ "actix-web", "askama", diff --git a/Cargo.toml b/Cargo.toml index 42b8bb6..63b1fec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "libreddit" description = " Alternative private front-end to Reddit" license = "AGPL-3.0" repository = "https://github.com/spikecodes/libreddit" -version = "0.2.8" +version = "0.2.9" authors = ["spikecodes <19519553+spikecodes@users.noreply.github.com>"] edition = "2018" diff --git a/README.md b/README.md index 1a03d6d..2b60e65 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > An alternative private front-end to Reddit -![screenshot](https://i.ibb.co/FxxbKM6/libreddit-rust.png) +![screenshot](https://i.ibb.co/F0JsY5K/image.png) --- diff --git a/src/post.rs b/src/post.rs index 7040de3..1b67d03 100644 --- a/src/post.rs +++ b/src/post.rs @@ -171,7 +171,11 @@ async fn parse_comments(json: &serde_json::Value) -> Vec { }, distinguished: val(&comment, "distinguished"), }, - score: format_num(score), + score: if comment["data"]["score_hidden"].as_bool().unwrap_or_default() { + "•".to_string() + } else { + format_num(score) + }, rel_time, created, replies, diff --git a/src/utils.rs b/src/utils.rs index da6ab3d..261af35 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -145,7 +145,7 @@ pub fn prefs(req: HttpRequest) -> Preferences { wide: cookie(&req, "wide"), show_nsfw: cookie(&req, "show_nsfw"), comment_sort: cookie(&req, "comment_sort"), - subs: cookie(&req, "subscriptions").split('+').map(String::from).filter(|s| s != "").collect(), + subs: cookie(&req, "subscriptions").split('+').map(String::from).filter(|s| !s.is_empty()).collect(), } } @@ -343,7 +343,11 @@ pub async fn fetch_posts(path: &str, fallback_title: String) -> Result<(Vec span { color: var(--accent); } +nav #code > svg { stroke: var(--accent); } + +nav #logo { + grid-area: logo; + white-space: nowrap; + margin-right: 5px; +} nav #links { grid-area: links; margin-left: 10px; + display: flex; +} + +nav #links svg { + display: none; } nav #version { @@ -115,6 +131,10 @@ nav #libreddit { opacity: 0.8; } +#code { + margin-left: 5px; +} + main { display: flex; justify-content: center; @@ -1070,6 +1090,8 @@ td, th { } nav #links { margin-left: auto; } + nav #links span { display: none; } + nav #links svg { display: block; } #subscriptions { position: unset; } diff --git a/templates/base.html b/templates/base.html index a2eed31..6400ebd 100644 --- a/templates/base.html +++ b/templates/base.html @@ -30,16 +30,20 @@