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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
0687ecb6
Commit
0687ecb6
authored
Dec 02, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UI with event types for Project WebHooks
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
169b4ce0
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
8 deletions
+44
-8
app/assets/stylesheets/gitlab_bootstrap/forms.scss
app/assets/stylesheets/gitlab_bootstrap/forms.scss
+7
-0
app/models/project_hook.rb
app/models/project_hook.rb
+2
-0
app/views/projects/hooks/index.html.haml
app/views/projects/hooks/index.html.haml
+35
-8
No files found.
app/assets/stylesheets/gitlab_bootstrap/forms.scss
View file @
0687ecb6
...
@@ -13,6 +13,13 @@ form {
...
@@ -13,6 +13,13 @@ form {
margin-top
:
1px
!
important
;
margin-top
:
1px
!
important
;
}
}
}
}
&
.list-label
{
float
:
none
;
padding
:
0
!
important
;
margin
:
0
;
text-align
:
left
;
}
}
}
}
}
...
...
app/models/project_hook.rb
View file @
0687ecb6
...
@@ -13,4 +13,6 @@
...
@@ -13,4 +13,6 @@
class
ProjectHook
<
WebHook
class
ProjectHook
<
WebHook
belongs_to
:project
belongs_to
:project
attr_accessible
:push_events
,
:issues_events
,
:merge_requests_events
end
end
app/views/projects/hooks/index.html.haml
View file @
0687ecb6
%h3
.page-title
%h3
.page-title
Post-receive
hooks
Web
hooks
%p
.light
%p
.light
#{
link_to
"
Post-receive
hooks "
,
help_web_hooks_path
,
class:
"vlink"
}
can be
#{
link_to
"
Web
hooks "
,
help_web_hooks_path
,
class:
"vlink"
}
can be
used for binding events when some
one pushes to the repository
.
used for binding events when some
thing happends to the the project
.
%hr
.clearfix
%hr
.clearfix
...
@@ -13,23 +13,50 @@
...
@@ -13,23 +13,50 @@
-
@hook
.
errors
.
full_messages
.
each
do
|
msg
|
-
@hook
.
errors
.
full_messages
.
each
do
|
msg
|
%p
=
msg
%p
=
msg
.control-group
.control-group
=
f
.
label
:url
,
"URL
:
"
=
f
.
label
:url
,
"URL"
.controls
.controls
=
f
.
text_field
:url
,
class:
"text_field input-xxlarge input-xpadding"
,
placeholder:
'http://example.com/trigger-ci.json'
=
f
.
text_field
:url
,
class:
"text_field input-xxlarge input-xpadding"
,
placeholder:
'http://example.com/trigger-ci.json'
=
f
.
submit
"Add Web Hook"
,
class:
"btn btn-create"
=
f
.
submit
"Add Web Hook"
,
class:
"btn btn-create"
.control-group
=
f
.
label
:url
,
"Trigger"
.controls
%div
=
f
.
check_box
:push_events
,
class:
'pull-left'
.prepend-left-20
=
f
.
label
:push_events
,
class:
'list-label'
do
%strong
Push events
%p
.light
This url will be triggered in case of push to repository
%div
=
f
.
check_box
:issues_events
,
class:
'pull-left'
.prepend-left-20
=
f
.
label
:issues_events
,
class:
'list-label'
do
%strong
Issues events
%p
.light
This url will be triggered for created issues
%div
=
f
.
check_box
:merge_requests_events
,
class:
'pull-left'
.prepend-left-20
=
f
.
label
:merge_requests_events
,
class:
'list-label'
do
%strong
Merge Request events
%p
.light
This url will be triggered for created merge requests
%hr
%hr
-
if
@hooks
.
any?
-
if
@hooks
.
any?
.ui-box
.ui-box
.title
.title
Hooks (
#{
@hooks
.
count
}
)
Web
Hooks (
#{
@hooks
.
count
}
)
%ul
.well-list
%ul
.well-list
-
@hooks
.
each
do
|
hook
|
-
@hooks
.
each
do
|
hook
|
%li
%li
%span
.badge.badge-info
POST
→
%span
.monospace
=
hook
.
url
.pull-right
.pull-right
=
link_to
'Test Hook'
,
test_project_hook_path
(
@project
,
hook
),
class:
"btn btn-small grouped"
=
link_to
'Test Hook'
,
test_project_hook_path
(
@project
,
hook
),
class:
"btn btn-small grouped"
=
link_to
'Remove'
,
project_hook_path
(
@project
,
hook
),
confirm:
'Are you sure?'
,
method: :delete
,
class:
"btn btn-remove btn-small grouped"
=
link_to
'Remove'
,
project_hook_path
(
@project
,
hook
),
confirm:
'Are you sure?'
,
method: :delete
,
class:
"btn btn-remove btn-small grouped"
.clearfix
%span
.monospace
=
hook
.
url
%p
-
%w(push_events issues_events merge_requests_events)
.
each
do
|
trigger
|
-
if
hook
.
send
(
trigger
)
%span
.label.label-gray
=
trigger
.
titleize
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