Project

General

Profile

Patch #19793 ยป flash_in_files_controller.diff

diff - Juan Manuel Rodulfo Salcedo, 2015-05-08 12:18

View differences:

app/controllers/files_controller.rb (working copy)
47 47
    attachments = Attachment.attach_files(container, params[:attachments])
48 48
    render_attachment_warning_if_needed(container)
49 49

  
50
    if !attachments.empty? && !attachments[:files].blank? && Setting.notified_events.include?('file_added')
51
      Mailer.attachments_added(attachments[:files]).deliver
50
    if attachments.any? && !attachments[:files].blank?
51
      if Setting.notified_events.include?('file_added')
52
        Mailer.attachments_added(attachments[:files]).deliver
53
      end
54
      flash[:notice] = l(:label_file_added)
55
      redirect_to project_files_path(@project)
56
    else
57
      flash[:error] = l(:label_file_error)
58
      redirect_to :action => :new
52 59
    end
53
    redirect_to project_files_path(@project)
54 60
  end
55 61
end
config/locales/en.yml (working copy)
593 593
  label_attachment_delete: Delete file
594 594
  label_attachment_plural: Files
595 595
  label_file_added: File added
596
  label_file_error: Error in File
596 597
  label_report: Report
597 598
  label_report_plural: Reports
598 599
  label_news: News
    (1-1/1)