<% if @user %>
<% if @user.locked? %>
-
<%= context_menu_link sprite_icon('unlock', l(:button_unlock)), user_path(@user, user: { status: User::STATUS_ACTIVE }, back_url: @back), method: :put, class: 'icon icon-unlock' %>
<% elsif User.current != @user %>
-
<%= context_menu_link sprite_icon('lock', l(:button_lock)), user_path(@user, user: { status: User::STATUS_LOCKED }, back_url: @back), method: :put, class: 'icon icon-lock' %>
<% end %>
-
<%= context_menu_link sprite_icon('edit', l(:button_edit)), edit_user_path(@user, back_url: @back), class: 'icon icon-edit' %>
<% unless User.current == @user %>
-
<%= context_menu_link sprite_icon('del', l(:button_delete)), user_path(@user, back_url: @back),
method: :delete, class: 'icon icon-del' %>
<% end %>
<% else %>
<% unless @users.all?(&:locked?) %>
-
<%= context_menu_link sprite_icon('lock', l(:button_lock)), bulk_lock_users_path(ids: @users.map(&:id)), method: :post, class: 'icon icon-lock' %>
<% else %>
-
<%= context_menu_link sprite_icon('unlock', l(:button_unlock)), bulk_unlock_users_path(ids: @users.map(&:id)), method: :post, class: 'icon icon-unlock' %>
<% end %>
-
<%= context_menu_link sprite_icon('del', l(:button_delete)),
{controller: 'users', action: 'bulk_destroy', ids: @users.map(&:id)},
method: :delete, class: 'icon icon-del' %>
<% end %>