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
15b06b01
Commit
15b06b01
authored
Jan 28, 2012
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bootstrap: Deploy keys, Hooks
parent
089dca4d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
68 additions
and
94 deletions
+68
-94
app/views/deploy_keys/_form.html.haml
app/views/deploy_keys/_form.html.haml
+13
-13
app/views/deploy_keys/index.html.haml
app/views/deploy_keys/index.html.haml
+9
-16
app/views/deploy_keys/show.html.haml
app/views/deploy_keys/show.html.haml
+7
-10
app/views/hooks/index.html.haml
app/views/hooks/index.html.haml
+15
-22
app/views/hooks/show.html.haml
app/views/hooks/show.html.haml
+4
-8
app/views/repositories/_head.html.haml
app/views/repositories/_head.html.haml
+20
-25
No files found.
app/views/deploy_keys/_form.html.haml
View file @
15b06b01
%div
%div
=
form_for
[
@project
,
@key
],
:url
=>
project_deploy_keys_path
do
|
f
|
=
form_for
[
@project
,
@key
],
:url
=>
project_deploy_keys_path
do
|
f
|
-
if
@key
.
errors
.
any?
-
if
@key
.
errors
.
any?
%ul
.errors_holder
.alert-message.block-message.error
-
@key
.
errors
.
full_messages
.
each
do
|
msg
|
%ul
%li
=
msg
-
@key
.
errors
.
full_messages
.
each
do
|
msg
|
%li
=
msg
%table
.no-borders
%tr
.clearfix
%td
=
f
.
label
:title
=
f
.
label
:title
%td
=
f
.
text_field
:title
,
:style
=>
"width:300px"
.input
=
f
.
text_field
:title
%tr
.clearfix
%td
=
f
.
label
:key
=
f
.
label
:key
%td
=
f
.
text_area
:key
,
:style
=>
"width:300px; height:130px"
.input
=
f
.
text_area
:key
,
:class
=>
"xlarge"
%br
.actions
.merge-tabs
=
f
.
submit
'Save'
,
:class
=>
"primary btn"
=
f
.
submit
'Save'
,
:class
=>
"primary btn"
=
link_to
"Cancel"
,
project_deploy_keys_path
(
@project
),
:class
=>
"btn"
app/views/deploy_keys/index.html.haml
View file @
15b06b01
=
render
"repositories/head"
=
render
"repositories/head"
-
if
can?
current_user
,
:admin_project
,
@project
%div
#keys-table
{
:class
=>
"update-data ui-box ui-box-small ui-box-big"
}
.alert-message.block-message.info
.data
Deploy keys allow read-only access to repository.
-
@keys
.
each
do
|
key
|
=
link_to
new_project_deploy_key_path
(
@project
),
:class
=>
"btn small"
,
:title
=>
"New Deploy Key"
do
=
render
(
:partial
=>
'show'
,
:locals
=>
{
:key
=>
key
})
Add Deploy Key
-
if
@keys
.
blank?
%ul
.unstyled
.notice_holder
-
@keys
.
each
do
|
key
|
%li
Deploy Keys do not exist yet.
%li
=
render
(
:partial
=>
'show'
,
:locals
=>
{
:key
=>
key
})
-
if
can?
current_user
,
:admin_project
,
@project
%li
You can add a new one by clicking on "Add New" button
:javascript
$
(
'
.delete-key
'
).
live
(
'
ajax:success
'
,
function
()
{
$
(
this
).
closest
(
'
.update-item
'
).
fadeOut
();
});
app/views/deploy_keys/show.html.haml
View file @
15b06b01
.ui-box.width-100p
=
render
"repositories/head"
%h3
=
@key
.
title
%h3
=
@key
.
title
.data
%hr
%pre
=
@key
.
key
%pre
=
@key
.
key
.clear
.actions
.buttons
=
link_to
'Remove'
,
project_deploy_key_path
(
@key
.
project
,
@key
),
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"danger btn delete-key"
=
link_to
'Remove'
,
project_deploy_key_path
(
@key
.
project
,
@key
),
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"red-button delete-key right"
.clear
.clear
app/views/hooks/index.html.haml
View file @
15b06b01
=
render
"repositories/head"
=
render
"repositories/head"
-
unless
@hooks
.
empty?
%div
.update-data.ui-box.ui-box-small
.data
-
@hooks
.
each
do
|
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
.clear
-
if
can?
current_user
,
:admin_project
,
@project
%hr
.alert-message.block-message.info
%p
Post receive hooks for binding events when someone push to repository.
Post receive hooks. For now only POST request allowed. We send some data with request. Example below
=
link_to
new_project_hook_path
(
@project
),
:class
=>
"btn small"
,
:title
=>
"New Web Hook"
do
Add Post Receive Hook
.view_file
%ul
.unstyled
.view_file_header
-
@hooks
.
each
do
|
hook
|
%strong
POST data passed
%li
.data.no-padding
%a
.update-item
{
:href
=>
project_hook_path
(
@project
,
hook
)}
=
render
"data_ex"
=
hook
.
url
.alert-message.block-message.info
We send some data with POST request when someone makes git push
.well
=
render
"data_ex"
app/views/hooks/show.html.haml
View file @
15b06b01
=
render
"repositories/head"
=
render
"repositories/head"
%h3
%pre
=
@hook
.
url
%span
.commit.tag
POST
=
@hook
.
url
-
if
can?
current_user
,
:admin_project
,
@project
-
if
can?
current_user
,
:admin_project
,
@project
.merge-tabs
.actions
=
link_to
'Test Hook'
,
test_project_hook_path
(
@project
,
@hook
),
:class
=>
"grey-button"
=
link_to
'Test Hook'
,
test_project_hook_path
(
@project
,
@hook
),
:class
=>
"btn"
.right
=
link_to
'Remove'
,
project_hook_path
(
@project
,
@hook
),
:confirm
=>
'Are you sure?'
,
:method
=>
:delete
,
:class
=>
"danger btn"
=
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 @
15b06b01
.top-tabs.repository
%ul
.tabs
=
link_to
project_repository_path
(
@project
),
:class
=>
"activities-tab tab
#{
'active'
if
current_page?
(
project_repository_path
(
@project
))
}
"
do
%li
{
:class
=>
"#{'active' if current_page?(project_repository_path(@project)) }"
}
%span
=
link_to
project_repository_path
(
@project
)
do
Activities
=
link_to
branches_project_repository_path
(
@project
),
:class
=>
"tab
#{
'active'
if
current_page?
(
branches_project_repository_path
(
@project
))
}
"
do
%span
Branches
=
link_to
tags_project_repository_path
(
@project
),
:class
=>
"tab
#{
'active'
if
current_page?
(
tags_project_repository_path
(
@project
))
}
"
do
%span
Tags
=
link_to
project_hooks_path
,
:class
=>
"tab
#{
'active'
if
controller
.
controller_name
==
"hooks"
}
"
do
%span
Hooks
-
if
can?
current_user
,
:admin_project
,
@project
=
link_to
project_deploy_keys_path
(
@project
),
:class
=>
"tab
#{
'active'
if
controller
.
controller_name
==
"deploy_keys"
}
"
do
%span
%span
Deploy Keys
Activities
%li
{
:class
=>
"#{'active' if current_page?(branches_project_repository_path(@project)) }"
}
-
if
current_page?
(
project_hooks_path
(
@project
))
=
link_to
branches_project_repository_path
(
@project
)
do
-
if
can?
current_user
,
:admin_project
,
@project
%span
=
link_to
new_project_hook_path
(
@project
),
:class
=>
"add_new"
,
:title
=>
"New Web Hook"
do
Branches
Add new
%li
{
:class
=>
"#{'active' if current_page?(tags_project_repository_path(@project)) }"
}
=
link_to
tags_project_repository_path
(
@project
)
do
-
if
current_page?
(
project_deploy_keys_path
(
@project
))
%span
Tags
%li
{
:class
=>
"#{'active' if controller.controller_name == "
hooks
" }"
}
=
link_to
project_hooks_path
do
%span
Hooks
%li
{
:class
=>
"#{'active' if controller.controller_name == "
deploy_keys
"}"
}
-
if
can?
current_user
,
:admin_project
,
@project
-
if
can?
current_user
,
:admin_project
,
@project
=
link_to
new_project_deploy_key_path
(
@project
),
:class
=>
"add_new"
,
:title
=>
"New Deploy Key"
do
=
link_to
project_deploy_keys_path
(
@project
)
do
Add new
%span
Deploy Keys
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