create adult_content configuration option

This commit is contained in:
edshot99 2024-11-14 18:54:56 -06:00
parent b0e263d36e
commit b62770fa3d
5 changed files with 13 additions and 3 deletions

View File

@ -6,7 +6,9 @@
<link rel="manifest" href="/manifest.json">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#00549e">
<meta name="theme-color" content="#00549e">
<meta name="RATING" content="RTA-5042-1996-1400-1577-RTA" />
<% if Danbooru.config.adult_content? %>
<meta name="RATING" content="RTA-5042-1996-1400-1577-RTA" />
<% end %>
<link rel="top" title="<%= Danbooru.config.app_name %>" href="/">
<%= csrf_meta_tag %>
<% unless disable_mobile_mode? %>

View File

@ -7,6 +7,10 @@
<% if @post_set.has_explicit? %>
<meta name="rating" content="adult">
<% unless Danbooru.config.adult_content? %>
<meta name="RATING" content="RTA-5042-1996-1400-1577-RTA" />
<% end %>
<% end %>
<%= tag.meta name: "canonical", content: posts_url(tags: params[:tags], host: Danbooru.config.hostname, protocol: "https") %>

View File

@ -318,6 +318,10 @@
<% if @post.rating == "e" %>
<meta name="rating" content="adult">
<% unless Danbooru.config.adult_content? %>
<meta name="RATING" content="RTA-5042-1996-1400-1577-RTA" />
<% end %>
<% end %>
<% end %>

View File

@ -1,4 +1,4 @@
<% if Danbooru.config.guest_warning? %>
<% if Danbooru.config.adult_content? %>
<div class="guest-warning" style="display: none;">
<div class="guest-warning-dialog">
<h1 class="dialog-header">Over 18?</h1>

View File

@ -29,7 +29,7 @@ module Danbooru
false
end
def guest_warning?
def adult_content?
true
end