{% extends '@CpCreationVitiCore/admin/base.html.twig' %}

{% block content %}
    <h1 class="page-header">{{ 'emailing.campaign.new'|trans }}</h1>
    <form method="post" class="panel panel-default">
        <input type="hidden" name="_token" value="{{ csrf_token('brevo_campaign_create') }}">
        <div class="panel-body">
            <div class="form-group"><label for="campaign-title">{{ 'emailing.campaign.title'|trans }}</label><input id="campaign-title" class="form-control" name="title" value="{{ app.request.request.get('title') }}" required><p class="help-block">{{ 'emailing.campaign.title_help'|trans }}</p></div>
            <div class="form-group"><label for="campaign-subject">{{ 'emailing.campaign.subject'|trans }}</label><input id="campaign-subject" class="form-control" name="subject" value="{{ app.request.request.get('subject') }}" required></div>
            <div class="form-group"><label for="campaign-content">{{ 'emailing.campaign.content'|trans }}</label><textarea id="campaign-content" class="form-control" name="text_content" rows="12" required>{{ app.request.request.get('text_content') }}</textarea><p class="help-block">{{ 'emailing.campaign.content_help'|trans }}</p></div>
            <div class="row">
                <div class="col-md-6"><div class="form-group"><label for="campaign-sender">{{ 'emailing.campaign.sender'|trans }}</label><select id="campaign-sender" class="form-control" name="sender_id" required>{% for sender in senders %}<option value="{{ sender.id }}">{{ sender.name }} &lt;{{ sender.email }}&gt;</option>{% endfor %}</select></div></div>
                <div class="col-md-6"><div class="form-group"><label for="campaign-lists">{{ 'emailing.campaign.lists'|trans }}</label><select id="campaign-lists" class="form-control" name="list_ids[]" multiple size="5" required>{% for item in lists %}<option value="{{ item.id }}">{{ item.name }}</option>{% endfor %}</select></div></div>
            </div>
            <fieldset><legend>{{ 'emailing.campaign.utm_title'|trans }}</legend><p>{{ 'emailing.campaign.utm_help'|trans }}</p>
                <div class="row">
                    <div class="col-md-4"><div class="form-group"><label for="utm-source">utm_source</label><input id="utm-source" class="form-control" name="utm_source" placeholder="{{ 'emailing.campaign.utm_title_default'|trans }}"></div></div>
                    <div class="col-md-4"><div class="form-group"><label for="utm-medium">utm_medium</label><input id="utm-medium" class="form-control" name="utm_medium" value="email"></div></div>
                    <div class="col-md-4"><div class="form-group"><label for="utm-campaign">utm_campaign</label><input id="utm-campaign" class="form-control" name="utm_campaign" placeholder="{{ 'emailing.campaign.utm_title_default'|trans }}"></div></div>
                    <div class="col-md-6"><div class="form-group"><label for="utm-term">utm_term</label><input id="utm-term" class="form-control" name="utm_term"></div></div>
                    <div class="col-md-6"><div class="form-group"><label for="utm-content">utm_content</label><input id="utm-content" class="form-control" name="utm_content"></div></div>
                </div>
            </fieldset>
        </div>
        <div class="panel-footer"><button class="btn btn-primary" type="submit">{{ 'emailing.campaign.create_draft'|trans }}</button> <a class="btn btn-default" href="{{ path('admin_marketing_emailing') }}">{{ 'emailing.common.cancel'|trans }}</a></div>
    </form>
{% endblock %}
