summaryrefslogtreecommitdiff
path: root/app/views/admin/hooks
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-16 09:08:10 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-16 09:08:10 +0000
commit13867d66e92c2fd8962a126db4fbdc32891343c9 (patch)
tree580a1baf1cdd3283ede126ee510ecf1d3562a471 /app/views/admin/hooks
parent83758a4e5fcfec056b36a4b56fb22c8a915753cc (diff)
downloadgitlab-ce-13867d66e92c2fd8962a126db4fbdc32891343c9.tar.gz
Add latest changes from gitlab-org/gitlab@masterogolowinski-master-patch-27476
Diffstat (limited to 'app/views/admin/hooks')
-rw-r--r--app/views/admin/hooks/edit.html.haml31
-rw-r--r--app/views/admin/hooks/index.html.haml31
2 files changed, 19 insertions, 43 deletions
diff --git a/app/views/admin/hooks/edit.html.haml b/app/views/admin/hooks/edit.html.haml
index 9c6c74ed965..9ce0fa8d401 100644
--- a/app/views/admin/hooks/edit.html.haml
+++ b/app/views/admin/hooks/edit.html.haml
@@ -1,21 +1,18 @@
-- add_to_breadcrumbs "System Hooks", admin_hooks_path
-- page_title 'Edit System Hook'
-%h3.page-title
- Edit System Hook
+- add_to_breadcrumbs @hook.pluralized_name, admin_hooks_path
+- page_title _('Edit System Hook')
-%p.light
- #{link_to 'System hooks ', help_page_path('system_hooks/system_hooks')} can be
- used for binding events when GitLab creates a User or Project.
+.row.prepend-top-default
+ .col-lg-3
+ = render 'shared/web_hooks/title_and_docs', hook: @hook
-%hr
+ .col-lg-9.append-bottom-default
+ = form_for @hook, as: :hook, url: admin_hook_path do |f|
+ = render partial: 'form', locals: { form: f, hook: @hook }
+ .form-actions
+ %span>= f.submit _('Save changes'), class: 'btn btn-success append-right-8'
+ = render 'shared/web_hooks/test_button', hook: @hook
+ = link_to _('Delete'), admin_hook_path(@hook), method: :delete, class: 'btn btn-remove float-right', data: { confirm: _('Are you sure?') }
-= form_for @hook, as: :hook, url: admin_hook_path do |f|
- = render partial: 'form', locals: { form: f, hook: @hook }
- .form-actions
- = f.submit 'Save changes', class: 'btn btn-success'
- = render 'shared/web_hooks/test_button', triggers: SystemHook.triggers, hook: @hook
- = link_to 'Remove', admin_hook_path(@hook), method: :delete, class: 'btn btn-remove float-right', data: { confirm: 'Are you sure?' }
+ %hr
-%hr
-
-= render partial: 'admin/hook_logs/index', locals: { hook: @hook, hook_logs: @hook_logs }
+ = render partial: 'admin/hook_logs/index', locals: { hook: @hook, hook_logs: @hook_logs }
diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml
index b65bf07160a..eed3ec74d60 100644
--- a/app/views/admin/hooks/index.html.haml
+++ b/app/views/admin/hooks/index.html.haml
@@ -1,35 +1,14 @@
-- page_title 'System Hooks'
+- page_title @hook.pluralized_name
+
.row.prepend-top-default
.col-lg-4
- %h4.prepend-top-0
- = page_title
- %p
- #{link_to 'System hooks ', help_page_path('system_hooks/system_hooks')} can be
- used for binding events when GitLab creates a User or Project.
+ = render 'shared/web_hooks/title_and_docs', hook: @hook
.col-lg-8.append-bottom-default
= form_for @hook, as: :hook, url: admin_hooks_path do |f|
= render partial: 'form', locals: { form: f, hook: @hook }
- = f.submit 'Add system hook', class: 'btn btn-success'
-
- %hr
+ = f.submit _('Add system hook'), class: 'btn btn-success'
- - if @hooks.any?
- .card
- .card-header
- System hooks (#{@hooks.count})
- %ul.content-list
- - @hooks.each do |hook|
- %li
- .controls
- = render 'shared/web_hooks/test_button', triggers: SystemHook.triggers, hook: hook, button_class: 'btn-sm'
- = link_to 'Edit', edit_admin_hook_path(hook), class: 'btn btn-sm'
- = link_to 'Remove', admin_hook_path(hook), data: { confirm: 'Are you sure?' }, method: :delete, class: 'btn btn-remove btn-sm'
- .monospace= hook.url
- %div
- - SystemHook.triggers.each_value do |event|
- - if hook.public_send(event)
- %span.badge.badge-gray= event.to_s.titleize
- %span.badge.badge-gray SSL Verification: #{hook.enable_ssl_verification ? 'enabled' : 'disabled'}
+ = render 'shared/web_hooks/index', hooks: @hooks, hook_class: @hook.class
= render 'shared/plugins/index'