Browse Source

Display a warning if some attachments were not saved (#2008).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2224 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/0.9.0
Jean-Philippe Lang 15 years ago
parent
commit
e0bda97b6f
34 changed files with 46 additions and 1 deletions
  1. 5
    1
      app/controllers/application.rb
  2. 1
    0
      lang/bg.yml
  3. 1
    0
      lang/ca.yml
  4. 1
    0
      lang/cs.yml
  5. 1
    0
      lang/da.yml
  6. 1
    0
      lang/de.yml
  7. 2
    0
      lang/en.yml
  8. 1
    0
      lang/es.yml
  9. 1
    0
      lang/fi.yml
  10. 2
    0
      lang/fr.yml
  11. 1
    0
      lang/he.yml
  12. 1
    0
      lang/hu.yml
  13. 1
    0
      lang/it.yml
  14. 1
    0
      lang/ja.yml
  15. 1
    0
      lang/ko.yml
  16. 1
    0
      lang/lt.yml
  17. 1
    0
      lang/nl.yml
  18. 1
    0
      lang/no.yml
  19. 1
    0
      lang/pl.yml
  20. 1
    0
      lang/pt-br.yml
  21. 1
    0
      lang/pt.yml
  22. 1
    0
      lang/ro.yml
  23. 1
    0
      lang/ru.yml
  24. 1
    0
      lang/sk.yml
  25. 1
    0
      lang/sr.yml
  26. 1
    0
      lang/sv.yml
  27. 1
    0
      lang/th.yml
  28. 1
    0
      lang/tr.yml
  29. 1
    0
      lang/uk.yml
  30. 1
    0
      lang/vn.yml
  31. 1
    0
      lang/zh-tw.yml
  32. 1
    0
      lang/zh.yml
  33. BIN
      public/images/warning.png
  34. 8
    0
      public/stylesheets/application.css

+ 5
- 1
app/controllers/application.rb View File

@@ -175,6 +175,7 @@ class ApplicationController < ActionController::Base
# TODO: move to model
def attach_files(obj, attachments)
attached = []
unsaved = []
if attachments && attachments.is_a?(Hash)
attachments.each_value do |attachment|
file = attachment['file']
@@ -183,7 +184,10 @@ class ApplicationController < ActionController::Base
:file => file,
:description => attachment['description'].to_s.strip,
:author => User.current)
attached << a unless a.new_record?
a.new_record? ? (unsaved << a) : (attached << a)
end
if unsaved.any?
flash[:warning] = l(:warning_attachments_not_saved, unsaved.size)
end
end
attached

+ 1
- 0
lang/bg.yml View File

@@ -697,3 +697,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/ca.yml View File

@@ -698,3 +698,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/cs.yml View File

@@ -702,3 +702,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/da.yml View File

@@ -698,3 +698,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/de.yml View File

@@ -699,3 +699,4 @@ enumeration_issue_priorities: Ticket-Prioritäten
enumeration_doc_categories: Dokumentenkategorien
enumeration_activities: Aktivitäten (Zeiterfassung)
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 2
- 0
lang/en.yml View File

@@ -85,6 +85,8 @@ error_scm_command_failed: "An error occurred when trying to access the repositor
error_scm_annotate: "The entry does not exist or can not be annotated."
error_issue_not_found_in_project: 'The issue was not found or does not belong to this project'

warning_attachments_not_saved: "%d file(s) could not be saved."

mail_subject_lost_password: Your %s password
mail_body_lost_password: 'To change your password, click on the following link:'
mail_subject_register: Your %s account activation

+ 1
- 0
lang/es.yml View File

@@ -682,3 +682,4 @@ text_user_wrote: '%s escribió:'
text_wiki_destroy_confirmation: ¿Seguro que quiere borrar el wiki y todo su contenido?
text_workflow_edit: Seleccionar un flujo de trabajo para actualizar
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/fi.yml View File

@@ -697,3 +697,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 2
- 0
lang/fr.yml View File

@@ -85,6 +85,8 @@ error_scm_command_failed: "Une erreur s'est produite lors de l'accès au dépôt
error_scm_annotate: "L'entrée n'existe pas ou ne peut pas être annotée."
error_issue_not_found_in_project: "La demande n'existe pas ou n'appartient pas à ce projet"

warning_attachments_not_saved: "%d fichier(s) n'ont pas pu être sauvegardés."

