scinote-web/app/views/access_permissions/partials/_user_assignment_field.html.erb

38 lines
1.5 KiB
Text
Raw Normal View History

2021-04-18 23:19:16 +08:00
<% # frozen_string_literal: true %>
2021-04-30 19:26:06 +08:00
<%
project_member = f.object
user = project_member.user
id = dom_id(user, :new_project_member)
%>
2021-04-18 23:19:16 +08:00
<div class="row member-item new-member-item" data-filter-item="<%= user.full_name %>">
<%= f.hidden_field :user_id, value: user.id, name:"access_permissions_new_user_project_form[resource_members][#{user.id}][user_id]" %>
<div class="user-assignment-info">
<div class="sci-checkbox-container">
2021-04-30 19:26:06 +08:00
<%= f.check_box :assign,
name: "access_permissions_new_user_project_form[resource_members][#{user.id}][assign]",
data: { action: 'toggle-visibility', target: id },
class: "sci-checkbox"
%>
<span class="sci-checkbox-label"></span>
</div>
<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) %>
</div>
</div>
<div class="user-assignment-controls">
<div class="user-assignment-role hidden" id="<%= id %>">
<%= f.select :user_role_id,
options_for_select(user_roles_collection),
{},
name: "access_permissions_new_user_project_form[resource_members][#{user.id}][user_role_id]",
class: 'form-control selectpicker pull-right',
title: t('user_assignment.select_role') %>
</div>
2021-04-18 23:19:16 +08:00
</div>
</div>