Skip to content
This repository has been archived by the owner on Nov 7, 2022. It is now read-only.

💡 Feature request: landing page for NSFW subreddit when NSFW posts are disabled #13

Closed
Daniel-Valentine opened this issue Sep 25, 2022 · 5 comments · Fixed by #25
Closed
Labels
enhancement New feature or request
Milestone

Comments

@Daniel-Valentine
Copy link
Contributor

Builds off libreddit/libreddit#508 and #9. For subreddits that Reddit deems totally NSFW, we should have a landing page for NSFW subreddits that show nothing else but a message to tell the user to turn Show NSFW posts on if they want to view its contents. We can determine whether to do this in the JSON for /r/:subreddit/about.json, which we have to fetch anyway to show the subreddit info on the right; in that object, .data.over18 will be true.

@Daniel-Valentine Daniel-Valentine added the enhancement New feature or request label Sep 25, 2022
@sigaloid
Copy link
Contributor

Should this simply replace the code added in the PR? I doubt there will be a sub which has all posts NSFW but isn't deemed NSFW itself by reddit. And if so, I don't think it would be wrong to say "this sub is NSFW" even if technically reddit doesn't consider it NSFW. In practice they will still want to simply enable it in settings.

@Daniel-Valentine
Copy link
Contributor Author

Daniel-Valentine commented Sep 25, 2022

@sigaloid:

Should this simply replace the code added in the PR? I doubt there will be a sub which has all posts NSFW but isn't deemed NSFW itself by reddit.

Good point. That being said, if you were to do a search of just nsfw:yes on an arbitrary subreddit with Show NSFW posts disabled, libbacon will filter all posts, so that message should remain in the search page. There might be some subreddit with NSFW content that reddit doesn't deem NSFW for some reason, but I suspect those will be few and far between.

@sigaloid
Copy link
Contributor

What do you think of this banner message?

r/{{ sub.name }} is an NSFW sub, but you have "Show NSFW posts" disabled in <a href="/settings">settings</a>! Enable it to view this subreddit.

@Daniel-Valentine
Copy link
Contributor Author

Daniel-Valentine commented Sep 25, 2022

@sigaloid:

That's a good start. I'm thinking we use the wall template (templates/wall.html). Here is a POC I came up with, with a message that I based on yours:

Screenshot 2022-09-24 at 21-50-44

<!-- MAIN CONTENT -->
<main>		
	<div id="wall">
		<h1>r/:subreddit is a NSFW community</h1>
		<br />
		<p align="center">Enable "Show NSFW posts" in <a href="/settings" style="color: var(--accent)">settings</a> to view this subreddit.</p>
	</div>
</main>

Note that despite the reference to id wall in the <div>, one isn't defined in the CSS, so that will need to be defined in the CSS that would set the <p> alignment and the <a> color appropriately.

@Daniel-Valentine
Copy link
Contributor Author

Daniel-Valentine commented Sep 25, 2022

Also, I gave it some thought and I think that, in addition to implementing this new landing page, we should keep the new changes to the subreddit page that alert users when all posts have been filtered due their NSFW preferences. There is a chance, however minimal, that all 25 latest/hot posts of a normally non-NSFW posts are NSFW. Even if that's an edge case, we still want to convey to the user that those posts are hidden because they have told libbacon not to show them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants