Commit 9b3e156e authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Move profile groups page to dashboard

parent 8b551ee3
...@@ -31,6 +31,7 @@ v 7.9.0 (unreleased) ...@@ -31,6 +31,7 @@ v 7.9.0 (unreleased)
- Condense commits already in target branch when updating merge request source branch. - Condense commits already in target branch when updating merge request source branch.
- Send notifications and leave system comments when bulk updating issues. - Send notifications and leave system comments when bulk updating issues.
- Automatically link commit ranges to compare page: sha1...sha4 or sha1..sha4 (includes sha1 in comparison) - Automatically link commit ranges to compare page: sha1...sha4 or sha1..sha4 (includes sha1 in comparison)
- Move groups page from profile to dashboard
v 7.8.2 v 7.8.2
- Fix service migration issue when upgrading from versions prior to 7.3 - Fix service migration issue when upgrading from versions prior to 7.3
......
class Profiles::GroupsController < ApplicationController class Dashboard::GroupsController < ApplicationController
layout "profile"
def index def index
@user_groups = current_user.group_members.page(params[:page]).per(20) @user_groups = current_user.group_members.page(params[:page]).per(20)
end end
...@@ -9,7 +7,7 @@ class Profiles::GroupsController < ApplicationController ...@@ -9,7 +7,7 @@ class Profiles::GroupsController < ApplicationController
@users_group = group.group_members.where(user_id: current_user.id).first @users_group = group.group_members.where(user_id: current_user.id).first
if can?(current_user, :destroy, @users_group) if can?(current_user, :destroy, @users_group)
@users_group.destroy @users_group.destroy
redirect_to(profile_groups_path, info: "You left #{group.name} group.") redirect_to(dashboard_groups_path, info: "You left #{group.name} group.")
else else
return render_403 return render_403
end end
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
Settings Settings
- if can?(current_user, :destroy, user_group) - if can?(current_user, :destroy, user_group)
= link_to leave_profile_group_path(group), data: { confirm: leave_group_message(group.name) }, method: :delete, class: "btn-small btn btn-grouped", title: 'Remove user from group' do = link_to leave_dashboard_group_path(group), data: { confirm: leave_group_message(group.name) }, method: :delete, class: "btn-small btn btn-grouped", title: 'Remove user from group' do
%i.fa.fa-sign-out %i.fa.fa-sign-out
Leave Leave
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
%i.fa.fa-pencil-square-o %i.fa.fa-pencil-square-o
- if can?(current_user, :destroy, member) - if can?(current_user, :destroy, member)
- if current_user == member.user - if current_user == member.user
= link_to leave_profile_group_path(@group), data: { confirm: leave_group_message(@group.name)}, method: :delete, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do = link_to leave_dashboard_group_path(@group), data: { confirm: leave_group_message(@group.name)}, method: :delete, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do
%i.fa.fa-minus.fa-inverse %i.fa.fa-minus.fa-inverse
- else - else
= link_to group_group_member_path(@group, member), data: { confirm: remove_user_from_group_message(@group, user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do = link_to group_group_member_path(@group, member), data: { confirm: remove_user_from_group_message(@group, user) }, method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do
......
...@@ -9,6 +9,11 @@ ...@@ -9,6 +9,11 @@
%i.fa.fa-cube %i.fa.fa-cube
%span %span
Projects Projects
= nav_link(controller: :groups) do
= link_to dashboard_groups_path, title: 'Groups' do
%i.fa.fa-group
%span
Groups
= nav_link(controller: :milestones) do = nav_link(controller: :milestones) do
= link_to dashboard_milestones_path, title: 'Milestones' do = link_to dashboard_milestones_path, title: 'Milestones' do
%i.fa.fa-clock-o %i.fa.fa-clock-o
......
...@@ -43,11 +43,6 @@ ...@@ -43,11 +43,6 @@
%i.fa.fa-image %i.fa.fa-image
%span %span
Design Design
= nav_link(controller: :groups) do
= link_to profile_groups_path, title: 'Groups' do
%i.fa.fa-group
%span
Groups
= nav_link(path: 'profiles#history') do = nav_link(path: 'profiles#history') do
= link_to history_profile_path, title: 'History' do = link_to history_profile_path, title: 'History' do
%i.fa.fa-history %i.fa.fa-history
......
...@@ -193,11 +193,6 @@ Gitlab::Application.routes.draw do ...@@ -193,11 +193,6 @@ Gitlab::Application.routes.draw do
end end
resources :keys resources :keys
resources :emails, only: [:index, :create, :destroy] resources :emails, only: [:index, :create, :destroy]
resources :groups, only: [:index] do
member do
delete :leave
end
end
resource :avatar, only: [:destroy] resource :avatar, only: [:destroy]
end end
end end
...@@ -220,6 +215,12 @@ Gitlab::Application.routes.draw do ...@@ -220,6 +215,12 @@ Gitlab::Application.routes.draw do
scope module: :dashboard do scope module: :dashboard do
resources :milestones, only: [:index, :show] resources :milestones, only: [:index, :show]
resources :groups, only: [:index] do
member do
delete :leave
end
end
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment