summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjomo <github@jomo.tv>2016-05-08 19:30:52 +0200
committerjomo <github@jomo.tv>2016-05-08 19:30:52 +0200
commitbd061d344169c200a799b25b3c7cb6d50787a31e (patch)
tree577d1420d45f84232aa39d1e2b73c2f6e150b8fe
parent37cccdff180aab8bb67a202d35ef5b4e6974432c (diff)
fix thread & reply navigator links
-rw-r--r--app/views/forumthreads/edit.html.erb2
-rw-r--r--app/views/forumthreads/new.html.erb2
-rw-r--r--app/views/threadreplies/edit.html.erb7
3 files changed, 8 insertions, 3 deletions
diff --git a/app/views/forumthreads/edit.html.erb b/app/views/forumthreads/edit.html.erb
index cab2dd8..5297249 100644
--- a/app/views/forumthreads/edit.html.erb
+++ b/app/views/forumthreads/edit.html.erb
@@ -12,7 +12,7 @@
%>
<h1>Edit thread</h1>
-<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → New thread
+<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → <%= link_to @thread, @thread %> → Edit thread
<%= form_for @thread do |f|%>
<table>
<% if mod? %>
diff --git a/app/views/forumthreads/new.html.erb b/app/views/forumthreads/new.html.erb
index 021e907..2e1d7e0 100644
--- a/app/views/forumthreads/new.html.erb
+++ b/app/views/forumthreads/new.html.erb
@@ -7,7 +7,7 @@
end
%>
-<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → New thread
+<%= link_to @thread.forum.group, forumgroup_path(@thread.forum.group) %> → <%= link_to @thread.forum, @thread.forum %> → New thread
<h1>New thread</h1>
<%= form_for @thread do |f|%>
<table>
diff --git a/app/views/threadreplies/edit.html.erb b/app/views/threadreplies/edit.html.erb
index d3218cd..c009cb0 100644
--- a/app/views/threadreplies/edit.html.erb
+++ b/app/views/threadreplies/edit.html.erb
@@ -1,6 +1,11 @@
<% title "Edit Thread Reply: #{@reply.thread.title}" %>
-<%= link_to @reply.thread.forum.group, forumgroup_path(@reply.thread.forum.group) %> → <%= link_to @reply.thread.forum, @reply.thread.forum %> → <%= link_to @reply.thread, @reply.thread %> → Edit reply
+<%
+ position = @reply.thread.replies.index(@reply)
+ page = position / Kaminari.config.default_per_page + 1
+%>
+
+<%= link_to @reply.thread.forum.group, forumgroup_path(@reply.thread.forum.group) %> → <%= link_to @reply.thread.forum, @reply.thread.forum %> → <%= link_to @reply.thread, forumthread_path(@reply.thread, page: page) + "#reply-#{@reply.id}" %> → Edit reply
<h1>Edit reply</h1>
<%= form_for [@reply.thread, @reply] do |f| %>
<%= render partial: "md_editor", locals: {name: "threadreply[content]", content: @reply.content} %>