% # frozen_string_literal: true %>
<%
experiment_member = ExperimentMember.new(current_user, experiment, project, user)
item_id = dom_id(user, :experiment_member)
%>
<%= form_with(model: experiment_member, url: update_path, method: :put, remote: true, html: { class: 'row member-item', id: item_id, data: { action: 'replace-form autosave-form' } }) do |f| %>
<%= f.hidden_field :user_id, value: f.object.user.id %>
<%= image_tag avatar_path(user, :icon_small), title: current_assignee_name(user), class: 'img-circle pull-left' %>
<%= current_assignee_name(user) %>
<%= user_assignment_resource_role_name(user, experiment) %>
<% unless user == current_user %>
<%= f.select :user_role_id, nil, {}, id: "experiment_member_#{experiment_member.user.id}_user_role_id", class: 'form-control selectpicker', title: t('user_assignment.change_experiment_role'), data: { 'selected-text-format' => 'static' } do %>
<% user_roles_collection.each do |user_role| %>
<% end %>
<% end %>
<% end %>
<% end %>