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