mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
Fix my prev_page code, thanks to riking
This commit is contained in:
parent
730c7fbfda
commit
9f4171e487
2 changed files with 2 additions and 2 deletions
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
<% if @topic_view.posts.length > 0 && @topic_view.prev_page %>
|
<% if @topic_view.prev_page %>
|
||||||
<%= link_to t(:prev_page), @topic_view.prev_page_path, rel: 'prev' %>
|
<%= link_to t(:prev_page), @topic_view.prev_page_path, rel: 'prev' %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if @topic_view.next_page %>
|
<% if @topic_view.next_page %>
|
||||||
|
|
|
@ -60,7 +60,7 @@ class TopicView
|
||||||
end
|
end
|
||||||
|
|
||||||
def prev_page
|
def prev_page
|
||||||
if @page && @page > 1
|
if @page && @page > 1 && posts.length > 0
|
||||||
@page - 1
|
@page - 1
|
||||||
else
|
else
|
||||||
nil
|
nil
|
||||||
|
|
Loading…
Reference in a new issue