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
Boxiang Sun
gitlab-ce
Commits
a45a2d47
Commit
a45a2d47
authored
Jul 05, 2017
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport Service changes from
https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2259
parent
491110d6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
14 deletions
+24
-14
app/models/service.rb
app/models/service.rb
+8
-0
app/views/projects/services/_form.html.haml
app/views/projects/services/_form.html.haml
+11
-10
app/views/shared/_service_settings.html.haml
app/views/shared/_service_settings.html.haml
+5
-4
No files found.
app/models/service.rb
View file @
a45a2d47
...
@@ -51,6 +51,14 @@ class Service < ActiveRecord::Base
...
@@ -51,6 +51,14 @@ class Service < ActiveRecord::Base
active
active
end
end
def
show_active_box?
true
end
def
editable?
true
end
def
template?
def
template?
template
template
end
end
...
...
app/views/projects/services/_form.html.haml
View file @
a45a2d47
...
@@ -11,16 +11,17 @@
...
@@ -11,16 +11,17 @@
.col-lg-9
.col-lg-9
=
form_for
(
@service
,
as: :service
,
url:
namespace_project_service_path
(
@project
.
namespace
,
@project
,
@service
.
to_param
),
method: :put
,
html:
{
class:
'gl-show-field-errors form-horizontal js-integration-settings-form'
,
data:
{
'can-test'
=>
@service
.
can_test?
,
'test-url'
=>
test_namespace_project_service_path
}
})
do
|
form
|
=
form_for
(
@service
,
as: :service
,
url:
namespace_project_service_path
(
@project
.
namespace
,
@project
,
@service
.
to_param
),
method: :put
,
html:
{
class:
'gl-show-field-errors form-horizontal js-integration-settings-form'
,
data:
{
'can-test'
=>
@service
.
can_test?
,
'test-url'
=>
test_namespace_project_service_path
}
})
do
|
form
|
=
render
'shared/service_settings'
,
form:
form
,
subject:
@service
=
render
'shared/service_settings'
,
form:
form
,
subject:
@service
.footer-block.row-content-block
-
if
@service
.
editable?
%button
.btn.btn-save
{
type:
'submit'
}
.footer-block.row-content-block
=
icon
(
'spinner spin'
,
class:
'hidden js-btn-spinner'
)
%button
.btn.btn-save
{
type:
'submit'
}
%span
.js-btn-label
=
icon
(
'spinner spin'
,
class:
'hidden js-btn-spinner'
)
Save changes
%span
.js-btn-label
Save changes
-
if
@service
.
valid?
&&
@service
.
activated?
-
unless
@service
.
can_test?
-
if
@service
.
valid?
&&
@service
.
activated?
-
disabled_class
=
'disabled'
-
unless
@service
.
can_test?
-
disabled_title
=
@service
.
disabled_title
-
disabled_class
=
'disabled'
-
disabled_title
=
@service
.
disabled_title
=
link_to
'Cancel'
,
namespace_project_settings_integrations_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-cancel'
=
link_to
'Cancel'
,
namespace_project_settings_integrations_path
(
@project
.
namespace
,
@project
),
class:
'btn btn-cancel'
...
...
app/views/shared/_service_settings.html.haml
View file @
a45a2d47
...
@@ -7,10 +7,11 @@
...
@@ -7,10 +7,11 @@
=
markdown
@service
.
help
=
markdown
@service
.
help
.service-settings
.service-settings
.form-group
-
if
@service
.
show_active_box?
=
form
.
label
:active
,
"Active"
,
class:
"control-label"
.form-group
.col-sm-10
=
form
.
label
:active
,
"Active"
,
class:
"control-label"
=
form
.
check_box
:active
.col-sm-10
=
form
.
check_box
:active
-
if
@service
.
supported_events
.
present?
-
if
@service
.
supported_events
.
present?
.form-group
.form-group
...
...
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