show.html.haml 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. - content_for :page_title do
  2. = t('admin.webhooks.title')
  3. - content_for :heading do
  4. %h2
  5. %small
  6. = fa_icon 'inbox'
  7. = t('admin.webhooks.webhook')
  8. = @webhook.url
  9. - content_for :heading_actions do
  10. = link_to t('admin.webhooks.edit'), edit_admin_webhook_path, class: 'button' if can?(:update, @webhook)
  11. .table-wrapper
  12. %table.table.horizontal-table
  13. %tbody
  14. %tr
  15. %th= t('admin.webhooks.status')
  16. %td
  17. - if @webhook.enabled?
  18. %span.positive-hint= t('admin.webhooks.enabled')
  19. = table_link_to 'power-off', t('admin.webhooks.disable'), disable_admin_webhook_path(@webhook), method: :post if can?(:disable, @webhook)
  20. - else
  21. %span.negative-hint= t('admin.webhooks.disabled')
  22. = table_link_to 'power-off', t('admin.webhooks.enable'), enable_admin_webhook_path(@webhook), method: :post if can?(:enable, @webhook)
  23. %tr
  24. %th= t('admin.webhooks.events')
  25. %td
  26. %abbr{ title: @webhook.events.join(', ') }= t('admin.webhooks.enabled_events', count: @webhook.events.size)
  27. %tr
  28. %th= t('admin.webhooks.secret')
  29. %td
  30. %samp= @webhook.secret
  31. = table_link_to 'refresh', t('admin.webhooks.rotate_secret'), rotate_admin_webhook_secret_path(@webhook), method: :post if can?(:rotate_secret, @webhook)