Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
58110293
Commit
58110293
authored
Jan 03, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Converted the views to partials that compose the menu item "pipelines"
parent
ee43dcd5
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
58 additions
and
41 deletions
+58
-41
app/controllers/projects/pipelines_settings_controller.rb
app/controllers/projects/pipelines_settings_controller.rb
+2
-9
app/controllers/projects/runners_controller.rb
app/controllers/projects/runners_controller.rb
+2
-6
app/controllers/projects/settings/pipelines_controller.rb
app/controllers/projects/settings/pipelines_controller.rb
+30
-0
app/controllers/projects/triggers_controller.rb
app/controllers/projects/triggers_controller.rb
+3
-4
app/controllers/projects/variables_controller.rb
app/controllers/projects/variables_controller.rb
+4
-4
app/views/projects/pipelines_settings/_show.html.haml
app/views/projects/pipelines_settings/_show.html.haml
+1
-3
app/views/projects/runners/_index.html.haml
app/views/projects/runners/_index.html.haml
+2
-4
app/views/projects/runners/_specific_runners.html.haml
app/views/projects/runners/_specific_runners.html.haml
+2
-2
app/views/projects/settings/pipelines/show.html.haml
app/views/projects/settings/pipelines/show.html.haml
+6
-0
app/views/projects/triggers/_index.html.haml
app/views/projects/triggers/_index.html.haml
+2
-4
app/views/projects/variables/_index.html.haml
app/views/projects/variables/_index.html.haml
+3
-5
config/routes/project.rb
config/routes/project.rb
+1
-0
No files found.
app/controllers/projects/pipelines_settings_controller.rb
View file @
58110293
...
@@ -2,20 +2,13 @@ class Projects::PipelinesSettingsController < Projects::ApplicationController
...
@@ -2,20 +2,13 @@ class Projects::PipelinesSettingsController < Projects::ApplicationController
before_action
:authorize_admin_pipeline!
before_action
:authorize_admin_pipeline!
def
show
def
show
@ref
=
params
[
:ref
]
||
@project
.
default_branch
||
'master'
redirect_to
namespace_project_settings_pipelines_path
(
@project
.
namespace
,
@project
)
@badges
=
[
Gitlab
::
Badge
::
Build
::
Status
,
Gitlab
::
Badge
::
Coverage
::
Report
]
@badges
.
map!
do
|
badge
|
badge
.
new
(
@project
,
@ref
).
metadata
end
end
end
def
update
def
update
if
@project
.
update_attributes
(
update_params
)
if
@project
.
update_attributes
(
update_params
)
flash
[
:notice
]
=
"CI/CD Pipelines settings for '
#{
@project
.
name
}
' were successfully updated."
flash
[
:notice
]
=
"CI/CD Pipelines settings for '
#{
@project
.
name
}
' were successfully updated."
redirect_to
namespace_project_
pipelines_setting
s_path
(
@project
.
namespace
,
@project
)
redirect_to
namespace_project_
settings_pipeline
s_path
(
@project
.
namespace
,
@project
)
else
else
render
'show'
render
'show'
end
end
...
...
app/controllers/projects/runners_controller.rb
View file @
58110293
...
@@ -5,11 +5,7 @@ class Projects::RunnersController < Projects::ApplicationController
...
@@ -5,11 +5,7 @@ class Projects::RunnersController < Projects::ApplicationController
layout
'project_settings'
layout
'project_settings'
def
index
def
index
@project_runners
=
project
.
runners
.
ordered
redirect_to
namespace_project_settings_pipelines_path
(
@project
.
namespace
,
@project
)
@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
)
end
end
def
edit
def
edit
...
@@ -53,7 +49,7 @@ class Projects::RunnersController < Projects::ApplicationController
...
@@ -53,7 +49,7 @@ class Projects::RunnersController < Projects::ApplicationController
def
toggle_shared_runners
def
toggle_shared_runners
project
.
toggle!
(
:shared_runners_enabled
)
project
.
toggle!
(
:shared_runners_enabled
)
redirect_to
namespace_project_
runners_path
(
project
.
namespace
,
project
)
redirect_to
namespace_project_
settings_pipelines_path
(
@project
.
namespace
,
@
project
)
end
end
protected
protected
...
...
app/controllers/projects/settings/pipelines_controller.rb
0 → 100644
View file @
58110293
module
Projects
module
Settings
class
PipelinesController
<
Projects
::
ApplicationController
before_action
:authorize_admin_pipeline!
def
show
# runners
@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
@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
end
app/controllers/projects/triggers_controller.rb
View file @
58110293
...
@@ -4,8 +4,7 @@ class Projects::TriggersController < Projects::ApplicationController
...
@@ -4,8 +4,7 @@ class Projects::TriggersController < Projects::ApplicationController
layout
'project_settings'
layout
'project_settings'
def
index
def
index
@triggers
=
project
.
triggers
redirect_to
namespace_project_settings_pipelines_path
(
@project
.
namespace
,
@project
)
@trigger
=
Ci
::
Trigger
.
new
end
end
def
create
def
create
...
@@ -13,7 +12,7 @@ class Projects::TriggersController < Projects::ApplicationController
...
@@ -13,7 +12,7 @@ class Projects::TriggersController < Projects::ApplicationController
@trigger
.
save
@trigger
.
save
if
@trigger
.
valid?
if
@trigger
.
valid?
redirect_to
namespace_project_
trigger
s_path
(
@project
.
namespace
,
@project
)
redirect_to
namespace_project_
settings_pipeline
s_path
(
@project
.
namespace
,
@project
)
else
else
@triggers
=
project
.
triggers
.
select
(
&
:persisted?
)
@triggers
=
project
.
triggers
.
select
(
&
:persisted?
)
render
:index
render
:index
...
@@ -23,7 +22,7 @@ class Projects::TriggersController < Projects::ApplicationController
...
@@ -23,7 +22,7 @@ class Projects::TriggersController < Projects::ApplicationController
def
destroy
def
destroy
trigger
.
destroy
trigger
.
destroy
redirect_to
namespace_project_
trigger
s_path
(
@project
.
namespace
,
@project
)
redirect_to
namespace_project_
settings_pipeline
s_path
(
@project
.
namespace
,
@project
)
end
end
private
private
...
...
app/controllers/projects/variables_controller.rb
View file @
58110293
...
@@ -4,7 +4,7 @@ class Projects::VariablesController < Projects::ApplicationController
...
@@ -4,7 +4,7 @@ class Projects::VariablesController < Projects::ApplicationController
layout
'project_settings'
layout
'project_settings'
def
index
def
index
@variable
=
Ci
::
Variable
.
new
redirect_to
namespace_project_settings_pipelines_path
(
project
.
namespace
,
project
)
end
end
def
show
def
show
...
@@ -15,7 +15,7 @@ class Projects::VariablesController < Projects::ApplicationController
...
@@ -15,7 +15,7 @@ class Projects::VariablesController < Projects::ApplicationController
@variable
=
@project
.
variables
.
find
(
params
[
:id
])
@variable
=
@project
.
variables
.
find
(
params
[
:id
])
if
@variable
.
update_attributes
(
project_params
)
if
@variable
.
update_attributes
(
project_params
)
redirect_to
namespace_project_
variabl
es_path
(
project
.
namespace
,
project
),
notice:
'Variable was successfully updated.'
redirect_to
namespace_project_
settings_pipelin
es_path
(
project
.
namespace
,
project
),
notice:
'Variable was successfully updated.'
else
else
render
action:
"show"
render
action:
"show"
end
end
...
@@ -25,7 +25,7 @@ class Projects::VariablesController < Projects::ApplicationController
...
@@ -25,7 +25,7 @@ class Projects::VariablesController < Projects::ApplicationController
@variable
=
Ci
::
Variable
.
new
(
project_params
)
@variable
=
Ci
::
Variable
.
new
(
project_params
)
if
@variable
.
valid?
&&
@project
.
variables
<<
@variable
if
@variable
.
valid?
&&
@project
.
variables
<<
@variable
redirect_to
namespace_project_
variabl
es_path
(
project
.
namespace
,
project
),
notice:
'Variables were successfully updated.'
redirect_to
namespace_project_
settings_pipelin
es_path
(
project
.
namespace
,
project
),
notice:
'Variables were successfully updated.'
else
else
render
action:
"index"
render
action:
"index"
end
end
...
@@ -35,7 +35,7 @@ class Projects::VariablesController < Projects::ApplicationController
...
@@ -35,7 +35,7 @@ class Projects::VariablesController < Projects::ApplicationController
@key
=
@project
.
variables
.
find
(
params
[
:id
])
@key
=
@project
.
variables
.
find
(
params
[
:id
])
@key
.
destroy
@key
.
destroy
redirect_to
namespace_project_
variabl
es_path
(
project
.
namespace
,
project
),
notice:
'Variable was successfully removed.'
redirect_to
namespace_project_
settings_pipelin
es_path
(
project
.
namespace
,
project
),
notice:
'Variable was successfully removed.'
end
end
private
private
...
...
app/views/projects/pipelines_settings/show.html.haml
→
app/views/projects/pipelines_settings/
_
show.html.haml
View file @
58110293
-
page_title
"CI/CD Pipelines"
.row.prepend-top-default
.row.prepend-top-default
.col-lg-3.profile-settings-sidebar
.col-lg-3.profile-settings-sidebar
%h4
.prepend-top-0
%h4
.prepend-top-0
...
@@ -95,4 +93,4 @@
...
@@ -95,4 +93,4 @@
%hr
%hr
.row.prepend-top-default
.row.prepend-top-default
=
render
partial:
'badge'
,
collection:
@badges
=
render
partial:
'
projects/pipelines_settings/
badge'
,
collection:
@badges
app/views/projects/runners/index.html.haml
→
app/views/projects/runners/
_
index.html.haml
View file @
58110293
-
page_title
"Runners"
.light.prepend-top-default
.light.prepend-top-default
%p
%p
A 'Runner' is a process which runs a job.
A 'Runner' is a process which runs a job.
...
@@ -22,6 +20,6 @@
...
@@ -22,6 +20,6 @@
%p
.lead
To start serving your jobs you can either add specific Runners to your project or use shared Runners
%p
.lead
To start serving your jobs you can either add specific Runners to your project or use shared Runners
.row
.row
.col-sm-6
.col-sm-6
=
render
'specific_runners'
=
render
'
projects/runners/
specific_runners'
.col-sm-6
.col-sm-6
=
render
'shared_runners'
=
render
'
projects/runners/
shared_runners'
app/views/projects/runners/_specific_runners.html.haml
View file @
58110293
...
@@ -20,10 +20,10 @@
...
@@ -20,10 +20,10 @@
-
if
@project_runners
.
any?
-
if
@project_runners
.
any?
%h4
.underlined-title
Runners activated for this project
%h4
.underlined-title
Runners activated for this project
%ul
.bordered-list.activated-specific-runners
%ul
.bordered-list.activated-specific-runners
=
render
partial:
'runner'
,
collection:
@project_runners
,
as: :runner
=
render
partial:
'
projects/runners/
runner'
,
collection:
@project_runners
,
as: :runner
-
if
@assignable_runners
.
any?
-
if
@assignable_runners
.
any?
%h4
.underlined-title
Available specific runners
%h4
.underlined-title
Available specific runners
%ul
.bordered-list.available-specific-runners
%ul
.bordered-list.available-specific-runners
=
render
partial:
'runner'
,
collection:
@assignable_runners
,
as: :runner
=
render
partial:
'
projects/runners/
runner'
,
collection:
@assignable_runners
,
as: :runner
=
paginate
@assignable_runners
,
theme:
"gitlab"
=
paginate
@assignable_runners
,
theme:
"gitlab"
app/views/projects/settings/pipelines/show.html.haml
0 → 100644
View file @
58110293
-
page_title
"Pipelines"
=
render
'projects/runners/index'
=
render
'projects/variables/index'
=
render
'projects/triggers/index'
=
render
'projects/pipelines_settings/show'
app/views/projects/triggers/index.html.haml
→
app/views/projects/triggers/
_
index.html.haml
View file @
58110293
-
page_title
"Triggers"
.row.prepend-top-default.append-bottom-default
.row.prepend-top-default.append-bottom-default
.col-lg-3
.col-lg-3
%h4
.prepend-top-0
%h4
.prepend-top-0
...
@@ -25,12 +23,12 @@
...
@@ -25,12 +23,12 @@
%th
%th
%strong
Last used
%strong
Last used
%th
%th
=
render
partial:
'trigger'
,
collection:
@triggers
,
as: :trigger
=
render
partial:
'
projects/triggers/
trigger'
,
collection:
@triggers
,
as: :trigger
-
else
-
else
%p
.settings-message.text-center.append-bottom-default
%p
.settings-message.text-center.append-bottom-default
No triggers have been created yet. Add one using the button below.
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'
=
f
.
submit
"Add trigger"
,
class:
'btn btn-success'
.panel-footer
.panel-footer
...
...
app/views/projects/variables/index.html.haml
→
app/views/projects/variables/
_
index.html.haml
View file @
58110293
-
page_title
"Variables"
.row.prepend-top-default.append-bottom-default
.row.prepend-top-default.append-bottom-default
.col-lg-3
.col-lg-3
=
render
"content"
=
render
"
projects/variables/
content"
.col-lg-9
.col-lg-9
%h5
.prepend-top-0
%h5
.prepend-top-0
Add a variable
Add a variable
=
render
"form"
,
btn_text:
"Add new variable"
=
render
"
projects/variables/
form"
,
btn_text:
"Add new variable"
%hr
%hr
%h5
.prepend-top-0
%h5
.prepend-top-0
Your variables (
#{
@project
.
variables
.
size
}
)
Your variables (
#{
@project
.
variables
.
size
}
)
...
@@ -14,5 +12,5 @@
...
@@ -14,5 +12,5 @@
%p
.settings-message.text-center.append-bottom-0
%p
.settings-message.text-center.append-bottom-0
No variables found, add one with the form above.
No variables found, add one with the form above.
-
else
-
else
=
render
"table"
=
render
"
projects/variables/
table"
%button
.btn.btn-info.js-btn-toggle-reveal-values
{
"data-status"
=>
'hidden'
}
Reveal Values
%button
.btn.btn-info.js-btn-toggle-reveal-values
{
"data-status"
=>
'hidden'
}
Reveal Values
config/routes/project.rb
View file @
58110293
...
@@ -316,6 +316,7 @@ constraints(ProjectUrlConstrainer.new) do
...
@@ -316,6 +316,7 @@ constraints(ProjectUrlConstrainer.new) do
namespace
:settings
do
namespace
:settings
do
resource
:members
,
only:
[
:show
]
resource
:members
,
only:
[
:show
]
resource
:integrations
,
only:
[
:show
]
resource
:integrations
,
only:
[
:show
]
resource
:pipelines
,
only:
[
:show
]
end
end
# Since both wiki and repository routing contains wildcard characters
# Since both wiki and repository routing contains wildcard characters
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment