2022-06-01 21:06:19 +08:00
|
|
|
<% if user_assignment.user == user %>
|
2023-06-27 17:58:02 +08:00
|
|
|
<button class="btn btn-light btn-xs icon-btn" type="button" disabled="disabled">
|
2023-06-19 21:45:22 +08:00
|
|
|
<span class="sn-icon sn-icon-down"></span>
|
2023-06-27 17:58:02 +08:00
|
|
|
</button>
|
2017-01-25 19:01:23 +08:00
|
|
|
<% else %>
|
2022-06-01 21:06:19 +08:00
|
|
|
<% id = "user-#{user_assignment.user.id}-dropdown" %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<div class="dropdown dropdown-teams-user">
|
2023-06-27 17:58:02 +08:00
|
|
|
<button class="btn btn-light icon-btn btn-xs"
|
2017-01-25 19:01:23 +08:00
|
|
|
type="button"
|
|
|
|
id="<%= id %>"
|
|
|
|
data-toggle="dropdown"
|
|
|
|
aria-haspopup="true"
|
|
|
|
aria-expanded="true">
|
2023-06-19 21:45:22 +08:00
|
|
|
<span class="sn-icon sn-icon-down"></span>
|
2023-06-27 17:58:02 +08:00
|
|
|
</button>
|
2018-05-15 00:33:57 +08:00
|
|
|
<ul class="dropdown-menu custom-dropdown-menu dropdown-menu-right" aria-labelledby="<%= id %>">
|
2017-01-25 19:01:23 +08:00
|
|
|
<li class="dropdown-header">
|
|
|
|
<%= t("users.settings.teams.edit.user_dropdown.role_label") %>
|
|
|
|
</li>
|
2022-06-01 21:06:19 +08:00
|
|
|
<%= bootstrap_form_for user_assignment,
|
2017-01-25 19:01:23 +08:00
|
|
|
url: update_role_path,
|
|
|
|
method: :put,
|
|
|
|
remote: true,
|
|
|
|
data: { id: 'update-role-form' } do |f| %>
|
2022-06-01 21:06:19 +08:00
|
|
|
<input type="hidden" name="user_assignment[user_role_id]" data-field="role" value="" %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<% end %>
|
2022-06-01 21:06:19 +08:00
|
|
|
<% 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 %>
|
2023-06-15 21:12:51 +08:00
|
|
|
<span class="sn-icon sn-icon-check"></span>
|
2022-06-01 21:06:19 +08:00
|
|
|
<%= user_role.name %>
|
|
|
|
<% else %>
|
|
|
|
<a href="#" data-action="submit-role" data-value="<%= user_role.id %>">
|
2023-06-21 14:12:31 +08:00
|
|
|
<span class="sn-icon sn-icon-check invisible"></span>
|
2022-06-01 21:06:19 +08:00
|
|
|
<%= user_role.name %>
|
|
|
|
</a>
|
|
|
|
<% end %>
|
|
|
|
</li>
|
|
|
|
<% end %>
|
2017-01-25 19:01:23 +08:00
|
|
|
<li role="separator" class="divider"></li>
|
|
|
|
<li>
|
|
|
|
<%= destroy_uo_link %>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<% end %>
|