summaryrefslogtreecommitdiffstats
path: root/app/helpers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2018-09-26 07:47:59 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2018-09-26 07:47:59 +0000
commit6c0aa5cb89ce8d965d5e0e1e8170161b42cda990 (patch)
treeaa2139412d34c1aefe21c88a0cadbe5d282a0e64 /app/helpers
parentb9fa262165601a3b348d22ca1d8da53bda99e55b (diff)
downloadredmine-6c0aa5cb89ce8d965d5e0e1e8170161b42cda990.tar.gz
redmine-6c0aa5cb89ce8d965d5e0e1e8170161b42cda990.zip
Add cancel button to new/edit log time page (#8888).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@17522 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb5
-rw-r--r--app/helpers/timelog_helper.rb6
2 files changed, 11 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 62987ca29..215dca08c 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1307,6 +1307,11 @@ module ApplicationHelper
hidden_field_tag('back_url', url, :id => nil) unless url.blank?
end
+ def render_cancel_button_tag(fallback_url)
+ url = back_url.blank? ? fallback_url : back_url
+ link_to l(:button_cancel), url
+ end
+
def check_all_links(form_name)
link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") +
" | ".html_safe +
diff --git a/app/helpers/timelog_helper.rb b/app/helpers/timelog_helper.rb
index 89ed99601..7248e8ed0 100644
--- a/app/helpers/timelog_helper.rb
+++ b/app/helpers/timelog_helper.rb
@@ -114,4 +114,10 @@ module TimelogHelper
end
end
end
+
+ def render_cancel_button_tag_for_time_entry(project)
+ fallback_path = project ? project_time_entries_path(project) : time_entries_path
+ render_cancel_button_tag(fallback_path)
+ end
+
end