redirect to proper page for thread replies
This commit is contained in:
@@ -20,7 +20,11 @@
|
||||
<% if last_reply && last_reply.created_at > last_thread.created_at %>
|
||||
<% if last_reply.thread.can_read?(current_user) %>
|
||||
<%= last_reply.author.name %>
|
||||
<%= link_to "replied", forumthread_path(last_reply.thread) + "#reply-#{last_reply.id}" %>
|
||||
<%
|
||||
position = last_reply.thread.replies.count - 1
|
||||
page = position / Kaminari.config.default_per_page + 1
|
||||
%>
|
||||
<%= link_to "replied", forumthread_path(last_reply.thread, page: page) + "#reply-#{last_reply.id}" %>
|
||||
<%= ago last_reply.created_at %>.
|
||||
<% else %>
|
||||
Hidden
|
||||
|
||||
@@ -29,7 +29,11 @@
|
||||
<div class="item-info">
|
||||
<% if rpl = thread.replies.last %>
|
||||
<%= rpl.author.name %>
|
||||
<%= link_to "replied", forumthread_path(thread) + "#reply-#{rpl.id}" %>
|
||||
<%
|
||||
position = thread.replies.count - 1
|
||||
page = position / Kaminari.config.default_per_page + 1
|
||||
%>
|
||||
<%= link_to "replied", forumthread_path(thread, page: page) + "#reply-#{rpl.id}" %>
|
||||
<%= ago rpl.created_at %>.
|
||||
<% else %>
|
||||
No replies yet.
|
||||
|
||||
Reference in New Issue
Block a user