Commit fed6ab2481257e67822825fad1203ed073028a22
1 parent
61c74493
Exists in
master
and in
4 other branches
Change representation of team members. Group by role
Showing
4 changed files
with
21 additions
and
20 deletions
Show diff stats
Gemfile.lock
@@ -108,7 +108,7 @@ GEM | @@ -108,7 +108,7 @@ GEM | ||
108 | bcrypt-ruby (3.0.1) | 108 | bcrypt-ruby (3.0.1) |
109 | blankslate (2.1.2.4) | 109 | blankslate (2.1.2.4) |
110 | bootstrap-sass (2.0.4.0) | 110 | bootstrap-sass (2.0.4.0) |
111 | - builder (3.0.0) | 111 | + builder (3.0.2) |
112 | capybara (1.1.2) | 112 | capybara (1.1.2) |
113 | mime-types (>= 1.16) | 113 | mime-types (>= 1.16) |
114 | nokogiri (>= 1.3.3) | 114 | nokogiri (>= 1.3.3) |
@@ -125,7 +125,7 @@ GEM | @@ -125,7 +125,7 @@ GEM | ||
125 | charlock_holmes (0.6.8) | 125 | charlock_holmes (0.6.8) |
126 | childprocess (0.3.2) | 126 | childprocess (0.3.2) |
127 | ffi (~> 1.0.6) | 127 | ffi (~> 1.0.6) |
128 | - chosen-rails (0.9.8) | 128 | + chosen-rails (0.9.8.3) |
129 | railties (~> 3.0) | 129 | railties (~> 3.0) |
130 | thor (~> 0.14) | 130 | thor (~> 0.14) |
131 | coderay (1.0.6) | 131 | coderay (1.0.6) |
app/views/keys/index.html.haml
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | = link_to "Add new", new_key_path, class: "btn right" | 3 | = link_to "Add new", new_key_path, class: "btn right" |
4 | 4 | ||
5 | %hr | 5 | %hr |
6 | -%p.slead | 6 | +%p.slead |
7 | SSH key allows you to establish a secure connection between your computer and GitLab | 7 | SSH key allows you to establish a secure connection between your computer and GitLab |
8 | 8 | ||
9 | 9 | ||
@@ -15,7 +15,7 @@ | @@ -15,7 +15,7 @@ | ||
15 | %th | 15 | %th |
16 | - @keys.each do |key| | 16 | - @keys.each do |key| |
17 | = render(partial: 'show', locals: {key: key}) | 17 | = render(partial: 'show', locals: {key: key}) |
18 | - - if @keys.blank? | 18 | + - if @keys.blank? |
19 | %tr | 19 | %tr |
20 | %td{colspan: 3} | 20 | %td{colspan: 3} |
21 | %h3.nothing_here_message There are no SSH keys with access to your account. | 21 | %h3.nothing_here_message There are no SSH keys with access to your account. |
app/views/projects/_team.html.haml
1 | -%table | ||
2 | - %thead | ||
3 | - %tr | ||
4 | - %th User | ||
5 | - %th Permissions | ||
6 | - %tbody | ||
7 | - - @project.users_projects.each do |up| | ||
8 | - = render(partial: 'team_members/show', locals: {member: up}) | 1 | +- @project.users_projects.group_by(&:project_access).each do |access, members| |
2 | + %table | ||
3 | + %thead | ||
4 | + %tr | ||
5 | + %th.span7= Project.access_options.key(access).pluralize | ||
6 | + %th | ||
7 | + %tbody | ||
8 | + - members.each do |up| | ||
9 | + = render(partial: 'team_members/show', locals: {member: up}) | ||
9 | 10 | ||
10 | 11 | ||
11 | :javascript | 12 | :javascript |
app/views/team_members/_show.html.haml
@@ -2,12 +2,6 @@ | @@ -2,12 +2,6 @@ | ||
2 | - allow_admin = can? current_user, :admin_project, @project | 2 | - allow_admin = can? current_user, :admin_project, @project |
3 | %tr{id: dom_id(member), class: "team_member_row user_#{user.id}"} | 3 | %tr{id: dom_id(member), class: "team_member_row user_#{user.id}"} |
4 | %td | 4 | %td |
5 | - .right | ||
6 | - - if @project.owner == user | ||
7 | - %span.label Project Owner | ||
8 | - - if user.blocked | ||
9 | - %span.label Blocked | ||
10 | - | ||
11 | = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do | 5 | = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do |
12 | = image_tag gravatar_icon(user.email, 40), class: "avatar s32" | 6 | = image_tag gravatar_icon(user.email, 40), class: "avatar s32" |
13 | = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do | 7 | = link_to project_team_member_path(@project, member), title: user.name, class: "dark" do |
@@ -16,5 +10,11 @@ | @@ -16,5 +10,11 @@ | ||
16 | %div.cgray= user.email | 10 | %div.cgray= user.email |
17 | 11 | ||
18 | %td | 12 | %td |
19 | - = form_for(member, as: :team_member, url: project_team_member_path(@project, member)) do |f| | ||
20 | - = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, class: "medium project-access-select", disabled: !allow_admin | 13 | + .right |
14 | + - if @project.owner == user | ||
15 | + %span.btn.disabled.success Project Owner | ||
16 | + - if user.blocked | ||
17 | + %span.btn.disabled.blocked Blocked | ||
18 | + - if allow_admin | ||
19 | + = form_for(member, as: :team_member, url: project_team_member_path(@project, member)) do |f| | ||
20 | + = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, class: "medium project-access-select" |