From ed7bec04b096e3f12f4e709385549a451933d6e0 Mon Sep 17 00:00:00 2001 From: Florian Weber Date: Wed, 6 May 2020 21:59:29 +0200 Subject: [PATCH] Fix "for" attribute for label elements (#1488) Co-authored-by: Ahmad Farhat --- app/views/admins/components/_roles.html.erb | 2 +- app/views/password_resets/edit.html.erb | 4 ++-- app/views/password_resets/new.html.erb | 2 +- app/views/sessions/new.html.erb | 8 ++++---- app/views/users/components/_account.html.erb | 14 +++++++------- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/views/admins/components/_roles.html.erb b/app/views/admins/components/_roles.html.erb index f8ac2b2f..a622bff6 100644 --- a/app/views/admins/components/_roles.html.erb +++ b/app/views/admins/components/_roles.html.erb @@ -34,7 +34,7 @@
"> <%= form_with model: @selected_role, url: admin_update_role_path(@selected_role.id), method: :post do |f| %> - <%= f.label t('administrator.roles.name'), class: "form-label" %> + <%= f.label :name, t('administrator.roles.name'), class: "form-label" %> <%= f.text_field :name, class: 'form-control mb-3', value: translated_role_name(@selected_role), readonly: edit_disabled || @selected_role.name == "user" || @selected_role.name == "admin", required: true %> <%= f.hidden_field :colour, id: "role-colour", value: role_colour(@selected_role) %> diff --git a/app/views/password_resets/edit.html.erb b/app/views/password_resets/edit.html.erb index bb4c9231..940513a1 100644 --- a/app/views/password_resets/edit.html.erb +++ b/app/views/password_resets/edit.html.erb @@ -25,11 +25,11 @@ <%= hidden_field_tag :email, @user.email %> - <%= f.label t('reset_password.password'), class: "form-label" %> + <%= f.label :password, t('reset_password.password'), class: "form-label" %> <%= f.password_field :password, class: 'form-control' %>
- <%= f.label t('reset_password.confirm'), class: "form-label" %> + <%= f.label :password_confirmation, t('reset_password.confirm'), class: "form-label" %> <%= f.password_field :password_confirmation, class: 'form-control' %>
diff --git a/app/views/password_resets/new.html.erb b/app/views/password_resets/new.html.erb index b80e121f..b8c4cadb 100644 --- a/app/views/password_resets/new.html.erb +++ b/app/views/password_resets/new.html.erb @@ -22,7 +22,7 @@
<%= form_for(:password_reset, url: password_resets_path) do |f| %> - <%= f.label t("forgot_password.email"), class: "form-label" %> + <%= f.label :email, t("forgot_password.email"), class: "form-label" %> <%= f.email_field :email, class: "form-control" %>
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb index 10c00bf9..a562b19e 100644 --- a/app/views/sessions/new.html.erb +++ b/app/views/sessions/new.html.erb @@ -40,22 +40,22 @@ <% end %> <%= form_for @user, url: create_user_path, method: :post do |f| %>
- <%= f.label t("settings.account.fullname"), class: "form-label" %> + <%= f.label :name, t("settings.account.fullname"), class: "form-label" %> <%= f.text_field :name, class: "form-control #{form_is_invalid?(@user, :name)}", placeholder: t("settings.account.fullname") %>
<%= @user.errors.full_messages_for(:name).first %>
- <%= f.label t("email"), class: "form-label" %> + <%= f.label :email, t("email"), class: "form-label" %> <%= f.text_field :email, class: "form-control #{form_is_invalid?(@user, :email)}", placeholder: t("email") %>
<%= @user.errors.full_messages_for(:email).first %>
- <%= f.label t("password"), class: "form-label" %> + <%= f.label :password, t("password"), class: "form-label" %> <%= f.password_field :password, class: "form-control #{form_is_invalid?(@user, :password)}", placeholder: t("password") %>
<%= @user.errors.full_messages_for(:password).first %>
- <%= f.label t("signup.password_confirm"), class: "form-label" %> + <%= f.label :password_confirmation, t("signup.password_confirm"), class: "form-label" %> <%= f.password_field :password_confirmation, class: "form-control #{form_is_invalid?(@user, :password_confirmation)}", placeholder: t("signup.password_confirm") %>
<%= @user.errors.full_messages_for(:password_confirmation).first %>
diff --git a/app/views/users/components/_account.html.erb b/app/views/users/components/_account.html.erb index 6814f435..81a41366 100644 --- a/app/views/users/components/_account.html.erb +++ b/app/views/users/components/_account.html.erb @@ -18,28 +18,27 @@
- <%= f.label t("settings.account.fullname"), class: "form-label" %> + <%= f.label :name, t("settings.account.fullname"), class: "form-label" %>
<%= f.text_field :name, class: "form-control #{form_is_invalid?(@user, :name)}", placeholder: t("settings.account.fullname") %>
- <%= f.label t("email"), class: "form-label" %> + <%= f.label :email, t("email"), class: "form-label" %>
<%= f.text_field :email, class: "form-control #{form_is_invalid?(@user, :email)}", placeholder: t("email"), readonly: !@user.greenlight_account? %>

- <%= f.label t("settings.account.provider"), class: "form-label" %> + <%= f.label :provider, t("settings.account.provider"), class: "form-label" %> <%= f.text_field :provider, class: "form-control", readonly: "" %>
- <%= f.label t("settings.account.language"), class: "form-label" %> + <%= f.label :language, t("settings.account.language"), class: "form-label" %> <%= f.select :language, language_options, {}, { class: "form-control custom-select" } %> - <%= f.label t("settings.account.roles"), class: "form-label mt-5" %> - + <%= f.label :roles, t("settings.account.roles"), class: "form-label mt-5" %> <% if current_user.role.get_permission("can_manage_users") %>