{% extends '@MauticCore/FormTheme/form_simple.html.twig' %}
{% form_theme form with [
    '@MauticSms/FormTheme/SmsSendList/smssend_list_row.html.twig'
] %}

{% block mauticContent %}sms{% endblock %}
{# @var sms \Mautic\SmsBundle\Entity\Sms #}
{% set type            = sms.getSmsType() %}
{% set isExisting      = sms.getId() %}
{% set translationBase = 'mautic.sms' %}
{% set mauticContent   = 'sms' %}

{% block primaryFormContent %}
<div class="row">
    <div class="col-md-6">
        {{ form_row(form.name) }}
    </div>
</div>

<div class="row">
    <div class="col-md-12">
        <div class="characters-count">
            <label class="control-label" for="" data-toggle="tooltip" data-container="body" data-placement="top" title="" data-original-title="{{ 'mautic.sms.form.nbcharacter.infobox'|trans }}">
                {{ 'mautic.sms.form.nbcharacter.counter'|trans }}
                <span size="sm" class="label label-gray" id="sms_nb_char">0</span>
            </label>
        </div>
        {{ form_row(form.message) }}
        <i class="text-secondary">{{ 'mautic.sms.token.dropdown.hint'|trans|purify }}</i>

    </div>
</div>
{% endblock %}

{% block rightFormContent %}
{{ form_row(form.category) }}
{{ form_row(form.language) }}
{{ form_row(form.isPublished, {
    'attr': {
        'data-none': 'mautic.core.form.sending_paused',
        'data-start': 'mautic.core.form.sending_on_scheduled_start',
        'data-both': 'mautic.core.form.sending_during_scheduled_period',
        'data-end': 'mautic.core.form.available_until_scheduled_end'
    }
}) }}

<div id="leadList"{% if 'template' == type %} class="hide"{% endif %}>
    {{ form_row(form.lists) }}
    {{ form_row(form.publishUp, {'label': 'mautic.core.form.sending.start_at'}) }}
    {{ form_row(form.publishDown, {'label': 'mautic.core.form.sending.stop_at'}) }}
</div>

<div class="hide">
    {{ form_rest(form) }}
</div>

{% if (updateSelect is not defined or updateSelect is empty) and not isExisting and not formContainsErrors(form) or type is empty %}
    {{- include('@MauticCore/Helper/form_selecttype.html.twig',
        {
            'item'       : sms,
            'mauticLang' : {
                'newListSms'     : 'mautic.sms.type.list.header',
                'newTemplateSms' : 'mautic.sms.type.template.header',
            },
            'typePrefix'         : 'sms',
            'cancelUrl'          : 'mautic_sms_index',
            'header'             : 'mautic.sms.type.header',
            'typeOneHeader'      : 'mautic.sms.type.template.header',
            'typeOneIconClass'   : 'ri-message-3-fill',
            'typeOneDescription' : 'mautic.sms.type.template.description',
            'typeOneDifferences' : '',
            'typeOneOnClick'     : "Mautic.selectSmsType('template');",
            'typeTwoHeader'      : 'mautic.sms.type.list.header',
            'typeTwoIconClass'   : 'ri-pie-chart-fill',
            'typeTwoDescription' : 'mautic.sms.type.list.description',
            'typeTwoDifferences' : '',
            'typeTwoOnClick'     : "Mautic.selectSmsType('list');",
        }
    ) -}}
{% endif %}
{% endblock %}
