Favorite groups
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
<li><%= link_to "Hot", posts_path(:tags => "order:rank") %></li>
|
||||
<% unless CurrentUser.is_anonymous? %>
|
||||
<li><%= link_to "Favorites", favorites_path %></li>
|
||||
<li><%= link_to "Favorite groups", favorite_groups_path %></li>
|
||||
<% if CurrentUser.user.has_saved_searches? %>
|
||||
<li><%= link_to "Saved searches", saved_searches_path %></li>
|
||||
<% end %>
|
||||
|
||||
23
app/views/posts/partials/show/_favorite_groups.html.erb
Normal file
23
app/views/posts/partials/show/_favorite_groups.html.erb
Normal file
@@ -0,0 +1,23 @@
|
||||
<div id="favgroup-nav">
|
||||
<ul>
|
||||
<% post.favorite_groups.each do |favgroup| %>
|
||||
<li>
|
||||
<% if favgroup.neighbors(post).previous %>
|
||||
<%= link_to("‹ prev".html_safe, post_path(favgroup.neighbors(post).previous), :rel => "prev", :class => "prev") %>
|
||||
<% else %>
|
||||
<span class="prev">‹ prev</span>
|
||||
<% end %>
|
||||
|
||||
<span class="favgroup-name">
|
||||
<%= link_to("Favorite group: #{favgroup.name}", favorite_group_path(favgroup)) %>
|
||||
</span>
|
||||
|
||||
<% if favgroup.neighbors(post).next %>
|
||||
<%= link_to("next ›".html_safe, post_path(favgroup.neighbors(post).next), :rel => "next", :class => "next") %>
|
||||
<% else %>
|
||||
<span class="next">next ›</span>
|
||||
<% end %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
@@ -7,5 +7,9 @@
|
||||
<% if post.pools.any? %>
|
||||
<%= render "posts/partials/show/pools", :post => post %>
|
||||
<% end %>
|
||||
|
||||
<% if post.favorite_groups.any? %>
|
||||
<%= render "posts/partials/show/favorite_groups", :post => post %>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user