-
Notifications
You must be signed in to change notification settings - Fork 407
/
default.html.erb
121 lines (110 loc) · 4.81 KB
/
default.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<!doctype html>
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
<title><%= yield :page_title %></title>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon">
<link rel="top" title="<%= Danbooru.config.app_name %>" href="/">
<%= csrf_meta_tag %>
<% unless cookies[:dm] %>
<meta name="viewport" content="width=device-width,initial-scale=1">
<% end %>
<meta name="current-user-name" content="<%= CurrentUser.name %>">
<meta name="current-user-id" content="<%= CurrentUser.id %>">
<meta name="current-user-can-approve-posts" content="<%= CurrentUser.can_approve_posts? %>">
<meta name="user-comment-threshold" content="<%= CurrentUser.comment_threshold %>">
<% if CurrentUser.user.blacklisted_tags.present? %>
<meta name="blacklisted-tags" content="<%= CurrentUser.user.blacklisted_tags.gsub(/(?:\r|\n)+/, ",") %>">
<% end %>
<% if flash[:notice] =~ /error/i %>
<meta name="errors" content="true">
<% end %>
<meta name="enable-js-navigation" content="<%= CurrentUser.user.enable_post_navigation %>">
<meta name="new-post-navigation-layout" content="<%= CurrentUser.user.new_post_navigation_layout %>">
<meta name="default-image-size" content="<%= CurrentUser.user.default_image_size %>">
<meta name="enable-auto-complete" content="<%= CurrentUser.user.enable_auto_complete %>">
<meta name="style-usernames" content="<%= CurrentUser.user.style_usernames? %>">
<meta name="mobile-mode" content="<%= CurrentUser.mobile_mode? %>">
<meta name="last-forum-read-at" content="<%= CurrentUser.user.last_forum_read_at %>">
<meta name="disable-labeled-saved-searches" content="<%= CurrentUser.disable_categorized_saved_searches? %>">
<%= auto_discovery_link_tag :atom, posts_path(:format => "atom", :tags => params[:tags]) %>
<%= stylesheet_link_tag "application", :media => "screen" %>
<% if CurrentUser.user.custom_style.present? %>
<%= stylesheet_link_tag custom_style_users_path, :media => "screen" %>
<% end %>
<%= javascript_include_tag "application" %>
<%= raw Danbooru.config.custom_html_header_content %>
<%= yield :html_header %>
<% if Danbooru.config.twitter_site %>
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Organization",
"name" : "<%= Danbooru.config.app_name %>",
"url" : "http://<%= Danbooru.config.hostname%>",
"sameAs" : [
"http://twitter.com/<%= Danbooru.config.twitter_site[1..-1] %>"
]
}
</script>
<% end %>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"url" : "http://<%= Danbooru.config.hostname %>",
"potentialAction": [{
"@type": "SearchAction",
"target": "http://<%= Danbooru.config.hostname %>/posts?tags={search_term_string}",
"query-input": "required name=search_term_string"
}]
}
</script>
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "WebSite",
"name": "<%= Danbooru.config.app_name %>",
"alternateName": "<%= Danbooru.config.description %>",
"url" : "http://<%= Danbooru.config.hostname %>"
}
</script>
</head>
<body lang="en" <%= body_attributes(CurrentUser.user) %>>
<header id="top">
<%= render "news_updates/listing" %>
<h1><%= link_to Danbooru.config.app_name, "/" %></h1>
<span id="maintoggle"> ☰ </span> <!-- Maybe icon would be better, I'm not sure -->
<nav id="nav">
<%= render "layouts/main_links" %>
<%= yield :secondary_links %>
</nav>
<%= render "layouts/more_links" %>
</header>
<div id="page">
<% if CurrentUser.is_anonymous? && session[:started_at].is_a?(ActiveSupport::TimeWithZone) && session[:started_at] < 1.minute.ago && cookies[:hide_sign_up_notice].blank? %>
<%= render "users/sign_up_notice" %>
<% end %>
<% if !CurrentUser.is_anonymous? && !CurrentUser.is_gold? && cookies[:hide_upgrade_account_notice].blank? && params[:action] != "upgrade_information" %>
<%= render "users/upgrade_notice" %>
<% end %>
<% if CurrentUser.user.is_banned? %>
<%= render "users/ban_notice" %>
<% end %>
<% if CurrentUser.has_mail? && CurrentUser.dmails.unread.first.present? && cookies[:hide_dmail_notice].to_i != CurrentUser.dmails.unread.first.id %>
<%= render "users/dmail_notice" %>
<% end %>
<% if CurrentUser.user.can_approve_posts? %>
<%= render "moderator/post/queues/notice" %>
<% end %>
<% if cookies["accepted_tos"].blank? && !CurrentUser.is_gold? %>
<%= render "users/tos" %>
<% end %>
<div class="ui-corner-all ui-state-highlight" id="notice" style="<%= "display: none;" unless flash[:notice] %>">
<span><%= flash[:notice] %></span>
<a href="#" id="close-notice-link">close</a>
</div>
<%= yield :layout %>
</div>
<%= render "static/footer" %>
</body>
</html>