{% extends "layout.html" %}

{% block content_header %}
  {{ build_breadcrumbs(current_breadcrumbs + [
    { 'name': resource.name, 'link': url_for('.WebhookView:get', id=resource.uuid), 'icon': 'globe' }
  ]) }}
{% endblock %}

{% block content %}
  {% call build_section_row() %}
    {% call build_form_box(_('Webhook'), resource.name, 'globe') %}
      {% call build_form(action=url_for('.WebhookView:put', id=resource.uuid)) %}
        {% call add_default_fields(form=form, submit_value=_('Update')) %}
          {{ render_field(form.name) }}
          {{ render_field(form.events, data_allow_custom_values=True, data_listing_href='') }}
          {{ render_field(form.user_uuid, data_listing_href=url_for(listing_urls['uuid_user'])) }}
          {{ render_field(form.events_user_uuid, with_label=false) }}
          {{ render_field(form.services) }}
          {{ render_field(form.url) }}
          {{ render_field(form.method) }}
          {{ render_field(form.verify_certificate) }}
          {{ render_field(form.content_type) }}
          {{ render_field(form.body) }}
        {% endcall %}
      {% endcall %}
    {% endcall %}
  {% endcall %}
{% endblock %}
