2021-11-05 22:44:14 +08:00
|
|
|
<% # frozen_string_literal: true %>
|
|
|
|
|
2021-05-09 00:06:07 +08:00
|
|
|
<%
|
|
|
|
experiment_member = ExperimentMember.new(current_user, experiment, project, user)
|
|
|
|
item_id = dom_id(user, :experiment_member)
|
|
|
|
%>
|
|
|
|
|
2021-05-09 22:59:10 +08:00
|
|
|
<%= 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| %>
|
2021-05-09 00:06:07 +08:00
|
|
|
<%= f.hidden_field :user_id, value: f.object.user.id %>
|
2021-11-10 18:40:41 +08:00
|
|
|
<div class="user-assignment-info">
|
|
|
|
<div class="global-avatar-container">
|
|
|
|
<%= image_tag avatar_path(user, :icon_small), title: current_assignee_name(user), class: 'img-circle pull-left' %>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<%= current_assignee_name(user) %>
|
|
|
|
<br>
|
2021-11-15 22:02:22 +08:00
|
|
|
<small class="text-muted"><%= user_assignment_resource_role_name(user, experiment) %></small>
|
2021-11-10 18:40:41 +08:00
|
|
|
</div>
|
2021-05-09 00:06:07 +08:00
|
|
|
</div>
|
|
|
|
<% unless user == current_user %>
|
2021-11-10 18:40:41 +08:00
|
|
|
<div class="user-assignment-controls">
|
|
|
|
<div class="user-assignment-role">
|
2021-11-15 18:12:31 +08:00
|
|
|
<%= 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 %>
|
|
|
|
<option data-content="<span title='<%= t('.reset_description') %>'><%= t('.reset') %></span>" value="reset"><%= t('.reset') %></option>
|
|
|
|
<% user_roles_collection.each do |user_role| %>
|
|
|
|
<option value="<%= user_role[1] %>"><%= user_role[0] %></option>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
2021-11-10 18:40:41 +08:00
|
|
|
</div>
|
2021-05-09 00:06:07 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|