diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-24 06:51:26 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2015-10-24 06:51:26 +0000 |
commit | a371c8d850a2d1941e34fcf908d549438fdf72df (patch) | |
tree | 4b016ba1273fd1a32ab6012cff23a798463a8f7c /app/helpers | |
parent | 68620da79ab51c808e6ba1b1cfa496494760ee47 (diff) | |
download | redmine-a371c8d850a2d1941e34fcf908d549438fdf72df.tar.gz redmine-a371c8d850a2d1941e34fcf908d549438fdf72df.zip |
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
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/wiki_helper.rb | 13 |
1 files changed, 13 insertions, 0 deletions
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 |