summaryrefslogtreecommitdiff
path: root/app/views/hooks
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-01-08 13:20:20 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-01-08 13:20:20 +0200
commit473445c76fe6d99243a0e6b0247bc79cc47c3e44 (patch)
tree2da49aa9ef888a2cab4e03f1f6c25ac71f3ea3ee /app/views/hooks
parent57ac5fe99fd7c870f1b408ccebbd01960f514636 (diff)
downloadgitlab-ce-473445c76fe6d99243a0e6b0247bc79cc47c3e44.tar.gz
complete hooks for post receive
Diffstat (limited to 'app/views/hooks')
-rw-r--r--app/views/hooks/_data_ex.html.erb42
-rw-r--r--app/views/hooks/index.html.haml14
-rw-r--r--app/views/hooks/show.html.haml5
3 files changed, 60 insertions, 1 deletions
diff --git a/app/views/hooks/_data_ex.html.erb b/app/views/hooks/_data_ex.html.erb
new file mode 100644
index 00000000000..f212bb2dc0b
--- /dev/null
+++ b/app/views/hooks/_data_ex.html.erb
@@ -0,0 +1,42 @@
+<% data_ex_str = <<eos
+{
+ :before => "95790bf891e76fee5e1747ab589903a6a1f80f22",
+ :after => "da1560886d4f094c3e6c9ef40349f7d38b5d27d7",
+ :ref => "refs/heads/master",
+ :repository => {
+ :name => "Diaspora",
+ :url => "localhost/diaspora",
+ :description => "",
+ :homepage => "localhost/diaspora",
+ :private => true
+ },
+ :commits => [
+ [0] {
+ :id => "450d0de7532f8b663b9c5cce183b...",
+ :message => "Update Catalan translation to e38cb41.",
+ :timestamp => "2011-12-12T14:27:31+02:00",
+ :url => "http://localhost/diaspora/commits/450d0de7532f...",
+ :author => {
+ :name => "Jordi Mallach",
+ :email => "jordi@softcatala.org"
+ }
+ },
+
+ ....
+
+ [3] {
+ :id => "da1560886d4f094c3e6c9ef40349...",
+ :message => "fixed readme",
+ :timestamp => "2012-01-03T23:36:29+02:00",
+ :url => "http://localhost/diaspora/commits/da1560886d...",
+ :author => {
+ :name => "gitlab dev user",
+ :email => "gitlabdev@dv6700.(none)"
+ }
+ }
+ ]
+}
+eos
+%>
+<% js_lexer = Pygments::Lexer[:js] %>
+<%= raw js_lexer.highlight(data_ex_str) %>
diff --git a/app/views/hooks/index.html.haml b/app/views/hooks/index.html.haml
index b0795ad4b2f..e149f4fc767 100644
--- a/app/views/hooks/index.html.haml
+++ b/app/views/hooks/index.html.haml
@@ -1,4 +1,8 @@
= 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
@@ -14,3 +18,13 @@
- else
%h3 No hooks
+.clear
+%h3 Help
+%p
+ Post receive hooks. For now only POST request allowed. We send some data with request. Example below
+
+.view_file
+ .view_file_header
+ %strong POST data passed
+ .data.no-padding
+ = render "data_ex"
diff --git a/app/views/hooks/show.html.haml b/app/views/hooks/show.html.haml
index 6bc1132de27..47c1ddeac40 100644
--- a/app/views/hooks/show.html.haml
+++ b/app/views/hooks/show.html.haml
@@ -1,5 +1,8 @@
= render "repositories/head"
-%h3= @hook.url
+%h3
+ %span.commit.tag POST
+ = @hook.url
+
- if can? current_user, :admin_project, @project
.merge-tabs