- allow_admin = can? current_user, :admin_project, @project

.team_member_show
  - if can? current_user, :admin_project, @project
    = link_to 'Remove from team', project_team_member_path(@project, @member), confirm: 'Are you sure?', method: :delete, class: "right btn danger"
  .profile_avatar_holder
    = image_tag gravatar_icon(@member.email, 60), class: "borders"
  %h3.page_title
    = @member.name
    %small (@#{@member.username})

  %hr
  .back_link
    %br
    = link_to project_team_index_path(@project), class: "" do
      ← To team list
  %br
  .row
    .span6
      %table.lite
        %tr
          %td Email
          %td= mail_to @member.email
        %tr
          %td Skype
          %td= @member.skype
        - unless @member.linkedin.blank?
          %tr
            %td LinkedIn
            %td= @member.linkedin
        - unless @member.twitter.blank?
          %tr
            %td Twitter
            %td= @member.twitter
        - unless @member.bio.blank?
          %tr
            %td Bio
            %td= @member.bio
    .span6
      %table.lite
        %tr
          %td Member since
          %td= @user_project_relation.created_at.stamp("Aug 21, 2011")
        %tr
          %td
            Project Access:
            %small (#{link_to "read more", help_permissions_path, class: "vlink"})
          %td
            = form_for(@user_project_relation, as: :team_member, url: project_team_member_path(@project, @member)) do |f|
              = f.select :project_access, options_for_select(Project.access_options, @user_project_relation.project_access), {}, class: "project-access-select", disabled: !allow_admin
  %hr
  = render @events
:javascript
  $(function(){
    $('.repo-access-select, .project-access-select').live("change", function() {
      $(this.form).submit();
    });
  })