{% extends '@MauticCore/Default/content.html.twig' %}

{% block headerTitle pageTitle %}

{% block content %}
    {{ form_start(form) }}
    <div class="panel panel-default">
        <div class="panel-body">
            <p class="text-muted">
                This source will accept either the Deal Flow timestamped signature headers or Mautic's native <code>Webhook-Signature</code> header. Preferred endpoint: <code>{{ endpointPath }}</code>
            </p>
            <div class="row">
                <div class="col-md-6">{{ form_row(form.name) }}</div>
                <div class="col-md-6">{{ form_row(form.sourceKey) }}</div>
            </div>
            <div class="row">
                <div class="col-md-8">{{ form_row(form.secret) }}</div>
                <div class="col-md-4">{{ form_row(form.isActive) }}</div>
            </div>
        </div>
    </div>
    <div class="btn-group">
        <button class="btn btn-primary" type="submit">Save Source</button>
        <a class="btn btn-default" href="{{ cancelUrl }}">Cancel</a>
        {% if source is defined and source.getId() %}
            <a class="btn btn-danger" href="{{ path('mautic_dealflow_inbound_webhook_delete', {'objectId': source.getId()}) }}">Delete Source</a>
        {% endif %}
    </div>
    {{ form_end(form) }}
{% endblock %}
