Commit dc038a7108f3e61e708310b5a9ab4b193723366b
1 parent
3232f547
Exists in
master
and in
4 other branches
Rename Group#people to Group#members
Showing
11 changed files
with
33 additions
and
33 deletions
Show diff stats
app/assets/javascripts/dispatcher.js.coffee
| @@ -30,7 +30,7 @@ class Dispatcher | @@ -30,7 +30,7 @@ class Dispatcher | ||
| 30 | new Wall(project_id) | 30 | new Wall(project_id) |
| 31 | when 'projects:teams:members:index' | 31 | when 'projects:teams:members:index' |
| 32 | new TeamMembers() | 32 | new TeamMembers() |
| 33 | - when 'groups:people' | 33 | + when 'groups:members' |
| 34 | new GroupMembers() | 34 | new GroupMembers() |
| 35 | when 'projects:tree:show' | 35 | when 'projects:tree:show' |
| 36 | new TreeView() | 36 | new TreeView() |
app/controllers/groups_controller.rb
| @@ -61,7 +61,7 @@ class GroupsController < ApplicationController | @@ -61,7 +61,7 @@ class GroupsController < ApplicationController | ||
| 61 | end | 61 | end |
| 62 | end | 62 | end |
| 63 | 63 | ||
| 64 | - def people | 64 | + def members |
| 65 | @project = group.projects.find(params[:project_id]) if params[:project_id] | 65 | @project = group.projects.find(params[:project_id]) if params[:project_id] |
| 66 | @members = group.users_groups.order('group_access DESC') | 66 | @members = group.users_groups.order('group_access DESC') |
| 67 | @users_group = UsersGroup.new | 67 | @users_group = UsersGroup.new |
app/controllers/users_groups_controller.rb
| @@ -9,7 +9,7 @@ class UsersGroupsController < ApplicationController | @@ -9,7 +9,7 @@ class UsersGroupsController < ApplicationController | ||
| 9 | def create | 9 | def create |
| 10 | @group.add_users(params[:user_ids].split(','), params[:group_access]) | 10 | @group.add_users(params[:user_ids].split(','), params[:group_access]) |
| 11 | 11 | ||
| 12 | - redirect_to people_group_path(@group), notice: 'Users were successfully added.' | 12 | + redirect_to members_group_path(@group), notice: 'Users were successfully added.' |
| 13 | end | 13 | end |
| 14 | 14 | ||
| 15 | def update | 15 | def update |
| @@ -21,7 +21,7 @@ class UsersGroupsController < ApplicationController | @@ -21,7 +21,7 @@ class UsersGroupsController < ApplicationController | ||
| 21 | @users_group.destroy unless @users_group.user == @group.owner | 21 | @users_group.destroy unless @users_group.user == @group.owner |
| 22 | 22 | ||
| 23 | respond_to do |format| | 23 | respond_to do |format| |
| 24 | - format.html { redirect_to people_group_path(@group), notice: 'User was successfully removed from group.' } | 24 | + format.html { redirect_to members_group_path(@group), notice: 'User was successfully removed from group.' } |
| 25 | format.js { render nothing: true } | 25 | format.js { render nothing: true } |
| 26 | end | 26 | end |
| 27 | end | 27 | end |
app/views/groups/_new_group_member.html.haml
| @@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
| 2 | %fieldset | 2 | %fieldset |
| 3 | %legend= "New Group member(s) for #{@group.name}" | 3 | %legend= "New Group member(s) for #{@group.name}" |
| 4 | 4 | ||
| 5 | - %h6 1. Choose people you want in the group | 5 | + %h6 1. Choose users you want in the group |
| 6 | .clearfix | 6 | .clearfix |
| 7 | = f.label :user_ids, "People" | 7 | = f.label :user_ids, "People" |
| 8 | .input= users_select_tag(:user_ids, multiple: true, class: 'input-large') | 8 | .input= users_select_tag(:user_ids, multiple: true, class: 'input-large') |
| @@ -13,6 +13,5 @@ | @@ -13,6 +13,5 @@ | ||
| 13 | .input= select_tag :group_access, options_for_select(UsersGroup.group_access_roles, @users_group.group_access), class: "project-access-select chosen" | 13 | .input= select_tag :group_access, options_for_select(UsersGroup.group_access_roles, @users_group.group_access), class: "project-access-select chosen" |
| 14 | 14 | ||
| 15 | .form-actions | 15 | .form-actions |
| 16 | - = hidden_field_tag :redirect_to, people_group_path(@group) | ||
| 17 | = f.submit 'Add users into group', class: "btn btn-create" | 16 | = f.submit 'Add users into group', class: "btn btn-create" |
| 18 | 17 |
| @@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
| 1 | +- can_manage_group = current_user.can? :manage_group, @group | ||
| 2 | +.row | ||
| 3 | + .span6 | ||
| 4 | + - if can_manage_group | ||
| 5 | + = render "new_group_member" | ||
| 6 | + - else | ||
| 7 | + .light-well | ||
| 8 | + %h4.nothing_here_message | ||
| 9 | + Only group owners can manage group members | ||
| 10 | + .span6 | ||
| 11 | + .ui-box | ||
| 12 | + %h5.title | ||
| 13 | + %strong #{@group.name} | ||
| 14 | + Group Members | ||
| 15 | + %small | ||
| 16 | + (#{@members.count}) | ||
| 17 | + %ul.well-list | ||
| 18 | + - @members.each do |member| | ||
| 19 | + = render 'users_groups/users_group', member: member, show_controls: can_manage_group | ||
| 20 | + %p.light | ||
| 21 | + Group members get access to all projects in this group |
app/views/groups/people.html.haml
| @@ -1,20 +0,0 @@ | @@ -1,20 +0,0 @@ | ||
| 1 | -- can_manage_group = current_user.can? :manage_group, @group | ||
| 2 | -.row | ||
| 3 | - .span6 | ||
| 4 | - - if can_manage_group | ||
| 5 | - = render "new_group_member" | ||
| 6 | - - else | ||
| 7 | - .light-well | ||
| 8 | - %h4.nothing_here_message | ||
| 9 | - Only group owners can manage group members | ||
| 10 | - .span6 | ||
| 11 | - .ui-box | ||
| 12 | - %h5.title | ||
| 13 | - #{@group.name} Group Members | ||
| 14 | - %small | ||
| 15 | - (#{@members.count}) | ||
| 16 | - %ul.well-list | ||
| 17 | - - @members.each do |member| | ||
| 18 | - = render 'users_groups/users_group', member: member, show_controls: can_manage_group | ||
| 19 | - %p.light | ||
| 20 | - Group members get access to all projects in this group |
app/views/layouts/nav/_group.html.haml
| @@ -10,8 +10,8 @@ | @@ -10,8 +10,8 @@ | ||
| 10 | = link_to merge_requests_group_path(@group) do | 10 | = link_to merge_requests_group_path(@group) do |
| 11 | Merge Requests | 11 | Merge Requests |
| 12 | %span.count= current_user.cared_merge_requests.opened.of_group(@group).count | 12 | %span.count= current_user.cared_merge_requests.opened.of_group(@group).count |
| 13 | - = nav_link(path: 'groups#people') do | ||
| 14 | - = link_to "People", people_group_path(@group) | 13 | + = nav_link(path: 'groups#members') do |
| 14 | + = link_to "Members", members_group_path(@group) | ||
| 15 | 15 | ||
| 16 | - if can?(current_user, :manage_group, @group) | 16 | - if can?(current_user, :manage_group, @group) |
| 17 | = nav_link(path: 'groups#edit') do | 17 | = nav_link(path: 'groups#edit') do |
app/views/projects/team_members/_group_members.html.haml
| @@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
| 3 | %strong #{@group.name} Group | 3 | %strong #{@group.name} Group |
| 4 | members (#{@group.users_groups.count}) | 4 | members (#{@group.users_groups.count}) |
| 5 | .pull-right | 5 | .pull-right |
| 6 | - = link_to people_group_path(@group), class: 'btn btn-small' do | 6 | + = link_to members_group_path(@group), class: 'btn btn-small' do |
| 7 | %i.icon-edit | 7 | %i.icon-edit |
| 8 | %ul.well-list | 8 | %ul.well-list |
| 9 | - @group.users_groups.order('group_access DESC').each do |member| | 9 | - @group.users_groups.order('group_access DESC').each do |member| |
config/routes.rb
| @@ -146,7 +146,7 @@ Gitlab::Application.routes.draw do | @@ -146,7 +146,7 @@ Gitlab::Application.routes.draw do | ||
| 146 | member do | 146 | member do |
| 147 | get :issues | 147 | get :issues |
| 148 | get :merge_requests | 148 | get :merge_requests |
| 149 | - get :people | 149 | + get :members |
| 150 | end | 150 | end |
| 151 | 151 | ||
| 152 | resources :users_groups, only: [:create, :update, :destroy] | 152 | resources :users_groups, only: [:create, :update, :destroy] |
features/group/group.feature
| @@ -22,7 +22,7 @@ Feature: Groups | @@ -22,7 +22,7 @@ Feature: Groups | ||
| 22 | @javascript | 22 | @javascript |
| 23 | Scenario: I should add user to projects in Group | 23 | Scenario: I should add user to projects in Group |
| 24 | Given I have new user "John" | 24 | Given I have new user "John" |
| 25 | - When I visit group people page | 25 | + When I visit group members page |
| 26 | And I select user "John" from list with role "Reporter" | 26 | And I select user "John" from list with role "Reporter" |
| 27 | Then I should see user "John" in team list | 27 | Then I should see user "John" in team list |
| 28 | 28 |
features/steps/shared/paths.rb
| @@ -21,8 +21,8 @@ module SharedPaths | @@ -21,8 +21,8 @@ module SharedPaths | ||
| 21 | visit merge_requests_group_path(current_group) | 21 | visit merge_requests_group_path(current_group) |
| 22 | end | 22 | end |
| 23 | 23 | ||
| 24 | - step 'I visit group people page' do | ||
| 25 | - visit people_group_path(current_group) | 24 | + step 'I visit group members page' do |
| 25 | + visit members_group_path(current_group) | ||
| 26 | end | 26 | end |
| 27 | 27 | ||
| 28 | step 'I visit group settings page' do | 28 | step 'I visit group settings page' do |