scinote-web/app/views/user_my_modules/_index.html.erb

36 lines
1.3 KiB
Text
Raw Normal View History

2020-04-14 23:25:36 +08:00
<% user_my_modules = @my_module.user_my_modules %>
<% if can_manage_users_in_module?(@my_module) %>
2020-05-21 14:37:40 +08:00
<a class="task-assigned-users manage-users-link <%= 'empty' unless user_my_modules.present? %>"
2020-04-14 23:25:36 +08:00
data-remote="true"
href="<%= my_module_users_edit_path(@my_module, format: :json) %>"
data-module-id="<%= @my_module.id %>"
data-module-users-url="<%= my_module_user_my_modules_url(@my_module, format: :json) %>">
<% if user_my_modules.present? %>
<% user_my_modules.each do |user_my_module| %>
<% user = user_my_module.user %>
<span class='global-avatar-container'>
<%= image_tag avatar_path(user, :icon_small) %>
</span>
<% end %>
<% if @my_module.unassigned_users.any? %>
<span class='global-avatar-container assign-new-user'>
<i class="fas fa-plus"></i>
</span>
<% end %>
<% else %>
<span class="empty-label">
<%= t('my_modules.details.no_assigned_users') %>
2020-05-06 15:47:39 +08:00
</span>
<% end %>
2020-04-14 23:25:36 +08:00
</a>
<% else %>
<div class="task-assigned-users">
<% user_my_modules.each do |user_my_module| %>
<% user = user_my_module.user %>
<span class='global-avatar-container'>
<%= image_tag avatar_path(user, :icon_small) %>
</span>
<% end %>
</div>
<% end %>