feat(messages): add max file size for attachments

This commit is contained in:
Philipp Rothmann 2023-08-04 10:56:21 +02:00 committed by Philipp Rothmann
parent ef6d6aa368
commit bcf47ec92b
7 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,7 @@
// app/javascript/trix-editor-overrides.js
window.addEventListener("trix-file-accept", function(event) {
if (event.file.size > 1024 * 1024 * 512) {
event.preventDefault()
alert(I18n.t('js.trix_editor.file_size_alert'))
}
})

View file

@ -1216,12 +1216,15 @@ de:
js: js:
ordering: ordering:
confirm_change: Änderungen an dieser Bestellung gehen verloren, wenn zu einer anderen Bestellung gewechselt wird. Möchtest Du trotzdem wechseln? confirm_change: Änderungen an dieser Bestellung gehen verloren, wenn zu einer anderen Bestellung gewechselt wird. Möchtest Du trotzdem wechseln?
trix_editor:
file_size_alert: Der Dateianhang ist zu groß! Die maximale Größe beträgt 512Mb
layouts: layouts:
email: email:
footer_1_separator: "--" footer_1_separator: "--"
footer_2_foodsoft: 'Foodsoft: %{url}' footer_2_foodsoft: 'Foodsoft: %{url}'
footer_3_homepage: 'Foodcoop: %{url}' footer_3_homepage: 'Foodcoop: %{url}'
footer_4_help: 'Hilfe: %{url}' footer_4_help: 'Hilfe: %{url}'
help: 'Hilfe'
foodsoft: Foodsoft foodsoft: Foodsoft
footer: footer:
revision: Revision %{revision} revision: Revision %{revision}

View file

@ -1219,12 +1219,15 @@ en:
js: js:
ordering: ordering:
confirm_change: Modifications to this order will be lost when you change the order. Do you want to lose the changes you made and continue? confirm_change: Modifications to this order will be lost when you change the order. Do you want to lose the changes you made and continue?
trix_editor:
file_size_alert: The file is to large! The supported file size is 512Mb!
layouts: layouts:
email: email:
footer_1_separator: "--" footer_1_separator: "--"
footer_2_foodsoft: 'Foodsoft: %{url}' footer_2_foodsoft: 'Foodsoft: %{url}'
footer_3_homepage: 'Foodcoop: %{url}' footer_3_homepage: 'Foodcoop: %{url}'
footer_4_help: 'Help: %{url}' footer_4_help: 'Help: %{url}'
help: 'Help'
foodsoft: Foodsoft foodsoft: Foodsoft
footer: footer:
revision: revision %{revision} revision: revision %{revision}

View file

@ -1080,9 +1080,12 @@ es:
js: js:
ordering: ordering:
confirm_change: Las modificaciones sobre este pedido se perderán cuando cambies el pedido. ¿Quieres perder los cambios que has hecho y continuar? confirm_change: Las modificaciones sobre este pedido se perderán cuando cambies el pedido. ¿Quieres perder los cambios que has hecho y continuar?
trix_editor:
file_size_alert: ¡El archivo adjunto es demasiado grande! El tamaño máximo es de 512Mb
layouts: layouts:
email: email:
footer_4_help: 'Ayuda: %{url}' footer_4_help: 'Ayuda: %{url}'
help: 'Ayuda'
footer: footer:
revision: revisión %{revision} revision: revisión %{revision}
header: header:

View file

@ -831,10 +831,13 @@ fr:
js: js:
ordering: ordering:
confirm_change: Les changements apportés à cette commande vont être perdus. Est-ce que tu veux vraiment continuer? confirm_change: Les changements apportés à cette commande vont être perdus. Est-ce que tu veux vraiment continuer?
trix_editor:
file_size_alert: Le fichier joint est trop volumineux ! La taille maximale est de 512Mb
layouts: layouts:
email: email:
footer_3_homepage: 'Boufcoop: %{url}' footer_3_homepage: 'Boufcoop: %{url}'
footer_4_help: 'Aide: %{url}' footer_4_help: 'Aide: %{url}'
help: 'Aide'
footer: footer:
revision: révision %{revision} revision: révision %{revision}
header: header:

View file

@ -1189,12 +1189,15 @@ nl:
js: js:
ordering: ordering:
confirm_change: Als je naar een andere bestelling gaat, gaan je aanpassingen in deze bestelling verloren. Wijzigingen vergeten en naar de andere bestelling gaan? confirm_change: Als je naar een andere bestelling gaat, gaan je aanpassingen in deze bestelling verloren. Wijzigingen vergeten en naar de andere bestelling gaan?
trix_editor:
file_size_alert: De bestandsbijlage is te groot! De maximale grootte is 512Mb!
layouts: layouts:
email: email:
footer_1_separator: "--" footer_1_separator: "--"
footer_2_foodsoft: 'Foodsoft: %{url}' footer_2_foodsoft: 'Foodsoft: %{url}'
footer_3_homepage: 'Foodcoop: %{url}' footer_3_homepage: 'Foodcoop: %{url}'
footer_4_help: 'Help: %{url}' footer_4_help: 'Help: %{url}'
help: 'Help'
foodsoft: Foodsoft foodsoft: Foodsoft
footer: footer:
revision: revisie %{revision} revision: revisie %{revision}

View file

@ -1218,6 +1218,8 @@ tr:
js: js:
ordering: ordering:
confirm_change: Bu siparişe yapılan değişiklikler kaybolacak. Değişikliklerinizi kaybetmek ve devam etmek istiyor musunuz? confirm_change: Bu siparişe yapılan değişiklikler kaybolacak. Değişikliklerinizi kaybetmek ve devam etmek istiyor musunuz?
trix_editor:
file_size_alert: Dosya eki çok büyük! Maksimum boyut 512Mb
layouts: layouts:
email: email:
footer_1_separator: "--" footer_1_separator: "--"