From a371c8d850a2d1941e34fcf908d549438fdf72df Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 24 Oct 2015 06:51:26 +0000 Subject: Add cancel button during edition of a wiki page (#4285). git-svn-id: http://svn.redmine.org/redmine/trunk@14734 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/helpers/wiki_helper.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'app/helpers/wiki_helper.rb') diff --git a/app/helpers/wiki_helper.rb b/app/helpers/wiki_helper.rb index 77ac01835..59448920b 100644 --- a/app/helpers/wiki_helper.rb +++ b/app/helpers/wiki_helper.rb @@ -51,4 +51,17 @@ module WikiHelper link_to(h(parent.pretty_title), {:controller => 'wiki', :action => 'show', :id => parent.title, :project_id => parent.project, :version => nil}) }) end + + # Returns the path for the Cancel link when editing a wiki page + def wiki_page_edit_cancel_path(page) + if page.new_record? + if parent = page.parent + project_wiki_page_path(parent.project, parent.title) + else + project_wiki_index_path(page.project) + end + else + project_wiki_page_path(page.project, page.title) + end + end end -- cgit v1.2.3