diff --git a/app/views/posts/template_field/_text_area.haml b/app/views/posts/template_field/_text_area.haml index 3ab02f3f..7f8e3a03 100644 --- a/app/views/posts/template_field/_text_area.haml +++ b/app/views/posts/template_field/_text_area.haml @@ -1,2 +1,5 @@ = text_area_tag field_name_for_post_as_string(name), value, - class: 'form-control', required: template.required? + class: 'form-control', required: template.required?, + maxlength: template.max > 0 ? template.max : nil +- if template.max > 0 + %small= t('posts.text_area.max', max: template.max) diff --git a/config/locales/en.yml b/config/locales/en.yml index eca51663..ff9d00bc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -209,6 +209,8 @@ en: select: placeholder: 'Type to filter available options' max: 'You can select up to %{max} options' + text_area: + max: 'Up to %{max} characters' table: 'This field is a group of fields, you can add more groups with the "Add group" button or remove them with the "Remove group" button.' row: add: 'Add group' diff --git a/config/locales/es.yml b/config/locales/es.yml index 029f7abb..c89d905d 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -205,6 +205,8 @@ es: select: placeholder: 'Empieza a escribir para filtrar las opciones disponibles' max: 'Puedes seleccionar hasta %{max} opciones' + text_area: + max: 'Hasta %{max} caracteres' table: 'Este campo es un grupo de campos, puede agregar los que necesites con el botón "Agregar grupo" o eliminar los que no con "Eliminar grupo"' row: add: 'Agregar grupo'