mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-19 15:01:14 +00:00
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
This commit is contained in:
parent
b9fa262165
commit
6c0aa5cb89
@ -1307,6 +1307,11 @@ module ApplicationHelper
|
|||||||
hidden_field_tag('back_url', url, :id => nil) unless url.blank?
|
hidden_field_tag('back_url', url, :id => nil) unless url.blank?
|
||||||
end
|
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)
|
def check_all_links(form_name)
|
||||||
link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") +
|
link_to_function(l(:button_check_all), "checkAll('#{form_name}', true)") +
|
||||||
" | ".html_safe +
|
" | ".html_safe +
|
||||||
|
|||||||
@ -114,4 +114,10 @@ module TimelogHelper
|
|||||||
end
|
end
|
||||||
end
|
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
|
end
|
||||||
|
|||||||
@ -3,4 +3,5 @@
|
|||||||
<%= labelled_form_for @time_entry, :url => time_entry_path(@time_entry), :html => {:multipart => true} do |f| %>
|
<%= labelled_form_for @time_entry, :url => time_entry_path(@time_entry), :html => {:multipart => true} do |f| %>
|
||||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||||
<%= submit_tag l(:button_save) %>
|
<%= submit_tag l(:button_save) %>
|
||||||
|
<%= render_cancel_button_tag_for_time_entry(@project) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@ -4,4 +4,5 @@
|
|||||||
<%= render :partial => 'form', :locals => {:f => f} %>
|
<%= render :partial => 'form', :locals => {:f => f} %>
|
||||||
<%= submit_tag l(:button_create) %>
|
<%= submit_tag l(:button_create) %>
|
||||||
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
|
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
|
||||||
|
<%= render_cancel_button_tag_for_time_entry(@project) %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user