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

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
3
.team_member_show
4
  - if can? current_user, :admin_project, @project
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
5
    = link_to 'Remove from team', project_team_member_path(@project, @member), confirm: 'Are you sure?', method: :delete, class: "right btn btn-remove"
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
6
  .profile_avatar_holder
7
    = image_tag gravatar_icon(@member.email, 60), class: "borders"
8
  %h3.page_title
9 10
    = @member.name
    %small (@#{@member.username})
11

Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
12 13
  %hr
  .back_link
14
    %br
15
    = link_to project_team_index_path(@project), class: "" do
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
16 17 18
      ← To team list
  %br
  .row
randx's avatar
randx committed
19
    .span6
randx's avatar
randx committed
20
      %table.lite
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
21 22
        %tr
          %td Email
23
          %td= mail_to @member.email
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
24 25
        %tr
          %td Skype
26 27
          %td= @member.skype
        - unless @member.linkedin.blank?
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
28 29
          %tr
            %td LinkedIn
30 31
            %td= @member.linkedin
        - unless @member.twitter.blank?
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
32 33
          %tr
            %td Twitter
34 35
            %td= @member.twitter
        - unless @member.bio.blank?
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
36 37
          %tr
            %td Bio
38
            %td= @member.bio
randx's avatar
randx committed
39
    .span6
randx's avatar
randx committed
40
      %table.lite
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
41 42
        %tr
          %td Member since
43
          %td= @user_project_relation.created_at.stamp("Aug 21, 2011")
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
44 45 46
        %tr
          %td
            Project Access:
47
            %small (#{link_to "read more", help_permissions_path, class: "vlink"})
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
48
          %td
49 50
            = 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
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
51
  %hr
52
  = render @events
53 54
:javascript
  $(function(){
55
    $('.repo-access-select, .project-access-select').live("change", function() {
56 57 58
      $(this.form).submit();
    });
  })
59