From 2a27850914c8a1694b64df530f2bd974278a1e7e Mon Sep 17 00:00:00 2001
From: robrobinbin <8597693+robrobinbin@users.noreply.github.com>
Date: Sun, 31 Jan 2021 19:41:32 +0100
Subject: [PATCH 1/8] Minor style tweak
on small screens, subscriptions are put below the logo, which looks a bit strange and makes it somehow harder to hit
---
static/style.css | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/static/style.css b/static/style.css
index 12d74c1..6e725bd 100644
--- a/static/style.css
+++ b/static/style.css
@@ -94,7 +94,12 @@ nav {
nav * { color: var(--text); }
nav #reddit, #code { color: var(--accent); }
-nav #logo { grid-area: logo; }
+
+nav #logo {
+ grid-area: logo;
+ white-space: nowrap;
+ margin-right: 5px;
+}
nav #links {
grid-area: links;
From c32d62fbd5661ce7c5ba206c71f7223215741d1c Mon Sep 17 00:00:00 2001
From: spikecodes <19519553+spikecodes@users.noreply.github.com>
Date: Sun, 31 Jan 2021 13:22:11 -0800
Subject: [PATCH 2/8] Shrink links to icons on mobile
---
static/style.css | 14 +++++++++++++-
templates/base.html | 10 ++++++++--
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/static/style.css b/static/style.css
index 6e725bd..60d7323 100644
--- a/static/style.css
+++ b/static/style.css
@@ -93,7 +93,8 @@ nav {
}
nav * { color: var(--text); }
-nav #reddit, #code { color: var(--accent); }
+nav #reddit, #code > span { color: var(--accent); }
+nav #code > svg { stroke: var(--accent); }
nav #logo {
grid-area: logo;
@@ -104,6 +105,11 @@ nav #logo {
nav #links {
grid-area: links;
margin-left: 10px;
+ display: flex;
+}
+
+nav #links svg {
+ display: none;
}
nav #version {
@@ -120,6 +126,10 @@ nav #libreddit {
opacity: 0.8;
}
+#code {
+ margin-left: 5px;
+}
+
main {
display: flex;
justify-content: center;
@@ -1075,6 +1085,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 7b3ddee..742f5c9 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -25,8 +25,14 @@
{% block search %}{% endblock %}
From 9a1733ac992a900f35e0f2ec0d22badfc214fee8 Mon Sep 17 00:00:00 2001
From: spikecodes <19519553+spikecodes@users.noreply.github.com>
Date: Sun, 31 Jan 2021 13:49:55 -0800
Subject: [PATCH 3/8] Fix cog class
---
templates/base.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/templates/base.html b/templates/base.html
index 742f5c9..f644a8c 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -27,7 +27,7 @@
settings
-
+
code
From 971f14bb5577407c9f37b3c8242d03dc9fa683a1 Mon Sep 17 00:00:00 2001
From: spikecodes <19519553+spikecodes@users.noreply.github.com>
Date: Sun, 31 Jan 2021 14:10:13 -0800
Subject: [PATCH 4/8] Fix #66
---
src/post.rs | 8 +++++++-
src/utils.rs | 6 +++++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/src/post.rs b/src/post.rs
index 7040de3..f53dd84 100644
--- a/src/post.rs
+++ b/src/post.rs
@@ -155,6 +155,8 @@ async fn parse_comments(json: &serde_json::Value) -> Vec {
Vec::new()
};
+ dbg!();
+
comments.push(Comment {
id: val(&comment, "id"),
body,
@@ -171,7 +173,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..fe399e7 100644
--- a/src/utils.rs
+++ b/src/utils.rs
@@ -343,7 +343,11 @@ pub async fn fetch_posts(path: &str, fallback_title: String) -> Result<(Vec
Date: Sun, 31 Jan 2021 18:50:31 -0800
Subject: [PATCH 5/8] Update version and screenshot
---
Cargo.lock | 2 +-
Cargo.toml | 2 +-
README.md | 2 +-
src/utils.rs | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
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..c0a28d9 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
> An alternative private front-end to Reddit
-
+
---
diff --git a/src/utils.rs b/src/utils.rs
index fe399e7..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(),
}
}
From 6257faf9dc199bf6ed74e7150e2c5164215c0131 Mon Sep 17 00:00:00 2001
From: spikecodes <19519553+spikecodes@users.noreply.github.com>
Date: Sun, 31 Jan 2021 19:05:06 -0800
Subject: [PATCH 6/8] Update screenshot
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index c0a28d9..2b60e65 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
> An alternative private front-end to Reddit
-
+
---
From effaeb7508a4f0d15d9bc29b9e22e90370bf8011 Mon Sep 17 00:00:00 2001
From: spikecodes <19519553+spikecodes@users.noreply.github.com>
Date: Sun, 31 Jan 2021 19:08:50 -0800
Subject: [PATCH 7/8] Fix debug logging error
---
src/post.rs | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/post.rs b/src/post.rs
index f53dd84..1b67d03 100644
--- a/src/post.rs
+++ b/src/post.rs
@@ -155,8 +155,6 @@ async fn parse_comments(json: &serde_json::Value) -> Vec {
Vec::new()
};
- dbg!();
-
comments.push(Comment {
id: val(&comment, "id"),
body,
From f6d791ccd95db8be3837c823e1fb169bde538d15 Mon Sep 17 00:00:00 2001
From: spikecodes <19519553+spikecodes@users.noreply.github.com>
Date: Sun, 31 Jan 2021 20:56:13 -0800
Subject: [PATCH 8/8] Style focus outline
---
static/style.css | 5 +++++
templates/base.html | 4 +---
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/static/style.css b/static/style.css
index 60d7323..84662f2 100644
--- a/static/style.css
+++ b/static/style.css
@@ -58,6 +58,11 @@
background: var(--accent);
}
+:focus {
+ outline: 2px solid var(--accent);
+ outline-offset: 2px;
+}
+
html, body, div, h1, h2, h3, h4, h5, h6, ul, ol, dl, li, dt, dd, p, blockquote,
pre, form, fieldset, table, th, td, select, input {
margin: 0;
diff --git a/templates/base.html b/templates/base.html
index f644a8c..cbf4b3e 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -17,9 +17,7 @@