scinote-web/app/views/access_permissions/partials/_experiment_member_field.html.erb
artoscinote 3e3e2cc24e
Revert "Implement experiment and task access removal" [SCI-6218] (#3635)
* Revert "Implement experiment and task access removal [SCI-6156] (#3614)"

This reverts commit 2abefd78e6.

* Rename assign to module activity to designate to my module [SCI-6218]
2021-11-05 15:44:14 +01:00

30 lines
1.3 KiB
Text

<% # 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 %>
<div class="col-xs-1">
<span class="global-avatar-container">
<%= image_tag avatar_path(user, :icon_small), title: current_assignee_name(user), class: 'img-circle pull-left' %>
</span>
</div>
<div class="col-xs-6">
<span><%= current_assignee_name(user) %></span>
<br>
<small class="text-muted"><%= user_assignment_resource_role_name(experiment_member, user, experiment) %></small>
</div>
<% unless user == current_user %>
<div class="col-xs-5">
<%= f.select :user_role_id,
options_for_select(user_roles_collection, selected: f.object.user_role&.id),
{},
class: 'form-control selectpicker',
title: t('user_assignment.change_experiment_role'),
data: { 'selected-text-format' => 'static' } %>
</div>
<% end %>
<% end %>