summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Iván Vargas López <jvargas@gitlab.com>2016-12-19 16:26:59 -0600
committerJosé Iván Vargas López <jvargas@gitlab.com>2016-12-19 16:26:59 -0600
commita6a81c22a61581d5fabf1066a259e84ecec5b806 (patch)
tree0b5b02975ec2de662c4ee910a049c644577cf111
parent288d1c61b973ca22a1e066e417408bd602cb6028 (diff)
downloadgitlab-ce-23007-replace-settings-gear-in-projects-etc-with-a-tab.tar.gz
All tabs now render their content properly using their23007-replace-settings-gear-in-projects-etc-with-a-tab
respective controllers Changed all redirects from edit_project_path to project_settings_general_path also tested the functionality of the general settings tab
-rw-r--r--app/controllers/projects/avatars_controller.rb2
-rw-r--r--app/controllers/projects/settings/automations_controller.rb18
-rw-r--r--app/controllers/projects_controller.rb16
-rw-r--r--app/views/admin/projects/show.html.haml2
-rw-r--r--app/views/projects/_customize_workflow.html.haml2
-rw-r--r--app/views/projects/protected_branches/_branches_list.html.haml2
-rw-r--r--app/views/projects/runners/_index.html.haml (renamed from app/views/projects/runners/index.html.haml)7
-rw-r--r--app/views/projects/settings/automations/show.html.haml3
-rw-r--r--app/views/projects/triggers/_index.html.haml2
9 files changed, 34 insertions, 20 deletions
diff --git a/app/controllers/projects/avatars_controller.rb b/app/controllers/projects/avatars_controller.rb
index 53788687076..4d9007fb147 100644
--- a/app/controllers/projects/avatars_controller.rb
+++ b/app/controllers/projects/avatars_controller.rb
@@ -21,6 +21,6 @@ class Projects::AvatarsController < Projects::ApplicationController
@project.save
- redirect_to edit_project_path(@project)
+ redirect_to project_settings_general_path(@project)
end
end
diff --git a/app/controllers/projects/settings/automations_controller.rb b/app/controllers/projects/settings/automations_controller.rb
index f64d2ec2d6b..da76ed84052 100644
--- a/app/controllers/projects/settings/automations_controller.rb
+++ b/app/controllers/projects/settings/automations_controller.rb
@@ -2,7 +2,25 @@ module Projects
module Settings
class AutomationsController < Projects::ApplicationController
def show
+ @project_runners = project.runners.ordered
+ @assignable_runners = current_user.ci_authorized_runners.
+ assignable_for(project).ordered.page(params[:page]).per(20)
+ @shared_runners = Ci::Runner.shared.active
+ @shared_runners_count = @shared_runners.count(:all)
+ # Variables
+ @variable = Ci::Variable.new
+ # Triggers
+ @triggers = project.triggers
+ @trigger = Ci::Trigger.new
+ # Pipelines settings
+ @ref = params[:ref] || @project.default_branch || 'master'
+ @badges = [Gitlab::Badge::Build::Status,
+ Gitlab::Badge::Coverage::Report]
+
+ @badges.map! do |badge|
+ badge.new(@project, @ref).metadata
+ end
end
end
end
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index d5ee503c44c..0a7d38df02a 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -23,7 +23,7 @@ class ProjectsController < Projects::ApplicationController
end
def edit
- render 'edit'
+ redirect_to project_settings_general_path(@project)
end
def create
@@ -52,7 +52,7 @@ class ProjectsController < Projects::ApplicationController
flash[:notice] = "Project '#{@project.name}' was successfully updated."
format.html do
redirect_to(
- edit_project_path(@project),
+ project_settings_general_path(@project),
notice: "Project '#{@project.name}' was successfully updated."
)
end
@@ -124,7 +124,7 @@ class ProjectsController < Projects::ApplicationController
redirect_to dashboard_projects_path
rescue Projects::DestroyService::DestroyError => ex
- redirect_to edit_project_path(@project), alert: ex.message
+ redirect_to project_settings_general_path(@project), alert: ex.message
end
def new_issue_address
@@ -163,7 +163,7 @@ class ProjectsController < Projects::ApplicationController
)
rescue ::Projects::HousekeepingService::LeaseTaken => ex
redirect_to(
- edit_project_path(@project),
+ project_settings_general_path(@project),
alert: ex.to_s
)
end
@@ -172,7 +172,7 @@ class ProjectsController < Projects::ApplicationController
@project.add_export_job(current_user: current_user)
redirect_to(
- edit_project_path(@project),
+ project_settings_general_path(@project),
notice: "Project export started. A download link will be sent by email."
)
end
@@ -184,7 +184,7 @@ class ProjectsController < Projects::ApplicationController
send_file export_project_path, disposition: 'attachment'
else
redirect_to(
- edit_project_path(@project),
+ project_settings_general_path(@project),
alert: "Project export link has expired. Please generate a new export from your project settings."
)
end
@@ -196,7 +196,7 @@ class ProjectsController < Projects::ApplicationController
else
flash[:alert] = "Project export could not be deleted."
end
- redirect_to(edit_project_path(@project))
+ redirect_to(project_settings_general_path(@project))
end
def generate_new_export
@@ -204,7 +204,7 @@ class ProjectsController < Projects::ApplicationController
export
else
redirect_to(
- edit_project_path(@project),
+ project_settings_general_path(@project),
alert: "Project export could not be deleted."
)
end
diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml
index 6c7c3c48604..24cb44dd2e7 100644
--- a/app/views/admin/projects/show.html.haml
+++ b/app/views/admin/projects/show.html.haml
@@ -1,7 +1,7 @@
- page_title @project.name_with_namespace, "Projects"
%h3.page-title
Project: #{@project.name_with_namespace}
- = link_to edit_project_path(@project), class: "btn btn-nr pull-right" do
+ = link_to project_settings_general_path(@project), class: "btn btn-nr pull-right" do
%i.fa.fa-pencil-square-o
Edit
%hr
diff --git a/app/views/projects/_customize_workflow.html.haml b/app/views/projects/_customize_workflow.html.haml
index d2c1e943db1..dae6c3cdd37 100644
--- a/app/views/projects/_customize_workflow.html.haml
+++ b/app/views/projects/_customize_workflow.html.haml
@@ -5,4 +5,4 @@
%p
Get started with GitLab by enabling features that work best for your project. From issues and wikis, to merge requests and builds, GitLab can help manage your workflow from idea to production!
- if can?(current_user, :admin_project, @project)
- = link_to "Get started", edit_project_path(@project), class: "btn btn-success"
+ = link_to "Get started", project_settings_general_path(@project), class: "btn btn-success"
diff --git a/app/views/projects/protected_branches/_branches_list.html.haml b/app/views/projects/protected_branches/_branches_list.html.haml
index 92564bc1f64..cf0db943865 100644
--- a/app/views/projects/protected_branches/_branches_list.html.haml
+++ b/app/views/projects/protected_branches/_branches_list.html.haml
@@ -23,6 +23,6 @@
- if can_admin_project
%th
%tbody
- = render 'projects/protected_branches/protected_branch', locals: { can_admin_project: can_admin_project, protected_branch: @protected_branches }
+ = render partial: 'projects/protected_branches/protected_branch', collection: @protected_branches, locals: { can_admin_project: can_admin_project}
= paginate @protected_branches, theme: 'gitlab'
diff --git a/app/views/projects/runners/index.html.haml b/app/views/projects/runners/_index.html.haml
index 5baa7bb1023..f3492ae7e34 100644
--- a/app/views/projects/runners/index.html.haml
+++ b/app/views/projects/runners/_index.html.haml
@@ -1,6 +1,3 @@
-- page_title "Runners"
-= render "projects/settings/head"
-
.row.prepend-top-default.append-bottom-default
.col-lg-3
%h4.prepend-top-0
@@ -28,9 +25,9 @@
%p.lead To start serving your builds you can either add specific Runners to your project or use shared Runners
.row
.col-sm-6
- = render 'specific_runners'
+ = render 'projects/runners/specific_runners'
.col-sm-6
- = render 'shared_runners'
+ = render 'projects/runners/shared_runners'
%hr
diff --git a/app/views/projects/settings/automations/show.html.haml b/app/views/projects/settings/automations/show.html.haml
index 30924e1734b..1fd11cca742 100644
--- a/app/views/projects/settings/automations/show.html.haml
+++ b/app/views/projects/settings/automations/show.html.haml
@@ -1,5 +1,4 @@
- page_title "Automation / CI"
= render "projects/settings/head"
-%h1
- Automations Settings
+= render "projects/runners/index"
diff --git a/app/views/projects/triggers/_index.html.haml b/app/views/projects/triggers/_index.html.haml
index 98b8714eaa9..b23de9ccf53 100644
--- a/app/views/projects/triggers/_index.html.haml
+++ b/app/views/projects/triggers/_index.html.haml
@@ -28,7 +28,7 @@
%p.settings-message.text-center.append-bottom-default
No triggers have been created yet. Add one using the button below.
- = form_for @trigger, url: url_for(controller: 'projects/triggers', action: 'create') do |f|
+ = form_for @trigger, url: url_for(controller: '/projects/triggers', action: 'create') do |f|
= f.submit "Add trigger", class: 'btn btn-success'
.panel-footer