mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-14 23:41:43 +00:00
Merge branch 'validar-sitio-antes-de-guardar-la-imagen' into 'rails'
validar el sitio antes de subir una imagen Closes #1192, #1193, #1194, #1195, #1196, and #1197 See merge request sutty/sutty!17
This commit is contained in:
commit
eafe5fa96c
3 changed files with 5 additions and 0 deletions
|
@ -16,6 +16,7 @@ class MetadataFile < MetadataTemplate
|
|||
def validate
|
||||
super
|
||||
|
||||
errors << I18n.t("metadata.#{type}.site_invalid") if site.invalid?
|
||||
errors << I18n.t("metadata.#{type}.path_required") if path_missing?
|
||||
errors << I18n.t("metadata.#{type}.no_file_for_description") if no_file_for_description?
|
||||
|
||||
|
|
|
@ -37,10 +37,12 @@ en:
|
|||
metadata:
|
||||
cant_be_empty: 'This field cannot be empty'
|
||||
image:
|
||||
site_invalid: 'The image cannot be stored if the site configuration is not valid'
|
||||
not_an_image: 'Not an image'
|
||||
path_required: 'Missing image for upload'
|
||||
no_file_for_description: "Description with no associated image"
|
||||
file:
|
||||
site_invalid: 'The file cannot be stored if the site configuration is not valid'
|
||||
path_required: "Missing file for upload"
|
||||
no_file_for_description: "Description with no associated file"
|
||||
event:
|
||||
|
|
|
@ -37,10 +37,12 @@ es:
|
|||
metadata:
|
||||
cant_be_empty: 'El campo no puede estar vacío'
|
||||
image:
|
||||
site_invalid: 'La imagen no se puede almacenar si la configuración del sitio no es válida'
|
||||
not_an_image: 'No es una imagen'
|
||||
path_required: 'Se necesita una imagen'
|
||||
no_file_for_description: 'Se envió una descripción sin imagen asociada'
|
||||
file:
|
||||
site_invalid: 'El archivo no se puede almacenar si la configuración del sitio no es válida'
|
||||
path_required: 'Se necesita un archivo'
|
||||
no_file_for_description: 'se envió una descripción sin archivo asociado'
|
||||
event:
|
||||
|
|
Loading…
Reference in a new issue