2022-11-30 21:56:19 +08:00
|
|
|
<% users = my_module.designated_users.order(:full_name) %>
|
2023-01-06 18:43:23 +08:00
|
|
|
<% if users.empty? && !can_manage_my_module_designated_users?(user, my_module) %>
|
|
|
|
<%= I18n.t('experiments.table.not_set') %>
|
|
|
|
<% else %>
|
|
|
|
<div ref="dropdown" class="assign-users-dropdown dropdown" data-view-only="<%= !can_manage_my_module_designated_users?(user, my_module) %>">
|
2023-01-10 17:38:56 +08:00
|
|
|
<div class="assigned-users-container" tabindex="0" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
2023-01-06 18:43:23 +08:00
|
|
|
<% users[0..3].each_with_index do |user, i| %>
|
|
|
|
<span class="avatar-container" style="z-index: <%= 5 - i %>">
|
|
|
|
<%= image_tag avatar_path(user, :icon_small), title: user.full_name %>
|
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
<% if users.length > 4 %>
|
2023-03-14 01:00:30 +08:00
|
|
|
<span class="more-users avatar-container" title="<%= users[4..].map(&:full_name).join('
') %>">
|
2023-01-06 18:43:23 +08:00
|
|
|
+<%= users.length - 4 %>
|
|
|
|
</span>
|
|
|
|
<% end %>
|
|
|
|
<% if can_manage_my_module_designated_users?(user, my_module) %>
|
|
|
|
<span class="new-user avatar-container">
|
|
|
|
<i class="fas fa-plus"></i>
|
|
|
|
</span>
|
|
|
|
<% end %>
|
2022-11-30 21:56:19 +08:00
|
|
|
</div>
|
2023-01-06 18:43:23 +08:00
|
|
|
<div class="dropdown-menu">
|
|
|
|
<div class="sci-input-container left-icon">
|
|
|
|
<input type="text" class="sci-input-field user-search" placeholder="<%= I18n.t('experiments.table.search') %>">
|
|
|
|
<i class="fas fa-search"></i>
|
|
|
|
</div>
|
|
|
|
<div class="users-list"
|
|
|
|
data-list-url="<%= search_my_module_user_my_module_path(my_module, my_module_id: my_module.id, skip_unassigned: skip_unassigned) %>">
|
|
|
|
</div>
|
2022-11-30 21:56:19 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-01-06 18:43:23 +08:00
|
|
|
<% end %>
|