mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-16 22:25:30 +08:00
f3dcef44ac
Co-authored-by: Sboursen <dev.sboursen@gmail.com>
47 lines
1.8 KiB
Text
47 lines
1.8 KiB
Text
<% if user_assignment.user == user %>
|
|
<div class="btn btn-light btn-xs icon-btn" type="button" disabled="disabled">
|
|
<span class="sn-icon sn-icon-down"></span>
|
|
</div>
|
|
<% else %>
|
|
<% id = "user-#{user_assignment.user.id}-dropdown" %>
|
|
<div class="dropdown dropdown-teams-user">
|
|
<div class="btn btn-light icon-btn btn-xs"
|
|
type="button"
|
|
id="<%= id %>"
|
|
data-toggle="dropdown"
|
|
aria-haspopup="true"
|
|
aria-expanded="true">
|
|
<span class="sn-icon sn-icon-down"></span>
|
|
</div>
|
|
<ul class="dropdown-menu custom-dropdown-menu dropdown-menu-right" aria-labelledby="<%= id %>">
|
|
<li class="dropdown-header">
|
|
<%= t("users.settings.teams.edit.user_dropdown.role_label") %>
|
|
</li>
|
|
<%= bootstrap_form_for user_assignment,
|
|
url: update_role_path,
|
|
method: :put,
|
|
remote: true,
|
|
data: { id: 'update-role-form' } do |f| %>
|
|
<input type="hidden" name="user_assignment[user_role_id]" data-field="role" value="" %>
|
|
<% end %>
|
|
<% team_user_roles_collection.each do |user_role| %>
|
|
<% same_role = user_assignment.user_role_id == user_role.id %>
|
|
<li class="user-team-role <%= 'disabled' if same_role %>">
|
|
<% if same_role %>
|
|
<span class="sn-icon sn-icon-check"></span>
|
|
<%= user_role.name %>
|
|
<% else %>
|
|
<a href="#" data-action="submit-role" data-value="<%= user_role.id %>">
|
|
<span class="sn-icon sn-icon-check invisible"></span>
|
|
<%= user_role.name %>
|
|
</a>
|
|
<% end %>
|
|
</li>
|
|
<% end %>
|
|
<li role="separator" class="divider"></li>
|
|
<li>
|
|
<%= destroy_uo_link %>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<% end %>
|