From bd061d344169c200a799b25b3c7cb6d50787a31e Mon Sep 17 00:00:00 2001 From: jomo Date: Sun, 8 May 2016 19:30:52 +0200 Subject: fix thread & reply navigator links --- app/views/forumthreads/edit.html.erb | 2 +- app/views/forumthreads/new.html.erb | 2 +- app/views/threadreplies/edit.html.erb | 7 ++++++- 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 @@ %>

Edit thread

-<%= 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|%> <% 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

New thread

<%= form_for @thread do |f|%>
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

Edit reply

<%= form_for [@reply.thread, @reply] do |f| %> <%= render partial: "md_editor", locals: {name: "threadreply[content]", content: @reply.content} %> -- cgit v1.2.3