diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 7d89e21..e8d0a85 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -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 diff --git a/lang/bg.yml b/lang/bg.yml index 7750057..df18690 100644 --- a/lang/bg.yml +++ b/lang/bg.yml @@ -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." diff --git a/lang/ca.yml b/lang/ca.yml index d8e5054..d0d6b82 100644 --- a/lang/ca.yml +++ b/lang/ca.yml @@ -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." diff --git a/lang/cs.yml b/lang/cs.yml index a50b2f3..16fde62 100644 --- a/lang/cs.yml +++ b/lang/cs.yml @@ -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." diff --git a/lang/da.yml b/lang/da.yml index 85244b9..8f1049d 100644 --- a/lang/da.yml +++ b/lang/da.yml @@ -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." diff --git a/lang/de.yml b/lang/de.yml index fd990aa..4697aae 100644 --- a/lang/de.yml +++ b/lang/de.yml @@ -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." diff --git a/lang/en.yml b/lang/en.yml index 0bff7d4..9bd56e8 100644 --- a/lang/en.yml +++ b/lang/en.yml @@ -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 diff --git a/lang/es.yml b/lang/es.yml index f26425a..83c51e6 100644 --- a/lang/es.yml +++ b/lang/es.yml @@ -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." diff --git a/lang/fi.yml b/lang/fi.yml index 2e6a487..2363386 100644 --- a/lang/fi.yml +++ b/lang/fi.yml @@ -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." diff --git a/lang/fr.yml b/lang/fr.yml index 4493c8d..c3210a5 100644 --- a/lang/fr.yml +++ b/lang/fr.yml @@ -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 diff --git a/lang/he.yml b/lang/he.yml index a7212a7..617b3ac 100644 --- a/lang/he.yml +++ b/lang/he.yml @@ -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." diff --git a/lang/hu.yml b/lang/hu.yml index e90dbb9..1768ced 100644 --- a/lang/hu.yml +++ b/lang/hu.yml @@ -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." diff --git a/lang/it.yml b/lang/it.yml index dbec2d7..134096b 100644 --- a/lang/it.yml +++ b/lang/it.yml @@ -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." diff --git a/lang/ja.yml b/lang/ja.yml index 6c98b9a..2ca1a4e 100644 --- a/lang/ja.yml +++ b/lang/ja.yml @@ -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." diff --git a/lang/ko.yml b/lang/ko.yml index db61e28..cc072e1 100644 --- a/lang/ko.yml +++ b/lang/ko.yml @@ -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." diff --git a/lang/lt.yml b/lang/lt.yml index 75af640..ef2978e 100644 --- a/lang/lt.yml +++ b/lang/lt.yml @@ -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." diff --git a/lang/nl.yml b/lang/nl.yml index f39fb54..bbffbf1 100644 --- a/lang/nl.yml +++ b/lang/nl.yml @@ -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." diff --git a/lang/no.yml b/lang/no.yml index 500da6a..9d0ccc9 100644 --- a/lang/no.yml +++ b/lang/no.yml @@ -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." diff --git a/lang/pl.yml b/lang/pl.yml index b38aa9e..9742e19 100644 --- a/lang/pl.yml +++ b/lang/pl.yml @@ -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." diff --git a/lang/pt-br.yml b/lang/pt-br.yml index 5b3fc69..90e7e77 100644 --- a/lang/pt-br.yml +++ b/lang/pt-br.yml @@ -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." diff --git a/lang/pt.yml b/lang/pt.yml index e32b851..17cc36b 100644 --- a/lang/pt.yml +++ b/lang/pt.yml @@ -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." diff --git a/lang/ro.yml b/lang/ro.yml index e25cd17..25684ce 100644 --- a/lang/ro.yml +++ b/lang/ro.yml @@ -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." diff --git a/lang/ru.yml b/lang/ru.yml index 93f5cff..2a8bd3c 100644 --- a/lang/ru.yml +++ b/lang/ru.yml @@ -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." diff --git a/lang/sk.yml b/lang/sk.yml index 7d06e16..f1a96fc 100644 --- a/lang/sk.yml +++ b/lang/sk.yml @@ -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." diff --git a/lang/sr.yml b/lang/sr.yml index a67385b..dbe5c5e 100644 --- a/lang/sr.yml +++ b/lang/sr.yml @@ -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." diff --git a/lang/sv.yml b/lang/sv.yml index 47ee5e6..8cd5cbe 100644 --- a/lang/sv.yml +++ b/lang/sv.yml @@ -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." diff --git a/lang/th.yml b/lang/th.yml index 3bfa280..cd3c481 100644 --- a/lang/th.yml +++ b/lang/th.yml @@ -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." diff --git a/lang/tr.yml b/lang/tr.yml index 6112195..d6f32ce 100644 --- a/lang/tr.yml +++ b/lang/tr.yml @@ -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." diff --git a/lang/uk.yml b/lang/uk.yml index f51afc4..845fdec 100644 --- a/lang/uk.yml +++ b/lang/uk.yml @@ -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." diff --git a/lang/vn.yml b/lang/vn.yml index 394c49b..5917677 100644 --- a/lang/vn.yml +++ b/lang/vn.yml @@ -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." diff --git a/lang/zh-tw.yml b/lang/zh-tw.yml index 5644fd8..5679069 100644 --- a/lang/zh-tw.yml +++ b/lang/zh-tw.yml @@ -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." diff --git a/lang/zh.yml b/lang/zh.yml index e425be5..e1e30d2 100644 --- a/lang/zh.yml +++ b/lang/zh.yml @@ -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." diff --git a/public/images/warning.png b/public/images/warning.png index bbef670b6a1db9f4fe60d34fd2b664daae4452a8..628cf2dae3d419ae220c8928ac71393b480745a3 100644 GIT binary patch delta 653 zc$@)^0&@MA1eyhq8Gi-<001BJ|6u?C00d`2O+f$vugEtAis=9V02y>eSaefwW^{L9 za%BKPWN%_+AW3auXJt}lVPtu6$z?nM00JyYL_t(I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ylesheets/application.css index 751293b..824b4cb 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -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;