show.html.haml 1.4 KB

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