redirect to proper page for thread replies

This commit is contained in:
jomo
2015-02-08 00:47:17 +01:00
parent e887e3d1da
commit f82af96759
7 changed files with 36 additions and 8 deletions

View File

@@ -8,7 +8,11 @@
<%= render_md(@comment.content).html_safe %>
</blockquote>
<p><%= link_to "Click here", blogpost_url(@comment.blogpost) + "#comment-#{@comment.id}", style: "text-decoration: none; color: #4096EE;" %> to view the blog post.</p>
<%
position = @comment.blogpost.comments.count - 1
page = position / Kaminari.config.default_per_page + 1
%>
<p><%= link_to "Click here", blogpost_url(@comment.blogpost, page: page) + "#comment-#{@comment.id}", style: "text-decoration: none; color: #4096EE;" %> to view the blog post.</p>
<p>If you have any questions or problems, just ask one of our <%= link_to "Staff", users_url(role: "staff"), style: "text-decoration: none; color: #4096EE;" %> in-game or on the forums!</p>
<p>Your Redstoner team</p>

View File

@@ -8,7 +8,11 @@
<%= render_md(@comment.content).html_safe %>
</blockquote>
<p><%= link_to "Click here", blogpost_url(@comment.blogpost) + "#comment-#{@comment.id}", style: "text-decoration: none; color: #4096EE;" %> to view the blog post.</p>
<%
position = @comment.blogpost.comments.count - 1
page = position / Kaminari.config.default_per_page + 1
%>
<p><%= link_to "Click here", blogpost_url(@comment.blogpost, page: page) + "#comment-#{@comment.id}", style: "text-decoration: none; color: #4096EE;" %> to view the blog post.</p>
<p>If you have any questions or problems, just ask one of our <%= link_to "Staff", users_url(role: "staff"), style: "text-decoration: none; color: #4096EE;" %> in-game or on the forums!</p>
<p>Your Redstoner team</p>

View File

@@ -9,7 +9,11 @@
<%= render_md(@reply.content).html_safe %>
</blockquote>
<p><%= link_to "Click here", forumthread_url(@reply.thread) + "#reply-#{@reply.id}", style: "text-decoration: none; color: #4096EE;" %> to view the thread.</p>
<%
position = @reply.thread.replies.count - 1
page = position / Kaminari.config.default_per_page + 1
%>
<p><%= link_to "Click here", forumthread_url(@reply.thread, page: page) + "#reply-#{@reply.id}", style: "text-decoration: none; color: #4096EE;" %> to view the thread.</p>
<p>If you have any questions or problems, just ask one of our <%= link_to "Staff", users_url(role: "staff"), style: "text-decoration: none; color: #4096EE;" %> in-game or on the forums!</p>
<p>Your Redstoner team</p>

View File

@@ -9,7 +9,11 @@
<%= render_md(@reply.content).html_safe %>
</blockquote>
<p><%= link_to "Click here", forumthread_url(@reply.thread) + "#reply-#{@reply.id}", style: "text-decoration: none; color: #4096EE;" %> to view the thread.</p>
<%
position = @reply.thread.replies.count - 1
page = position / Kaminari.config.default_per_page + 1
%>
<p><%= link_to "Click here", forumthread_url(@reply.thread, page: page) + "#reply-#{@reply.id}", style: "text-decoration: none; color: #4096EE;" %> to view the thread.</p>
<p>If you have any questions or problems, just ask one of our <%= link_to "Staff", users_url(role: "staff"), style: "text-decoration: none; color: #4096EE;" %> in-game or on the forums!</p>
<p>Your Redstoner team</p>