- user = member.user
- allow_admin = can? current_user, :manage_user_team, @team
%li{id: dom_id(member), class: "team_member_row user_#{user.id}"}
  .row
    .span3
      = link_to user_path(user.username), title: user.name, class: "dark" do
        = image_tag gravatar_icon(user.email, 40), class: "avatar s32", alt: ''
      = link_to user_path(user.username), title: user.name, class: "dark" do
        %strong= truncate(user.name, lenght: 40)
        %br
        %small.cgray= user.username

    .span5.pull-right
      - if allow_admin
        .pull-left
          = form_for(member, as: :team_member, url: team_member_path(@team, user)) do |f|
            = label_tag :group_admin do
              = f.check_box :group_admin, class: 'trigger-submit'
              %span Admin access
            &nbsp;
            = f.select :permission, options_for_select(UsersProject.access_roles, @team.default_projects_access(user)), {}, class: "span2 trigger-submit"
      .pull-right
        - if current_user == user
          %span.label.label-success This is you!
        - if @team.owner == user
          %span.label.label-info Owner
        - elsif user.blocked?
          %span.label.label-error Blocked
        - elsif allow_admin
          = link_to team_member_path(@team, user), confirm: remove_from_user_team_message(@team, user), method: :delete, class: "btn-tiny btn btn-remove", title: "Remove from team" do
            %i.icon-minus.icon-white
