{% extends app['twig_theme'] ~ '/' ~ 'layout.twig' %}
{% set title = 'Advertising'|trans ~ ': ' ~ 'Registering'|trans %}

{% block head %}

    {{ parent() }}
    <style type="text/css">
        {% include (app.twig_theme ~ "/ExternalAdvertising/register/register.css") %}
    </style>

{% endblock %}

{% block footer_js %}
    
        {{ parent() }}
        {% include app.twig_theme ~ "/basic_templates/scripts-select2.twig" %}
        <script type="text/javascript" defer>
            {% include (app.twig_theme ~ "/ExternalAdvertising/register/register.js.twig") %}
        </script>

{% endblock footer_js %}


{% block content %}

    <div id="add_channel">
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                <div class="box">
                    <div class="box-content">
                        <div class="row">
                            <div class="col-sm-12">
                                <h4><strong>{{ 'Earn money displaying ads to your subscribers!'|trans }}</strong></h4>
                                <hr style="margin-top: 0;">
                            </div>
                            <div class="col-sm-5">
                                <p>
                                    {{ 'The service of advertising to subscribers is the program implemented in partnership with Adtelligent.'|trans }}
                                    {{ 'This is an additional source of monetization which will help you do the following:'|trans }}
                                    <ul>
                                        <li>{{ 'reduce subscription costs'|trans }}</li>
                                        <li>{{ 'increase profits'|trans }}</li>
                                        <li>{{ 'attract new subscribers'|trans }}</li>
                                    </ul>
                                    {{ 'This service is available to those with subscriber bases with at least 100 users in the United States, Canada, France, Germany, Russia, and Ukraine.'|trans }}
                                </p>
                                <p>
                                    <strong>{{ 'How does it work?'|trans }}</strong>
                                </p>
                                <p>
                                    {{ 'You independently determine which audience will be shown the ads.'|trans }}
                                    {{ 'In your personal account in Adtelligent, you will see funds credited in real time for viewed advertising.'|trans }}
                                    {{ 'To activate the service, fill out the form below.'|trans }}
                                </p>
                                <p>
                                    {{ 'Please check and follow the detailed instructions'|trans }} <a target="_blank" href="https://wiki.infomir.eu/{{ app['language'] is defined and app['language'] == 'ru'? 'rus/ministra-tv-platform/administrativnaya-panel/reklama' : 'eng/ministra-tv-platform/administrative-panel/advertising' }}">{{ 'on the Documentation'|trans }}.</a>
                                </p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        {{ form_start(app['form'], {'method': 'POST', 'action': (app.request_context.baseUrl ~ '/' ~ app.controller_alias  ~ '/' ~ app.action_alias) | trans, 'attr': {'class': 'form-horizontal', 'role': 'form', 'id': 'form_'}}) }}
        <div class="bg-danger">
            <div class="bg-danger">
                {{ form_errors(app['form']) }}
            </div>
        </div>
        <div class="row">
            <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
                <div class="box">
                    <div class="box-content">
                        <div class="row">
                            <div class="col-sm-12">
                                <h4><strong>{{ 'Submit an application'|trans }}</strong></h4>
                                <hr style="margin-top: 0;">
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label ">{{ 'Full Name'|trans }}<span class="icon-required">*</span></label>
                                <div class="col-xs-10 col-sm-8">
                                    <div class=" col-xs-10 col-sm-5">
                                        {{ form_widget(app['form'].submit_type, {'attr': {'class': 'form-control'}}) }}
                                        {{ form_widget(app['form'].name, {'attr': {'class': 'form-control', 'data-validation': 'required', "data-validation-error-msg-container" : "#name_error"}}) }}
                                        <div class="bg-danger" id="name_error">
                                            {{ form_errors(app['form'].name) }}
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label ">{{ 'Phone'|trans }}<span class="icon-required">*</span></label>
                                <div class="col-xs-10 col-sm-8">
                                    <div class=" col-xs-10 col-sm-5">
                                        {{ form_widget(app['form'].phone, {'attr': {'class': 'form-control', 'data-validation': 'required', "data-validation-error-msg-container" : "#phone_error"}}) }}
                                        <div class="bg-danger" id="phone_error">
                                            {{ form_errors(app['form'].phone) }}
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label ">{{ 'Email'|trans }}<span class="icon-required">*</span></label>
                                <div class="col-xs-10 col-sm-8">
                                    <div class=" col-xs-10 col-sm-5">
                                        {{ form_widget(app['form'].email, {'attr': {'class': 'form-control',  'placeholder': 'mail@example.com', 'data-validation': 'required,email', "data-validation-error-msg-container" : "#email_error"} }) }}
                                        <div class="bg-danger" id="email_error">
                                            {{ form_errors(app['form'].email) }}
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label ">{{ 'Region'|trans }}<span class="icon-required">*</span></label>
                                <div class="col-xs-10 col-sm-8">
                                    <div class=" col-xs-10 col-sm-5">
                                        {{ form_widget(app['form'].region, {'attr': {'class': 'populate placeholder', 'data-validation': 'required', "data-validation-error-msg-container" : "#region_error"} }) }}
                                        <div class="bg-danger" id="region_error">
                                            {{ form_errors(app['form'].region) }}
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group" style="display:{% if app['form'].region.vars.value and app['form'].region.vars.value == 'other' %}block{% else %}none{% endif %};" >
                                <label class="col-sm-2 control-label "> </label>
                                <div class="col-xs-10 col-sm-8">
                                    <label class="col-xs-10">{{ 'Please, fill in your country name'|trans }}</label>
                                    <div class=" col-xs-10 col-sm-5">
                                        {{ form_widget(app['form'].other_region, {'attr': {'class': 'form-control', 'data-validation': 'required', "data-validation-error-msg-container" : "#other_region_error", "data-validation-depends-on": "form[region]", "data-validation-depends-on-value": "other"} }) }}
                                        <div class="bg-danger" id="other_region_error">
                                            {{ form_errors(app['form'].other_region) }}
                                        </div>
                                        {{ form_label(app['form'].other_region, 'Please note that for some countries this service is currently not available'|trans, {'label_attr': {'class': '' }}) }}
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label ">{{ 'Number of abonents'|trans }}<span class="icon-required">*</span></label>
                                <div class="col-xs-10 col-sm-8">
                                    <div class=" col-xs-10 col-sm-5">
                                        {{ form_widget(app['form'].num_users, {'attr': {'class': 'form-control', 'data-validation': 'required,number', "data-validation-error-msg-container" : "#num_users_error"} }) }}
                                        <div class="bg-danger" id="num_users_error">
                                            {{ form_errors(app['form'].num_users) }}
                                        </div>
                                    </div>
                                    <span class="help-inline col-xs-12 col-sm-12">
                                        <span class="small txt-default col-xs-10 col-sm-5 no-padding-left">{{ '*Please note: This service is available only to those with subscriber bases with at least 100 users'|trans }}</span>
                                    </span>
                                </div>
                            </div>
                            <div class="form-group">
                                <label class="col-sm-2 control-label ">{{ 'Web site'|trans }}<span class="icon-required">*</span></label>
                                <div class="col-xs-10 col-sm-8">
                                    <div class=" col-xs-10 col-sm-5">
                                        {{ form_widget(app['form'].website, {'attr': {'class': 'form-control', 'data-validation': 'required', "data-validation-error-msg-container" : "#website_error"} }) }}
                                        <div class="bg-danger" id="website_error">
                                            {{ form_errors(app['form'].website) }}
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-10 col-sm-6">
                                    <div class=" col-xs-10 col-sm-9 col-offset-control-label">
                                        {{ form_widget(app['form'].save, { 'label': 'Submit'|trans , attr: {'class': 'btn btn-success green'}}) }}
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-12">
                                <h4><strong>{{ 'I\'m already registered'|trans }}</strong></h4>
                                <hr style="margin-top: 0;">
                            </div>
                            <div class="col-sm-12 no-padding">
                                <div class="col-sm-5">
                                    <p>
                                        {{ 'If you have already been through the registration procedure in Video Ad system, you should not fill this form again'|trans }}.
                                        {{ 'Click the button below to go to the next step'|trans }}
                                    </p>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-xs-10 col-sm-5">
                                    <div class=" col-xs-10 col-sm-12 text-center">
                                        {{ form_widget(app['form'].skip, { 'label': 'I\'m already registered'|trans , attr: {'class': 'btn btn-default'}}) }}
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div style="">
            {{ form_rest(app.form) }}
        </div>
        {{ form_end(app['form']) }}  
    </div>
{% endblock %}