From e2ddd70d101ba91349f15609fb9de0a3f297591b Mon Sep 17 00:00:00 2001 From: kmalyjur Date: Mon, 21 Oct 2024 11:50:12 +0000 Subject: [PATCH] Fixes #37932 - Add asterisk to email address users form --- app/views/users/_form.html.erb | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/app/views/users/_form.html.erb b/app/views/users/_form.html.erb index a952490995b..1d14f369430 100644 --- a/app/views/users/_form.html.erb +++ b/app/views/users/_form.html.erb @@ -1,4 +1,3 @@ - <%= form_for @user do |f| %> <%= base_errors_for @user %> @@ -29,7 +28,7 @@ <%= text_f f, :login, :disabled => msg.present? , :label_help => msg %> <%= text_f f, :firstname %> <%= text_f f, :lastname %> - <%= text_f f, :mail %> + <%= text_f f, :mail, id: "mail", required: f.object.mail_enabled%> <% unless @user == User.current %> <%= checkbox_f f, :disabled %> <% end %> @@ -68,7 +67,7 @@
<%= field_set_tag _("General") do %> - <%= checkbox_f f, :mail_enabled %> + <%= checkbox_f f, :mail_enabled, onchange: 'toggleMailRequired(this)' %>
<%= link_to_function(_("Test email"), "tfm.users.testMail(this, '#{test_mail_user_url(f.object)}', {user_email: $('#user_mail').val()})", :title => _("Send a test message to the user's email address to confirm the configuration is working."), :id => "test_mail_button", :class =>"btn btn-success") + hidden_spinner('', :id => 'test_indicator').html_safe if action_name == "edit" %> @@ -139,6 +138,15 @@
<%= submit_or_cancel f %> + + <% end %> <% if @user.cached_usergroups.any? %>