Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/admin/groups_controller.rb8
-rw-r--r--app/views/admin/groups/_form.html.haml2
-rw-r--r--app/views/admin/groups/edit.html.haml3
-rw-r--r--app/views/admin/groups/index.html.haml1
-rw-r--r--app/views/admin/groups/show.html.haml4
-rw-r--r--app/views/admin/projects/index.html.haml1
-rw-r--r--app/views/admin/projects/show.html.haml1
-rw-r--r--app/views/admin/shared/_projects_head.html.haml5
-rw-r--r--app/views/groups/_projects.html.haml5
-rw-r--r--app/views/layouts/admin.html.haml2
-rw-r--r--config/routes.rb1
11 files changed, 26 insertions, 7 deletions
diff --git a/app/controllers/admin/groups_controller.rb b/app/controllers/admin/groups_controller.rb
index 612abf8c50a..49082e1d0b6 100644
--- a/app/controllers/admin/groups_controller.rb
+++ b/app/controllers/admin/groups_controller.rb
@@ -52,6 +52,14 @@ class Admin::GroupsController < AdminController
redirect_to :back, notice: 'Group was successfully updated.'
end
+ def remove_project
+ @project = Project.find(params[:project_id])
+ @project.group_id = nil
+ @project.save
+
+ redirect_to :back, notice: 'Group was successfully updated.'
+ end
+
def destroy
@group.destroy
diff --git a/app/views/admin/groups/_form.html.haml b/app/views/admin/groups/_form.html.haml
index a1ba940672d..46c5956394f 100644
--- a/app/views/admin/groups/_form.html.haml
+++ b/app/views/admin/groups/_form.html.haml
@@ -16,4 +16,4 @@
= f.text_field :code, placeholder: "example"
.form-actions
- = f.submit 'Create group', class: "btn primary"
+ = f.submit 'Save group', class: "btn save-btn"
diff --git a/app/views/admin/groups/edit.html.haml b/app/views/admin/groups/edit.html.haml
new file mode 100644
index 00000000000..9904122c789
--- /dev/null
+++ b/app/views/admin/groups/edit.html.haml
@@ -0,0 +1,3 @@
+%h3.page_title Edit Group
+%br
+= render 'form'
diff --git a/app/views/admin/groups/index.html.haml b/app/views/admin/groups/index.html.haml
index 6952c4c9fbb..25efc9eeaae 100644
--- a/app/views/admin/groups/index.html.haml
+++ b/app/views/admin/groups/index.html.haml
@@ -1,3 +1,4 @@
+= render 'admin/shared/projects_head'
%h3.page_title
Groups
= link_to 'New Group', new_admin_group_path, class: "btn small right"
diff --git a/app/views/admin/groups/show.html.haml b/app/views/admin/groups/show.html.haml
index 5d348eecd6d..309a10e5bb4 100644
--- a/app/views/admin/groups/show.html.haml
+++ b/app/views/admin/groups/show.html.haml
@@ -1,3 +1,4 @@
+= render 'admin/shared/projects_head'
%h3.page_title
Group: #{@group.name}
= link_to edit_admin_group_path(@group), class: "btn right" do
@@ -38,6 +39,9 @@
%li.wll
%strong
= link_to project.name, [:admin, project]
+ .right
+ = link_to 'Remove from group', remove_project_admin_group_path(@group, project_id: project.id), confirm: 'Are you sure?', method: :delete, class: "btn danger small"
+ .clearfix
%br
%h3 Add new project
diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml
index bd38ae72f7c..13b0b44acd6 100644
--- a/app/views/admin/projects/index.html.haml
+++ b/app/views/admin/projects/index.html.haml
@@ -1,3 +1,4 @@
+= render 'admin/shared/projects_head'
%h3.page_title
Projects
= link_to 'New Project', new_admin_project_path, class: "btn small right"
diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml
index ede48ea26da..f16a0211a14 100644
--- a/app/views/admin/projects/show.html.haml
+++ b/app/views/admin/projects/show.html.haml
@@ -1,3 +1,4 @@
+= render 'admin/shared/projects_head'
%h3.page_title
Project: #{@admin_project.name}
= link_to edit_admin_project_path(@admin_project), class: "btn right" do
diff --git a/app/views/admin/shared/_projects_head.html.haml b/app/views/admin/shared/_projects_head.html.haml
new file mode 100644
index 00000000000..3f5c34c533c
--- /dev/null
+++ b/app/views/admin/shared/_projects_head.html.haml
@@ -0,0 +1,5 @@
+%ul.nav.nav-tabs
+ = nav_link(controller: :projects) do
+ = link_to 'Projects', admin_projects_path, class: "tab"
+ = nav_link(controller: :groups) do
+ = link_to 'Groups', admin_groups_path, class: "tab"
diff --git a/app/views/groups/_projects.html.haml b/app/views/groups/_projects.html.haml
index 35433057aa2..b565dad37a9 100644
--- a/app/views/groups/_projects.html.haml
+++ b/app/views/groups/_projects.html.haml
@@ -3,11 +3,6 @@
Projects
%small
(#{projects.count})
- - if current_user.can_create_project?
- %span.right
- = link_to new_project_path, class: "btn very_small info" do
- %i.icon-plus
- New Project
%ul.unstyled
- projects.each do |project|
%li.wll
diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml
index dbb6939dd61..582f86ba32c 100644
--- a/app/views/layouts/admin.html.haml
+++ b/app/views/layouts/admin.html.haml
@@ -8,7 +8,7 @@
%ul.main_menu
= nav_link(controller: :dashboard, html_options: {class: 'home'}) do
= link_to "Stats", admin_root_path
- = nav_link(controller: :projects) do
+ = nav_link(controller: [:projects, :groups]) do
= link_to "Projects", admin_projects_path
= nav_link(controller: :users) do
= link_to "Users", admin_users_path
diff --git a/config/routes.rb b/config/routes.rb
index f6bebc6b369..060fbf16793 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -46,6 +46,7 @@ Gitlab::Application.routes.draw do
resources :groups, constraints: { id: /[^\/]+/ } do
member do
put :project_update
+ delete :remove_project
end
end
resources :projects, constraints: { id: /[^\/]+/ } do