From 048458dce89bf3386ad8a560646f851599368b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 3 Nov 2021 22:38:15 +0100 Subject: [PATCH] Use hints instead of placeholders in URL fields Placeholders are hard to read due to their low contrast, and users might want to read them after they're already gone, and so they cause both accessibility and usability issues. --- app/components/admin/budget_phases/form_component.html.erb | 2 +- app/components/admin/budgets/form_component.html.erb | 3 ++- config/locales/en/admin.yml | 2 +- config/locales/es/admin.yml | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/components/admin/budget_phases/form_component.html.erb b/app/components/admin/budget_phases/form_component.html.erb index 2ec884943..337eb0b60 100644 --- a/app/components/admin/budget_phases/form_component.html.erb +++ b/app/components/admin/budget_phases/form_component.html.erb @@ -51,7 +51,7 @@
- <%= translations_form.text_field :main_link_url, placeholder: t("admin.shared.example_url") %> + <%= translations_form.text_field :main_link_url, hint: t("admin.shared.example_url") %>
<% end %> diff --git a/app/components/admin/budgets/form_component.html.erb b/app/components/admin/budgets/form_component.html.erb index 2d412655c..5df2e0e92 100644 --- a/app/components/admin/budgets/form_component.html.erb +++ b/app/components/admin/budgets/form_component.html.erb @@ -21,9 +21,10 @@ <%= translations_form.text_field :main_link_text %> +
- <%= translations_form.text_field :main_link_url, placeholder: t("admin.shared.example_url") %> + <%= translations_form.text_field :main_link_url, hint: t("admin.shared.example_url") %>
<% end %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index 352156f8a..7b7a96efc 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -1369,7 +1369,7 @@ en: show_results_and_stats: "Show results and stats" results_and_stats_reminder: "Marking these checkboxes the results and/or stats will be publicly available and every user will see them." close_modal: Close modal - example_url: "https://consulproject.org" + example_url: "For example, https://consulproject.org or /help" geozones: index: title: Geozone diff --git a/config/locales/es/admin.yml b/config/locales/es/admin.yml index d6f48d2c7..4481c66c2 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -1368,7 +1368,7 @@ es: show_results_and_stats: "Mostrar resultados y estadísticas" results_and_stats_reminder: "Si marcas estas casillas los resultados y/o estadísticas serán públicos y podrán verlos todos los usuarios." close_modal: Cerrar ventana emergente - example_url: "https://consulproject.org" + example_url: "Por ejemplo, https://consulproject.org o /help" geozones: index: title: Zonas