Allow A/D shortcuts for browsing favgroups
This commit is contained in:
@@ -148,7 +148,7 @@
|
||||
location.href = href;
|
||||
}
|
||||
} else {
|
||||
var href = $("#pool-nav a.active[rel=prev]").attr("href");
|
||||
var href = $("#pool-nav a.active[rel=prev], #favgroup-nav a.active[rel=prev]").attr("href");
|
||||
if (href) {
|
||||
location.href = href;
|
||||
}
|
||||
@@ -160,7 +160,7 @@
|
||||
var href = $("#search-seq-nav a[rel=next]").attr("href");
|
||||
location.href = href;
|
||||
} else {
|
||||
var href = $("#pool-nav a.active[rel=next]").attr("href");
|
||||
var href = $("#pool-nav a.active[rel=next], #favgroup-nav a.active[rel=next]").attr("href");
|
||||
if (href) {
|
||||
location.href = href;
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ class PostPresenter < Presenter
|
||||
first = true
|
||||
pools = @post.pools.series_first
|
||||
pools.each do |pool|
|
||||
if first && template.params[:tags].blank?
|
||||
if first && template.params[:tags].blank? && template.params[:favgroup_id].blank?
|
||||
html += pool_link_html(template, pool, :include_rel => true)
|
||||
first = false
|
||||
else
|
||||
|
||||
@@ -2,18 +2,20 @@
|
||||
<ul>
|
||||
<% post.favorite_groups.each do |favgroup| %>
|
||||
<li>
|
||||
<% klass = "active" if favgroup.id == params[:favgroup_id].to_i %>
|
||||
|
||||
<% if favgroup.neighbors(post).previous %>
|
||||
<%= link_to("‹ prev".html_safe, post_path(favgroup.neighbors(post).previous), :rel => "prev", :class => "prev") %>
|
||||
<%= link_to("‹ prev".html_safe, post_path(favgroup.neighbors(post).previous, :favgroup_id => favgroup.id), :rel => "prev", :class => "prev #{klass}") %>
|
||||
<% else %>
|
||||
<span class="prev">‹ prev</span>
|
||||
<% end %>
|
||||
|
||||
<span class="favgroup-name">
|
||||
<span class="favgroup-name <%= klass %>">
|
||||
<%= 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") %>
|
||||
<%= link_to("next ›".html_safe, post_path(favgroup.neighbors(post).next, :favgroup_id => favgroup.id), :rel => "next", :class => "next #{klass}") %>
|
||||
<% else %>
|
||||
<span class="next">next ›</span>
|
||||
<% end %>
|
||||
|
||||
Reference in New Issue
Block a user