Project

General

Profile

Feature #4285 » cancel_button_for_issue.diff

Evgeny Tsirkin, 2011-07-11 00:22

View differences:

app/controllers/issues_controller.rb (working copy)
135 135
  end
136 136

  
137 137
  def create
138
    if params[:cancel]
139
      respond_to do |format|
140
      format.html {
141
        redirect_to( { :action => 'index', :project_id => @project })
142
      }
143
      format.api  { render :action => 'index', :project_id => @project }
144
      end
145
      return
146
    end
138 147
    call_hook(:controller_issues_new_before_save, { :params => params, :issue => @issue })
139 148
    if @issue.save
140 149
      attachments = Attachment.attach_files(@issue, params[:attachments])
app/views/issues/new.rhtml (working copy)
8 8
    </div>
9 9
    <%= submit_tag l(:button_create) %>
10 10
    <%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
11
    <%= link_to_remote l(:label_preview), 
11
    <%= submit_tag l(:button_cancel), :name => 'cancel' %>
12
    <%= link_to_remote l(:label_preview),
12 13
                       { :url => preview_issue_path(:project_id => @project),
13 14
                         :method => 'post',
14 15
                         :update => 'preview',
config/locales/en.yml (working copy)
830 830
  button_expand_all: Expand all
831 831
  button_delete: Delete
832 832
  button_create: Create
833
  button_cancel: Cancel
833 834
  button_create_and_continue: Create and continue
834 835
  button_test: Test
835 836
  button_edit: Edit
(1-1/3)