%= content_tag :div,
data: {
controller: 'disable-when-checked',
'admin--users-target': 'passwordFields'
},
hidden: !@user.change_password_allowed? do %>
<% assign_random_password_enabled = params[:user] &&
params[:user][:assign_random_password] %>
<% unless OpenProject::Configuration.disable_password_choice? %>
<%= f.password_field :password_confirmation,
required: @user.new_record?,
disabled: assign_random_password_enabled,
data: {
'disable-when-checked-target': 'effect'
},
container_class: '-middle' %>
<% end %>
<% if @user.active? -%>
<% end -%>
<%= f.check_box :force_password_change,
disabled: assign_random_password_enabled %>
<% end %>