Filter subreddits and users (#317)

* Initial work on filtering subreddits and users

* Fix doubly-prefixed subreddit name in search alt text (e.g. r/r/pics)

* Don't set post title to "Comment" if empty - this could throw off actual posts with the title "Comment"

* Filter search results

* Fix filtering to differentiate between "this subject itself is filtered" vs "all posts on this current page have been filtered"

* Remove unnecessary check

* Clean up

* Cargo format

* Collapse comments from filtered users

Co-authored-by: spikecodes <19519553+spikecodes@users.noreply.github.com>
This commit is contained in:
Nick Lowery 2021-11-25 21:02:04 -07:00 committed by GitHub
parent beada1f2b2
commit 888e7b302d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 374 additions and 143 deletions

View file

@ -372,7 +372,7 @@ aside {
margin-bottom: 20px;
}
#user_details, #sub_details {
#user_details, #sub_details, #sub_actions, #user_actions {
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-column-gap: 20px;
@ -384,7 +384,7 @@ aside {
/* Subscriptions */
#sub_subscription, #user_subscription {
#sub_subscription, #user_subscription, #user_filter, #sub_filter {
margin-top: 20px;
}
@ -392,18 +392,18 @@ aside {
margin-bottom: 20px;
}
.subscribe, .unsubscribe {
.subscribe, .unsubscribe, .filter, .unfilter {
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
}
.subscribe {
.subscribe, .filter {
color: var(--foreground);
background-color: var(--accent);
}
.unsubscribe {
.unsubscribe, .unfilter {
color: var(--text);
background-color: var(--highlighted);
}
@ -1042,7 +1042,7 @@ a.search_subreddit:hover {
overflow: auto;
}
.comment_body.highlighted {
.comment_body.highlighted, .comment_body_filtered.highlighted {
background: var(--highlighted);
}
@ -1055,6 +1055,15 @@ a.search_subreddit:hover {
color: var(--accent);
}
.comment_body_filtered {
opacity: 0.4;
font-weight: normal;
font-style: italic;
padding: 5px 5px;
margin: 5px 0;
overflow: auto;
}
.deeper_replies {
color: var(--accent);
margin-left: 15px;
@ -1226,6 +1235,14 @@ input[type="submit"] {
color: var(--accent);
}
#settings_filters .unsubscribe {
margin-left: 30px;
}
#settings_filters a {
color: var(--accent);
}
.helper {
padding: 10px;
width: 250px;