diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-04-26 20:43:12 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-04-26 20:43:12 +0300 |
commit | 28cb43135ce7691a7b0022cb8fcb719d0e46c810 (patch) | |
tree | 28544a9855c3331d3bd1e5184c5b0dd4cc6cbaff /app/views/hooks | |
parent | 7b7547aa00e3c26637247812a1a5adf169ac4a55 (diff) | |
download | gitlab-ce-28cb43135ce7691a7b0022cb8fcb719d0e46c810.tar.gz |
Hooks UI improved, Request tests added
Diffstat (limited to 'app/views/hooks')
-rw-r--r-- | app/views/hooks/index.html.haml | 38 | ||||
-rw-r--r-- | app/views/hooks/new.html.haml | 12 | ||||
-rw-r--r-- | app/views/hooks/show.html.haml | 7 |
3 files changed, 31 insertions, 26 deletions
diff --git a/app/views/hooks/index.html.haml b/app/views/hooks/index.html.haml index 672d2bb0565..d81cce763d6 100644 --- a/app/views/hooks/index.html.haml +++ b/app/views/hooks/index.html.haml @@ -1,19 +1,43 @@ = render "projects/project_head" - if can? current_user, :admin_project, @project - .alert-message.block-message - Post receive hooks for binding events when someone push to repository. - = link_to new_project_hook_path(@project), :class => "btn small", :title => "New Web Hook" do - Add Post Receive Hook + .alert.alert-info + %span + Post receive hooks for binding events when someone push to repository. + %br + Read more about web hooks + %strong #{link_to "here", help_web_hooks_path, :class => "vlink"} - %p Read more about web hooks #{link_to "here", help_web_hooks_path, :class => "vlink"} += form_for [@project, @hook], :as => :hook, :url => project_hooks_path(@project) do |f| + -if @hook.errors.any? + .alert-message.block-message.error + - @hook.errors.full_messages.each do |msg| + %p= msg + .clearfix + = f.label :url, "URL:" + .input + = f.text_field :url, :class => "text_field xxlarge" + + = f.submit "Add Web Hook", :class => "btn primary" +%hr -if @hooks.any? - %table + %h3 + Hooks + %small (#{@hooks.count}) + %br + %table.admin-table + %tr + %th URL + %th Method + %th - @hooks.each do |hook| %tr %td = link_to project_hook_path(@project, hook) do - = hook.url + %strong= hook.url + = link_to 'Test Hook', test_project_hook_path(@project, hook), :class => "btn small right" + %td POST %td = link_to 'Remove', project_hook_path(@project, hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn small right" + diff --git a/app/views/hooks/new.html.haml b/app/views/hooks/new.html.haml deleted file mode 100644 index f2a5ef534f4..00000000000 --- a/app/views/hooks/new.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -= 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 - .clearfix - = f.label :url, "URL:" - .input= f.text_field :url, :class => "text_field" - .actions - = f.submit "Save", :class => "btn" - diff --git a/app/views/hooks/show.html.haml b/app/views/hooks/show.html.haml deleted file mode 100644 index 5ec4d5d8758..00000000000 --- a/app/views/hooks/show.html.haml +++ /dev/null @@ -1,7 +0,0 @@ -= render "repositories/head" -%pre= @hook.url - -- if can? current_user, :admin_project, @project - .actions - = link_to 'Test Hook', test_project_hook_path(@project, @hook), :class => "btn" - = link_to 'Remove', project_hook_path(@project, @hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn" |