Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-12-16 12:08:10 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-12-16 12:08:10 +0300
commit13867d66e92c2fd8962a126db4fbdc32891343c9 (patch)
tree580a1baf1cdd3283ede126ee510ecf1d3562a471 /app/views/shared
parent83758a4e5fcfec056b36a4b56fb22c8a915753cc (diff)
Add latest changes from gitlab-org/gitlab@masterogolowinski-master-patch-27476
Diffstat (limited to 'app/views/shared')
-rw-r--r--app/views/shared/web_hooks/_hook.html.haml16
-rw-r--r--app/views/shared/web_hooks/_index.html.haml14
-rw-r--r--app/views/shared/web_hooks/_test_button.html.haml6
-rw-r--r--app/views/shared/web_hooks/_title_and_docs.html.haml5
4 files changed, 38 insertions, 3 deletions
diff --git a/app/views/shared/web_hooks/_hook.html.haml b/app/views/shared/web_hooks/_hook.html.haml
new file mode 100644
index 00000000000..34a62340966
--- /dev/null
+++ b/app/views/shared/web_hooks/_hook.html.haml
@@ -0,0 +1,16 @@
+%li
+ .row
+ .col-md-8.col-lg-7
+ %strong.light-header= hook.url
+ %div
+ - hook.class.triggers.each_value do |trigger|
+ - if hook.public_send(trigger)
+ %span.badge.badge-gray.deploy-project-label= trigger.to_s.titleize
+ %span.badge.badge-gray
+ = _('SSL Verification:')
+ = hook.enable_ssl_verification ? _('enabled') : _('disabled')
+
+ .col-md-4.col-lg-5.text-right-md.prepend-top-5
+ %span>= render 'shared/web_hooks/test_button', hook: hook, button_class: 'btn-sm append-right-8'
+ %span>= link_to _('Edit'), edit_hook_path(hook), class: 'btn btn-sm append-right-8'
+ = link_to _('Delete'), destroy_hook_path(hook), data: { confirm: _('Are you sure?') }, method: :delete, class: 'btn btn-sm'
diff --git a/app/views/shared/web_hooks/_index.html.haml b/app/views/shared/web_hooks/_index.html.haml
new file mode 100644
index 00000000000..b22d51a101a
--- /dev/null
+++ b/app/views/shared/web_hooks/_index.html.haml
@@ -0,0 +1,14 @@
+%hr
+.card
+ .card-header
+ %h5
+ = hook_class.underscore.humanize.titleize.pluralize
+ (#{hooks.count})
+
+ - if hooks.any?
+ %ul.content-list
+ - hooks.each do |hook|
+ = render 'shared/web_hooks/hook', hook: hook
+ - else
+ %p.text-center.prepend-top-default.append-bottom-default
+ = _('No webhooks found, add one in the form above.')
diff --git a/app/views/shared/web_hooks/_test_button.html.haml b/app/views/shared/web_hooks/_test_button.html.haml
index 5ece8b1d4c7..fc24e425ab6 100644
--- a/app/views/shared/web_hooks/_test_button.html.haml
+++ b/app/views/shared/web_hooks/_test_button.html.haml
@@ -1,10 +1,10 @@
-- triggers = local_assigns.fetch(:triggers)
- button_class = local_assigns.fetch(:button_class, '')
- hook = local_assigns.fetch(:hook)
+- triggers = hook.class.triggers
-.hook-test-button.dropdown.inline
+.hook-test-button.dropdown.inline>
%button.btn{ 'data-toggle' => 'dropdown', class: button_class }
- Test
+ = _('Test')
= icon('caret-down')
%ul.dropdown-menu.dropdown-menu-right{ role: 'menu' }
- triggers.each_value do |event|
diff --git a/app/views/shared/web_hooks/_title_and_docs.html.haml b/app/views/shared/web_hooks/_title_and_docs.html.haml
new file mode 100644
index 00000000000..359f5f34f5b
--- /dev/null
+++ b/app/views/shared/web_hooks/_title_and_docs.html.haml
@@ -0,0 +1,5 @@
+%h4.prepend-top-0
+ = page_title
+%p
+ - link = link_to(hook.pluralized_name, help_page_path(hook.help_path))
+ = _('%{link} can be used for binding events when something is happening within the project.').html_safe % { link: link }