Feature #8888 » 0001-add-cancel-button-to-new-edit-log-time-page.patch
| app/helpers/application_helper.rb | ||
|---|---|---|
|
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 +
|
||
| app/helpers/timelog_helper.rb | ||
|---|---|---|
|
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
|
||
| app/views/timelog/edit.html.erb | ||
|---|---|---|
|
<%= labelled_form_for @time_entry, :url => time_entry_path(@time_entry), :html => {:multipart => true} do |f| %>
|
||
|
<%= render :partial => 'form', :locals => {:f => f} %>
|
||
|
<%= submit_tag l(:button_save) %>
|
||
|
<%= render_cancel_button_tag_for_time_entry(@project) %>
|
||
|
<% end %>
|
||
| app/views/timelog/new.html.erb | ||
|---|---|---|
|
<%= render :partial => 'form', :locals => {:f => f} %>
|
||
|
<%= submit_tag l(:button_create) %>
|
||
|
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
|
||
|
<%= render_cancel_button_tag_for_time_entry(@project) %>
|
||
|
<% end %>
|
||