Use active record translations for labels

This way we can simplify the way we generate form fields. In some cases,
we also use the human attribute in table headers, which IMHO makes
sense.

I haven't moved all of them: for example, sometimes a label is
different depending on whether it's shown to administrators, valuators,
or users. And I haven't touched the ones related to devise, since I
wasn't sure about possible side effects.

Note I've also removed placeholders when they had the same text as their
labels, since they weren't helpful. On the contrary, the added redundant
text to the form, potentially distracting users.
This commit is contained in:
Javi Martín
2019-10-04 15:29:02 +02:00
parent 1bc66925ab
commit 6fa67b5e53
65 changed files with 277 additions and 342 deletions

View File

@@ -34,7 +34,6 @@ module DocumentsHelper
def render_attachment(builder, document)
klass = document.persisted? || document.cached_attachment.present? ? " hide" : ""
builder.file_field :attachment,
label: t("documents.form.attachment_label"),
label_options: { class: "button hollow #{klass}" },
accept: accepted_content_types_extensions(document.documentable_type.constantize),
class: "js-document-attachment",