From dc038a7108f3e61e708310b5a9ab4b193723366b Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 12 Jul 2013 19:01:39 +0300 Subject: [PATCH] Rename Group#people to Group#members --- app/assets/javascripts/dispatcher.js.coffee | 2 +- app/controllers/groups_controller.rb | 2 +- app/controllers/users_groups_controller.rb | 4 ++-- app/views/groups/_new_group_member.html.haml | 3 +-- app/views/groups/members.html.haml | 21 +++++++++++++++++++++ app/views/groups/people.html.haml | 20 -------------------- app/views/layouts/nav/_group.html.haml | 4 ++-- app/views/projects/team_members/_group_members.html.haml | 2 +- config/routes.rb | 2 +- features/group/group.feature | 2 +- features/steps/shared/paths.rb | 4 ++-- 11 files changed, 33 insertions(+), 33 deletions(-) create mode 100644 app/views/groups/members.html.haml delete mode 100644 app/views/groups/people.html.haml diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee index 890b6a0..d490233 100644 --- a/app/assets/javascripts/dispatcher.js.coffee +++ b/app/assets/javascripts/dispatcher.js.coffee @@ -30,7 +30,7 @@ class Dispatcher new Wall(project_id) when 'projects:teams:members:index' new TeamMembers() - when 'groups:people' + when 'groups:members' new GroupMembers() when 'projects:tree:show' new TreeView() diff --git a/app/controllers/groups_controller.rb b/app/controllers/groups_controller.rb index 416bfa7..1190dd4 100644 --- a/app/controllers/groups_controller.rb +++ b/app/controllers/groups_controller.rb @@ -61,7 +61,7 @@ class GroupsController < ApplicationController end end - def people + def members @project = group.projects.find(params[:project_id]) if params[:project_id] @members = group.users_groups.order('group_access DESC') @users_group = UsersGroup.new diff --git a/app/controllers/users_groups_controller.rb b/app/controllers/users_groups_controller.rb index c30034d..36eb8db 100644 --- a/app/controllers/users_groups_controller.rb +++ b/app/controllers/users_groups_controller.rb @@ -9,7 +9,7 @@ class UsersGroupsController < ApplicationController def create @group.add_users(params[:user_ids].split(','), params[:group_access]) - redirect_to people_group_path(@group), notice: 'Users were successfully added.' + redirect_to members_group_path(@group), notice: 'Users were successfully added.' end def update @@ -21,7 +21,7 @@ class UsersGroupsController < ApplicationController @users_group.destroy unless @users_group.user == @group.owner respond_to do |format| - format.html { redirect_to people_group_path(@group), notice: 'User was successfully removed from group.' } + format.html { redirect_to members_group_path(@group), notice: 'User was successfully removed from group.' } format.js { render nothing: true } end end diff --git a/app/views/groups/_new_group_member.html.haml b/app/views/groups/_new_group_member.html.haml index 786a52a..87c9c32 100644 --- a/app/views/groups/_new_group_member.html.haml +++ b/app/views/groups/_new_group_member.html.haml @@ -2,7 +2,7 @@ %fieldset %legend= "New Group member(s) for #{@group.name}" - %h6 1. Choose people you want in the group + %h6 1. Choose users you want in the group .clearfix = f.label :user_ids, "People" .input= users_select_tag(:user_ids, multiple: true, class: 'input-large') @@ -13,6 +13,5 @@ .input= select_tag :group_access, options_for_select(UsersGroup.group_access_roles, @users_group.group_access), class: "project-access-select chosen" .form-actions - = hidden_field_tag :redirect_to, people_group_path(@group) = f.submit 'Add users into group', class: "btn btn-create" diff --git a/app/views/groups/members.html.haml b/app/views/groups/members.html.haml new file mode 100644 index 0000000..bd84a5e --- /dev/null +++ b/app/views/groups/members.html.haml @@ -0,0 +1,21 @@ +- can_manage_group = current_user.can? :manage_group, @group +.row + .span6 + - if can_manage_group + = render "new_group_member" + - else + .light-well + %h4.nothing_here_message + Only group owners can manage group members + .span6 + .ui-box + %h5.title + %strong #{@group.name} + Group Members + %small + (#{@members.count}) + %ul.well-list + - @members.each do |member| + = render 'users_groups/users_group', member: member, show_controls: can_manage_group + %p.light + Group members get access to all projects in this group diff --git a/app/views/groups/people.html.haml b/app/views/groups/people.html.haml deleted file mode 100644 index 5b595ad..0000000 --- a/app/views/groups/people.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -- can_manage_group = current_user.can? :manage_group, @group -.row - .span6 - - if can_manage_group - = render "new_group_member" - - else - .light-well - %h4.nothing_here_message - Only group owners can manage group members - .span6 - .ui-box - %h5.title - #{@group.name} Group Members - %small - (#{@members.count}) - %ul.well-list - - @members.each do |member| - = render 'users_groups/users_group', member: member, show_controls: can_manage_group - %p.light - Group members get access to all projects in this group diff --git a/app/views/layouts/nav/_group.html.haml b/app/views/layouts/nav/_group.html.haml index f3cdb5a..a8bb3b9 100644 --- a/app/views/layouts/nav/_group.html.haml +++ b/app/views/layouts/nav/_group.html.haml @@ -10,8 +10,8 @@ = link_to merge_requests_group_path(@group) do Merge Requests %span.count= current_user.cared_merge_requests.opened.of_group(@group).count - = nav_link(path: 'groups#people') do - = link_to "People", people_group_path(@group) + = nav_link(path: 'groups#members') do + = link_to "Members", members_group_path(@group) - if can?(current_user, :manage_group, @group) = nav_link(path: 'groups#edit') do diff --git a/app/views/projects/team_members/_group_members.html.haml b/app/views/projects/team_members/_group_members.html.haml index 7d9333d..e01072d 100644 --- a/app/views/projects/team_members/_group_members.html.haml +++ b/app/views/projects/team_members/_group_members.html.haml @@ -3,7 +3,7 @@ %strong #{@group.name} Group members (#{@group.users_groups.count}) .pull-right - = link_to people_group_path(@group), class: 'btn btn-small' do + = link_to members_group_path(@group), class: 'btn btn-small' do %i.icon-edit %ul.well-list - @group.users_groups.order('group_access DESC').each do |member| diff --git a/config/routes.rb b/config/routes.rb index 53476e6..30c5dea 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -146,7 +146,7 @@ Gitlab::Application.routes.draw do member do get :issues get :merge_requests - get :people + get :members end resources :users_groups, only: [:create, :update, :destroy] diff --git a/features/group/group.feature b/features/group/group.feature index 64424f4..9fec19a 100644 --- a/features/group/group.feature +++ b/features/group/group.feature @@ -22,7 +22,7 @@ Feature: Groups @javascript Scenario: I should add user to projects in Group Given I have new user "John" - When I visit group people page + When I visit group members page And I select user "John" from list with role "Reporter" Then I should see user "John" in team list diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index b2c23cf..6853e8d 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -21,8 +21,8 @@ module SharedPaths visit merge_requests_group_path(current_group) end - step 'I visit group people page' do - visit people_group_path(current_group) + step 'I visit group members page' do + visit members_group_path(current_group) end step 'I visit group settings page' do -- libgit2 0.21.2