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
2d3b6375
Commit
2d3b6375
authored
Jan 04, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
hooks scaffold
parent
495deea7
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
40 additions
and
7 deletions
+40
-7
app/assets/stylesheets/projects.css.scss
app/assets/stylesheets/projects.css.scss
+7
-0
app/controllers/hooks_controller.rb
app/controllers/hooks_controller.rb
+2
-3
app/helpers/projects_helper.rb
app/helpers/projects_helper.rb
+2
-1
app/views/hooks/index.html.haml
app/views/hooks/index.html.haml
+7
-1
app/views/hooks/new.html.haml
app/views/hooks/new.html.haml
+13
-0
app/views/hooks/show.html.haml
app/views/hooks/show.html.haml
+7
-0
app/views/repositories/_head.html.haml
app/views/repositories/_head.html.haml
+1
-1
config/routes.rb
config/routes.rb
+1
-1
No files found.
app/assets/stylesheets/projects.css.scss
View file @
2d3b6375
...
...
@@ -181,6 +181,13 @@ input.ssh_project_url {
}
}
.text_field
{
width
:
400px
;
padding
:
8px
;
font-size
:
14px
;
@include
round-borders-all
(
4px
);
}
.input_button
{
padding
:
8px
;
font-size
:
14px
;
...
...
app/controllers/hooks_controller.rb
View file @
2d3b6375
...
...
@@ -20,13 +20,12 @@ class HooksController < ApplicationController
def
create
@hook
=
@project
.
web_hooks
.
new
(
params
[
:hook
])
@hook
.
author
=
current_user
@hook
.
save
if
@hook
.
valid?
redirect_to
[
@project
,
@hook
]
redirect_to
project_hook_path
(
@project
,
@hook
)
else
re
spond_with
(
@hook
)
re
nder
:new
end
end
...
...
app/helpers/projects_helper.rb
View file @
2d3b6375
...
...
@@ -35,7 +35,8 @@ module ProjectsHelper
end
def
repository_tab_class
if
controller
.
controller_name
==
"repositories"
if
controller
.
controller_name
==
"repositories"
||
controller
.
controller_name
==
"hooks"
"current"
end
end
...
...
app/views/hooks/index.html.haml
View file @
2d3b6375
=
render
"repositories/head"
.right
=
link_to
"Add new"
,
new_project_hook_path
(
@project
),
:class
=>
"grey-button append-bottom-10"
-
unless
@hooks
.
empty?
%div
.update-data.ui-box.ui-box-small
.data
-
@hooks
.
each
do
|
hook
|
%a
.update-item
{
:href
=>
project_hook
s
_path
(
@project
,
hook
)}
%a
.update-item
{
:href
=>
project_hook_path
(
@project
,
hook
)}
%span
.update-title
{
:style
=>
"margin-bottom:0px;"
}
=
hook
.
url
%span
.update-author.right
Added
=
time_ago_in_words
(
hook
.
created_at
)
ago
-
else
%h3
No hooks
app/views/hooks/new.html.haml
0 → 100644
View file @
2d3b6375
=
render
"repositories/head"
=
form_for
[
@project
,
@hook
],
:as
=>
:hook
,
:url
=>
project_hooks_path
(
@project
)
do
|
f
|
-
if
@hook
.
errors
.
any?
%ul
-
@hook
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
=
f
.
label
:url
,
"URL:"
=
f
.
text_field
:url
,
:class
=>
"text_field"
.clear
%br
.merge-tabs
=
f
.
submit
"Save"
,
:class
=>
"grey-button"
app/views/hooks/show.html.haml
0 → 100644
View file @
2d3b6375
=
render
"repositories/head"
=
debug
@hook
-
if
can?
current_user
,
:admin_project
,
@project
.merge-tabs
.right
=
link_to
'Remove'
,
project_hook_path
(
@project
,
@hook
),
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"red-button"
app/views/repositories/_head.html.haml
View file @
2d3b6375
...
...
@@ -8,7 +8,7 @@
=
link_to
tags_project_repository_path
(
@project
),
:class
=>
"tab
#{
'active'
if
current_page?
(
tags_project_repository_path
(
@project
))
}
"
do
%span
Tags
-#= link_to "#", :class => "tab
" do
=
link_to
project_hooks_path
,
:class
=>
"tab
#{
'active'
if
controller
.
controller_name
==
"hooks"
}
"
do
%span
Hooks
-#= link_to "#", :class => "tab" do
...
...
config/routes.rb
View file @
2d3b6375
...
...
@@ -84,8 +84,8 @@ Gitlab::Application.routes.draw do
end
end
resources
:hooks
,
:only
=>
[
:index
,
:new
,
:create
,
:destroy
,
:show
]
resources
:snippets
resources
:hooks
,
:only
=>
[
:index
,
:new
,
:create
,
:destroy
,
:show
]
resources
:commits
resources
:team_members
resources
:issues
do
...
...
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