/
index.html.erb
148 lines (129 loc) · 5.65 KB
/
index.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
<% provide :title, t(".title", :tags => params[:tags].to_s.tr("_", " ")) %>
<% provide :title, " | #{t("basic.page", :page => page_number)}" if page_number > 1 %>
<% @canonical_url = url_for(:controller => "/post", :action => :index, :tags => params[:tags], :page => params[:page], :only_path => false) %>
<%= render "shared/twitter_card/gallery", :posts => @posts, :url => @canonical_url %>
<div id="post-list">
<% if @tag_suggestions && @tag_suggestions.any? %>
<div class="status-notice">
<%= t('.maybe_you_meant') %>: <%= @tag_suggestions.map {|x| tag_link(x)}.to_sentence({ :two_words_connector => ' or ', :last_word_connector => ', or ' }).html_safe %>
</div>
<% end %>
<div class="sidebar">
<%= render :partial => "search" %>
<% if @current_user.is_privileged_or_higher? %>
<div style="margin-bottom: 1em;" id="mode-box" class="advanced-editing">
<h5><%= t('.mode') %></h5>
<form onsubmit="return false;" action="">
<div>
<select name="mode" id="mode" onchange="PostModeMenu.change()" onkeyup="PostModeMenu.change()" style="width: 13em;">
<option value="view"><%= t('.mode_form.view') %></option>
<option value="edit"><%= t('.mode_form.edit') %></option>
<!-- <option value="rating-s">Rate safe</option>
<option value="rating-q">Rate questionable</option>
<option value="rating-e">Rate explicit</option>
<% if @current_user.is_privileged_or_higher? %>
<option value="lock-rating">Lock rating</option>
<option value="lock-note">Lock notes</option>
<% end %> -->
<% if @current_user.is_mod_or_higher? %>
<option value="approve"><%= t('.mode_form.approve') %></option>
<% end %>
<option value="flag"><%= t('.mode_form.flag') %></option>
<option value="apply-tag-script"><%= t('.mode_form.script') %></option>
<option value="reparent-quick"><%= t('.mode_form.reparent') %></option>
<% if @searching_pool then %>
<option value="remove-from-pool"><%= t('.mode_form.pool_remove') %></option>
<% end %>
</select>
</div>
</form>
</div>
<%= render :partial => "tag_script" %>
<% end %>
<% if @searching_pool then %>
<%= t('.pool_view_html', :pool => link_to(@searching_pool.pretty_name, :controller => "pool", :action => "show", :id => @searching_pool.id)) %>
<% end %>
<% if @showing_holds_only %>
<% if !@posts.empty? %>
<div style="margin-bottom: .5em;">
<%= link_to_function t('.activate'), "Post.activate_all_posts()" %>
</div>
<% end %>
<% else %>
<div id="held-posts" style="display: none; margin-bottom: .5em;"><%= t('.held_html', :count => content_tag(:span, '', :id => 'held-posts-count')) %> (<a href="#"><%= t('.held_view') %></a>).</div>
<% end %>
<%= render :partial => 'blacklists' %>
<%= render :partial => 'tags', :locals => {:include_tag_hover_highlight=>true} %>
<br />
<% if CONFIG["can_see_ads"].call(@current_user) %>
<%= render :partial => "vertical" %>
<% end %>
<%= render :partial => 'layouts/twitter_link' %>
</div>
<div class="content">
<% if @ambiguous_tags.any? %>
<div class="status-notice">
<%= t('.ambiguous') %>: <%= @ambiguous_tags.map {|x| link_to(x, :controller => :wiki, :action => :show, :title => x)}.join(', ').html_safe %>
</div>
<% end %>
<% if CONFIG["can_see_ads"].call(@current_user) %>
<%= CONFIG["ad_code_index_bottom"] %>
<% end %>
<div id="quick-edit" style="display: none;" class="top-corner-float">
<%= form_tag(:action => "update") do %>
<%= text_area_tag "post[tags]", "", :size => "60x2", :id => "post_tags" %>
<%= submit_tag t('buttons.update') %>
<%= tag(:input, :type => 'button', :value => t('buttons.cancel'), :class => "cancel") %>
<h4 style="float: right;"><%= t('.edit_tags') %></h4>
<% end %>
</div>
<%= render :partial => "hover" %>
<%= render :partial => "posts", :locals => {:posts => @posts} %>
<div id="paginator">
<%= will_paginate(@posts) %>
</div>
</div>
</div>
<% content_for :post_cookie_javascripts do %>
<script type="text/javascript">
post_quick_edit = new PostQuickEdit($("quick-edit"));
PostModeMenu.init(<%= j(@searching_pool && @searching_pool.id.to_s) %>)
<% @preload.each do |post| %>
Preload.preload('<%= escape_javascript(post.preview_url) %>');
<% end %>
var held_posts = Cookie.get("held_post_count");
if(held_posts && held_posts > 0)
{
var e = $("held-posts");
if(e)
{
var a = e.down("A");
var cnt = e.down("#held-posts-count");
cnt.update("" + held_posts + " " + (held_posts == 1? "post":"posts"));
a.href = "/post?tags=holds%3Aonly%20user%3A" + Cookie.get("login") + "%20limit%3A100"
e.show();
}
}
Post.cache_sample_urls();
new TagCompletionBox($("post_tags"));
if($("tag-script"))
new TagCompletionBox($("tag-script"));
</script>
<% end %>
<% content_for :html_header do %>
<%= auto_discovery_link_tag :rss, { :controller => '/post', :action => :piclens, :format => :rss, :tags => params[:tags], :page => page_number } %>
<%= navigation_links(@posts) %>
<% end %>
<%= render :partial => "footer" %>
<% if content_for? :subnavbar %>
<!-- Align the links to the content, not the window. -->
<div style="clear: both;">
<div class="sidebar"> </div>
<div class="footer" style="clear: none;">
<ul class="flat-list" id="subnavbar">
<%= yield :subnavbar %>
</ul>
</div>
</div>
<% @view_flow.set(:subnavbar, "") %>
<% end %>