mail_subject_lost_password: Votre mot de passe %s
mail_body_lost_password: 'Pour changer votre mot de passe, cliquez sur le lien suivant:'
mail_subject_register: Activation de votre compte %s

+ 1
- 0
lang/he.yml View File

@@ -697,3 +697,4 @@ label_updated_time_by: עודכן ע"י %s לפני %s
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/hu.yml View File

@@ -698,3 +698,4 @@ label_updated_time_by: "Módosította %s ennyivel ezelőtt: %s"
text_diff_truncated: '... A diff fájl vége nem jelenik meg, mert hosszab, mint a megjeleníthető sorok száma.'
setting_diff_max_lines_displayed: A megjelenítendő sorok száma (maximum) a diff fájloknál
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/it.yml View File

@@ -697,3 +697,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/ja.yml View File

@@ -698,3 +698,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/ko.yml View File

@@ -697,3 +697,4 @@ label_updated_time_by: %s가 %s 전에 변경
text_diff_truncated: '... 이 차이점은 표시할 수 있는 최대 줄수를 초과해서 이 차이점은 잘렸습니다.'
setting_diff_max_lines_displayed: 차이점보기에 표시할 최대 줄수
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/lt.yml View File

@@ -699,3 +699,4 @@ enumeration_issue_priorities: Darbo prioritetai
enumeration_doc_categories: Dokumento kategorijos
enumeration_activities: Veiklos (laiko sekimas)
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/nl.yml View File

@@ -699,3 +699,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/no.yml View File

@@ -698,3 +698,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/pl.yml View File

@@ -716,3 +716,4 @@ label_updated_time_by: Uaktualnione przez %s %s temu
text_diff_truncated: '... Ten plik różnic został przycięty ponieważ jest zbyt długi.'
setting_diff_max_lines_displayed: Maksymalna liczba linii różnicy do pokazania
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/pt-br.yml View File

@@ -698,3 +698,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/pt.yml View File

@@ -699,3 +699,4 @@ label_updated_time_by: Actualizado por %s há %s
text_diff_truncated: '... Este diff foi truncado porque excede o tamanho máximo que pode ser mostrado.'
setting_diff_max_lines_displayed: Número máximo de linhas de diff mostradas
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/ro.yml View File

@@ -697,3 +697,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/ru.yml View File

@@ -731,3 +731,4 @@ text_wiki_destroy_confirmation: Вы уверены, что хотите уда
text_workflow_edit: Выберите роль и трекер для редактирования последовательности состояний

text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/sk.yml View File

@@ -703,3 +703,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/sr.yml View File

@@ -698,3 +698,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/sv.yml View File

@@ -698,3 +698,4 @@ enumeration_issue_priorities: Ärendeprioriteter
enumeration_doc_categories: Dokumentkategorier
enumeration_activities: Aktiviteter (tidsuppföljning)
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/th.yml View File

@@ -700,3 +700,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/tr.yml View File

@@ -698,3 +698,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/uk.yml View File

@@ -699,3 +699,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/vn.yml View File

@@ -700,3 +700,4 @@ label_updated_time_by: Updated by %s %s ago
text_diff_truncated: '... This diff was truncated because it exceeds the maximum size that can be displayed.'
setting_diff_max_lines_displayed: Max number of diff lines displayed
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/zh-tw.yml View File

@@ -699,3 +699,4 @@ enumeration_issue_priorities: 項目優先權
enumeration_doc_categories: 文件分類
enumeration_activities: 活動 (時間追蹤)
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

+ 1
- 0
lang/zh.yml View File

@@ -699,3 +699,4 @@ enumeration_issue_priorities: 问题优先级
enumeration_doc_categories: 文档类别
enumeration_activities: 活动(时间跟踪)
text_plugin_assets_writable: Plugin assets directory writable
warning_attachments_not_saved: "%d file(s) could not be saved."

BIN
public/images/warning.png View File


+ 8
- 0
public/stylesheets/application.css View File

@@ -314,6 +314,14 @@ div.flash.notice {
color: #005f00;
}

div.flash.warning {
background: url(../images/warning.png) 8px 5px no-repeat;
background-color: #FFEBC1;
border-color: #FDBF3B;
color: #A6750C;
text-align: left;
}

.nodata, .warning {
text-align: center;
background-color: #FFEBC1;

Loading…
Cancel
Save