make pool gallery the default view

This commit is contained in:
r888888888
2014-09-05 16:27:19 -07:00
parent 267df896c6
commit 719343cea5
8 changed files with 14 additions and 10 deletions

View File

@@ -11,7 +11,11 @@ article.post-preview {
position: relative;
&.pooled {
height: 194px;
height: 214px;
}
.desc {
font-size: 80%;
}
img {

View File

@@ -27,7 +27,7 @@ class PostPresenter < Presenter
if options[:pool]
html << %{<p class="desc">}
html << %{<a href="/pools/#{options[:pool].id}">}
html << options[:pool].pretty_name.truncate(40)
html << options[:pool].pretty_name.truncate(80)
html << %{</a>}
html << %{</p>}
end

View File

@@ -14,9 +14,10 @@ module PostSetPresenters
return template.render("post_sets/blank")
end
posts = ::Post.where(id: pools.map(&:cover_post_id)).to_a.inject({}) {|h, x| h[x.id] = x; h}
pools.each do |pool|
if pool.cover_post_id
post = ::Post.find(pool.cover_post_id)
if post = posts[pool.cover_post_id.to_i]
html << PostPresenter.preview(post, options.merge(:tags => @post_set.tag_string, :raw => @post_set.raw, :pool => pool))
html << "\n"
end

View File

@@ -13,7 +13,7 @@
<%= nav_link_to("Aliases", tag_aliases_path) %>
<%= nav_link_to("Implications", tag_implications_path) %>
<% end %>
<%= nav_link_to("Pools", pools_path) %>
<%= nav_link_to("Pools", gallery_pools_path) %>
<%= nav_link_to("Wiki", wiki_pages_path(:title => "help:home")) %>
<%= nav_link_to("Forum", forum_topics_path, :class => (CurrentUser.user.has_forum_been_updated? ? "forum-updated" : nil)) %>
<% if CurrentUser.is_janitor? %>

View File

@@ -1,3 +1,3 @@
<%= form_tag(pools_path, :method => :get) do %>
<%= form_tag(gallery_pools_path, :method => :get) do %>
<%= text_field "search", "name_matches", :id => "quick_search_name_matches", :placeholder => "Search pools" %>
<% end %>

View File

@@ -1,6 +1,6 @@
<table class="search">
<tbody>
<%= form_tag pools_path, :method => :get, :class => "simple_form" do %>
<%= form_tag gallery_pools_path, :method => :get, :class => "simple_form" do %>
<tr>
<th><label for="search_name_matches">Name</label></th>
<td>

View File

@@ -1,8 +1,7 @@
<% content_for(:secondary_links) do %>
<menu>
<li><%= render "pools/quick_search" %></li>
<li><%= link_to "Gallery", gallery_pools_path %></li>
<li><%= link_to "Listing", pools_path %></li>
<li><%= link_to "Listing", gallery_pools_path %></li>
<li><%= link_to "New", new_pool_path %></li>
<li><%= link_to "Help", wiki_pages_path(:search => {:title => "help:pools"}) %></li>
<% if CurrentUser.is_member? && @pool && !@pool.new_record? %>

View File

@@ -52,7 +52,7 @@
<ul>
<li><h1>Pools</h1></li>
<li><%= link_to("Help", wiki_pages_path(:title => "help:pools")) %></li>
<li><%= link_to("Listing", pools_path) %></li>
<li><%= link_to("Listing", gallery_pools_path) %></li>
<li><%= link_to("Changes", pool_versions_path) %></li>
</ul>
<ul>