show.html.haml 1.79 KB
Newer Older
1
- allow_admin = can? current_user, :admin_project, @project
2
- user = @team_member.user
3

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
4
.team_member_show
5
  - if can? current_user, :admin_project, @project
6
    = link_to 'Remove from team', project_team_member_path(project_id: @project, id: @team_member.id), confirm: 'Are you sure?', method: :delete, class: "right btn btn-danger"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
7
  .profile_avatar_holder
8
    = image_tag gravatar_icon(user.email, 60), class: "borders"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
9 10 11 12
  %h3
    = user.name
    %small
      = user.email
13

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
14 15
  %hr
  .back_link
16
    %br
17
    = link_to team_project_path(@project), class: "" do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
18 19 20
      ← To team list
  %br
  .row
randx's avatar
randx committed
21
    .span6
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
      %table.no-borders
        %tr
          %td Email
          %td= mail_to user.email
        %tr
          %td Skype
          %td= user.skype
        - unless user.linkedin.blank?
          %tr
            %td LinkedIn
            %td= user.linkedin
        - unless user.twitter.blank?
          %tr
            %td Twitter
            %td= user.twitter
        - unless user.bio.blank?
          %tr
            %td Bio
            %td= user.bio
randx's avatar
randx committed
41
    .span6
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
42 43 44 45 46 47 48
      %table.no-borders
        %tr
          %td Member since
          %td= @team_member.created_at.stamp("Aug 21, 2011")
        %tr
          %td
            Project Access:
49
            %small (#{link_to "read more", help_permissions_path, class: "vlink"})
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
50
          %td
51 52
            = form_for(@team_member, as: :team_member, url: project_team_member_path(@project, @team_member)) do |f|
              = f.select :project_access, options_for_select(Project.access_options, @team_member.project_access), {}, class: "project-access-select", disabled: !allow_admin
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
53
  %hr
54
  = render user.recent_events.limit(5)
55 56
:javascript
  $(function(){
57
    $('.repo-access-select, .project-access-select').live("change", function() {
58 59 60
      $(this.form).submit();
    });
  })
61