rel="prev" and rel="next" for topic also

This commit is contained in:
Jeff Atwood 2014-03-01 02:16:40 -08:00
parent b05dd86e50
commit 66ae439ded
2 changed files with 12 additions and 8 deletions

View File

@ -4,15 +4,15 @@
<% end %> <% end %>
</div> </div>
<p>
<% if params[:page].to_i > 1 %>
<a href="<%= @list.prev_topics_url.sub('.json?','?') %>" rel="prev" style="margin-right: 30px;"><%= t 'prev_page'%></a>
<% end %>
<% if @list.topics.length > 0 %> <% if @list.topics.length > 0 %>
<a href="<%= @list.more_topics_url.sub('.json?','?') %>" rel="next"><%= t 'next_page'%></a> <p>
<% if params[:page].to_i > 1 %>
<a href="<%= @list.prev_topics_url.sub('.json?','?') %>" rel="prev"><%= t 'prev_page'%></a> &nbsp;
<% end %> <% end %>
</p> <b><a href="<%= @list.more_topics_url.sub('.json?','?') %>" rel="next"><%= t 'next_page'%></a></b>
</p>
<% end %>
<p><%= t 'powered_by_html' %></p> <p><%= t 'powered_by_html' %></p>

View File

@ -15,9 +15,13 @@
<% end %> <% end %>
<% end %> <% end %>
<% if @topic_view.next_page %> <% if @topic_view.next_page %>
<p> <p>
<b><%= link_to(t('next_page').html_safe, @topic_view.next_page_path ) %></b> <% if params[:page].to_i > 1 %>
<a href="" rel="prev"><%= t 'prev_page'%></a> &nbsp;
<% end %>
<b><a href="<%= @topic_view.next_page_path %>" rel="next"><%= t 'next_page'%></a></b>
</p> </p>
<% end %> <% end %>