nsfw_landing style & function changes

theme the NSFW title and allow the user to directly change their setting
This commit is contained in:
ayaka 2024-06-27 17:43:43 +12:00
parent f398d16c22
commit 60c0d63583
2 changed files with 12 additions and 3 deletions

View File

@ -1634,6 +1634,14 @@ td, th {
color: var(--accent); color: var(--accent);
} }
.nsfw-tag {
color: var(--nsfw);
border: 2px solid var(--nsfw);
padding: 3px;
border-radius: 5px;
font-weight: bold;
}
/* Mobile */ /* Mobile */
@media screen and (max-width: 800px) { @media screen and (max-width: 800px) {

View File

@ -6,11 +6,11 @@
<h1> <h1>
&#128561; &#128561;
{% if res_type == crate::utils::ResourceType::Subreddit %} {% if res_type == crate::utils::ResourceType::Subreddit %}
r/{{ res }} is a NSFW community! r/{{ res }} is a <b class="nsfw-tag">NSFW</b> community!
{% else if res_type == crate::utils::ResourceType::User %} {% else if res_type == crate::utils::ResourceType::User %}
u/{{ res }}'s content is NSFW! u/{{ res }}'s content is <b class="nsfw-tag">NSFW</b>!
{% else if res_type == crate::utils::ResourceType::Post %} {% else if res_type == crate::utils::ResourceType::Post %}
This post is NSFW! This post is <b class="nsfw-tag">NSFW</b>!
{% endif %} {% endif %}
</h1> </h1>
<br /> <br />
@ -20,6 +20,7 @@
This instance of Redlib is SFW-only.</p> This instance of Redlib is SFW-only.</p>
{% else %} {% else %}
Enable "Show NSFW posts" in <a href="/settings">settings</a> to view this {% if res_type == crate::utils::ResourceType::Subreddit %}subreddit{% else if res_type == crate::utils::ResourceType::User %}user's posts or comments{% else if res_type == crate::utils::ResourceType::Post %}post{% endif %}. <br> Enable "Show NSFW posts" in <a href="/settings">settings</a> to view this {% if res_type == crate::utils::ResourceType::Subreddit %}subreddit{% else if res_type == crate::utils::ResourceType::User %}user's posts or comments{% else if res_type == crate::utils::ResourceType::Post %}post{% endif %}. <br>
<div>Alternatively <a href="/settings/update/?show_nsfw=on&redirect={{self.url[1..self.url.len()]}}">enable NSFW posts</a> now and view this {% if res_type == crate::utils::ResourceType::Subreddit %}subreddit{% else if res_type == crate::utils::ResourceType::User %}profile{% else if res_type == crate::utils::ResourceType::Post %}post{% endif %} immediately</div>
{% if res_type == crate::utils::ResourceType::Post %} You can also temporarily bypass this gate and view the post by clicking on this <a href="{{url}}&bypass_nsfw_landing">link</a>.{% endif %} {% if res_type == crate::utils::ResourceType::Post %} You can also temporarily bypass this gate and view the post by clicking on this <a href="{{url}}&bypass_nsfw_landing">link</a>.{% endif %}
{% endif %} {% endif %}
</p> </p>