Files
danbooru/app/views/layouts/default.html.erb
evazion 1720246cb9 Remove Twitter/Github/Discord links from site footer.
Our new payment processor demanded that we remove our social media links
from the site. Removing these for compliance. It doesn't make sense, I know.
2022-05-10 09:56:14 -05:00

193 lines
8.1 KiB
Plaintext

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><%= page_title %></title>
<link rel="icon" href="/favicon.ico" sizes="16x16" type="image/x-icon">
<link rel="icon" href="/favicon.svg" sizes="any" type="image/svg+xml">
<%= render_meta_links @current_item if @current_item.respond_to?(:paginate) %>
<%= tag.link rel: "canonical", href: canonical_url %>
<%= tag.link rel: "search", type: "application/opensearchdescription+xml", href: opensearch_url(format: :xml, version: 2), title: "Search posts" %>
<%= csrf_meta_tag %>
<% unless CurrentUser.enable_desktop_mode? %>
<meta name="viewport" content="width=device-width,initial-scale=1">
<% end %>
<% if CurrentUser.user.blacklisted_tags.present? %>
<meta name="blacklisted-tags" content="<%= CurrentUser.user.blacklisted_tags.gsub(/(?:\r|\n)+/, ",") %>">
<% end %>
<%= tag.meta name: "autocomplete-tag-prefixes", content: AutocompleteService::TAG_PREFIXES.to_json %>
<%# XXX hack to only load Ruffle on Flash posts %>
<% if controller_name == "posts" && action_name == "show" && @post&.is_flash? %>
<%= javascript_pack_tag "application", "alpine", "flash", defer: false %>
<% else %>
<%= javascript_pack_tag "application", "alpine", defer: false %>
<% end %>
<%= stylesheet_pack_tag "application" %>
<% if CurrentUser.user.custom_style.present? && params.fetch(:css, "true").truthy? %>
<%= stylesheet_link_tag custom_style_users_path(md5: Digest::MD5.hexdigest(CurrentUser.user.custom_style)) %>
<% end %>
<% if current_page?(root_url) %>
<%= json_ld_website_data %>
<% end %>
<%= tag.meta name: "description", content: meta_description %>
<%= tag.meta property: "og:type", content: "website" %>
<%= tag.meta property: "og:site_name", content: Danbooru.config.app_name %>
<%= tag.meta property: "og:title", content: page_title %>
<%= tag.meta property: "og:description", content: meta_description %>
<%= tag.meta property: "og:url", content: request.original_url %>
<% if Danbooru.config.twitter_username.present? %>
<%= tag.meta name: "twitter:site", content: "@#{Danbooru.config.twitter_username}" %>
<% end %>
<%= tag.meta name: "twitter:title", content: page_title %>
<%= tag.meta name: "twitter:description", content: meta_description %>
<%= tag.meta name: "git-hash", content: Rails.application.config.x.git_hash %>
<%= tag.meta name: "theme-color", content: "hsl(213, 100%, 50%)" %>
<%= yield :html_header %>
<%= raw Danbooru.config.custom_html_header_content %>
</head>
<%= tag.body **body_attributes(CurrentUser.user, params, @current_item, @exception) do %>
<% if NewsUpdate.recent.present? %>
<div id="news-updates" data-id="<%= NewsUpdate.recent.first.try(:id) %>" style="display: none;">
<ul>
<% NewsUpdate.recent.each do |news_update| %>
<li><%= news_update.message.html_safe %></li>
<% end %>
</ul>
<a href="#" id="close-news-ticker-link"><%= close_icon %></a>
</div>
<% end %>
<header id="top" class="mb-4">
<%= link_to Danbooru.config.app_name, root_path, id: "app-name-header", class: "font-bold font-header leading-normal" %>
<div id="maintoggle" class="mobile-only">
<a href="#"><%= menu_icon(id: "maintoggle-on") %></a>
<a href="#"><%= close_icon(id: "maintoggle-off", style: "display: none;") %></a>
</div>
<nav id="nav">
<menu id="main-menu" class="main">
<% if CurrentUser.is_anonymous? %>
<%= nav_link_to("Login", login_path(url: request.fullpath), rel: "nofollow") %>
<% else %>
<%= nav_link_to("My Account #{unread_dmail_indicator(CurrentUser.user)}", profile_path) %>
<% end %>
<%= nav_link_to("Posts", posts_path) %>
<%= nav_link_to("Comments", comments_path) %>
<%= nav_link_to("Notes", notes_path) %>
<%= nav_link_to("Artists", artists_path) %>
<%= nav_link_to("Tags", tags_path) %>
<%= nav_link_to("Pools", gallery_pools_path) %>
<%= nav_link_to("Wiki", wiki_page_path("help:home")) %>
<%= nav_link_to("Forum", forum_topics_path, :class => (CurrentUser.has_forum_been_updated? ? "forum-updated" : nil)) %>
<% if CurrentUser.is_moderator? %>
<%= nav_link_to("Reports", moderation_reports_path, :class => (ModerationReport.where(status: "pending").present? ? "reports-pending" : nil)) %>
<%= nav_link_to("Dashboard", moderator_dashboard_path) %>
<% end %>
<%= nav_link_to("More »", site_map_path) %>
</menu>
<% if content_for(:secondary_links).present? %>
<menu id="subnav-menu">
<%= yield :secondary_links %>
</menu>
<% end %>
</nav>
</header>
<div id="page" class="flex-1">
<% if CurrentUser.user.is_restricted? && (params[:controller] == "users" || cookies[:hide_verify_account_notice].blank?) %>
<div class="notice notice-info notice-large" id="verify-account-notice">
<h2>Your account is restricted.</h2>
<div>
You must verify your account because you signed up from a proxy or a VPN.
<%= link_to "Verify your account now", verify_user_email_path(CurrentUser.user) %>.
</div>
<div><%= link_to "Close this", "#", id: "hide-verify-account-notice" %></div>
</div>
<% end %>
<% if Danbooru.config.is_promotion? && cookies[:hide_winter_sale_notice].blank? %>
<div class="notice notice-info notice-small flex text-center items-center justify-center gap-2" id="promotion-notice">
<% file = %w[provgift.png kemogift.png padoru.gif ablobgift.gif].sample %>
<%= tag.img src: "/images/#{file}", width: 32, height: 32 %>
<span>
<%= link_to "Danbooru Winter Sale", forum_topic_path(Danbooru.config.winter_sale_forum_topic_id) %> ends <%= time_ago_in_words_tagged(Danbooru.config.winter_sale_end_date) %>!
<br>
<%= link_to "Get 25% off Gold", new_user_upgrade_path %>
</span>
<span>(<%= link_to "hide", "#", id: "hide-promotion-notice" %>)</span>
</div>
<% elsif !CurrentUser.is_anonymous? && !CurrentUser.is_gold? && !CurrentUser.user.is_banned? && cookies[:hide_upgrade_account_notice].blank? && params[:action] != "upgrade_information" %>
<%= render "users/upgrade_notice" %>
<% end %>
<% if CurrentUser.user.is_banned? %>
<div class="notice notice-error notice-large" id="ban-notice">
<h2>You have been banned <%= humanized_duration CurrentUser.user.active_ban.duration %></h2>
<div>
Reason: <span class="prose"><%= format_text CurrentUser.user.active_ban.reason, inline: true %></span>
</div>
</div>
<% end %>
<% if params[:controller] != "dmails" && has_unread_dmails?(CurrentUser.user) %>
<%= render "users/dmail_notice" %>
<% end %>
<% if !CurrentUser.user.is_anonymous? && CurrentUser.user.name_invalid? %>
<div class="notice notice-error notice-large" id="invalid-name-notice">
<h2>Action required </h2>
<div>You must <%= link_to "change your username", new_user_name_change_request_path %> to continue using <%= Danbooru.config.canonical_app_name %>.</div>
</div>
<% end %>
<div class="notice notice-info" id="notice" style="<%= "display: none;" unless flash[:notice] %>">
<span class="prose"><%= format_text(flash[:notice], inline: true) %>.</span>
<a href="#" id="close-notice-link">close</a>
</div>
<%= yield :layout %>
</div>
<div id="tooltips">
<%# Order matters here; items at the bottom of the list appear on top of earlier items %>
<div id="post-tooltips"></div>
<div id="comment-votes-tooltips"></div>
<div id="post-votes-tooltips"></div>
<div id="post-favorites-tooltips"></div>
<div id="user-tooltips"></div>
<div id="popup-menus"></div>
</div>
<footer id="page-footer" class="text-sm flex-initial">
<span class="page-footer-app-name"><%= Danbooru.config.app_name %></span>
/ <%= link_to "Terms", terms_of_service_path %>
/ <%= link_to "Privacy", privacy_policy_path %>
/ <%= link_to "2257", usc_2257_path %>
/ <%= link_to "Upgrade", new_user_upgrade_path %>
/ <%= link_to "Contact", contact_path %>
</span>
</footer>
<% end %>
</html>