{% extends "page.twig" %}

{% block main %}

<div>
    <p>
        {{ __('Step 2', 'Title', {'%s': poll.title }) }}
    </p>
</div>
<form name="formulaire-classic" method="POST" action="{{ path('new_classic_poll_step_3') }}" class="form-horizontal" role="form">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="alert alert-info">
                <p>
                    {{ __('Step 2 classic', 'To make a generic poll you need to propose at least two choices between differents subjects.') }}
                </p>
                <p>
                    {{ __('Step 2 classic', 'You can add or remove additional choices with the buttons') }}
                    <span class="glyphicon glyphicon-minus text-info"></span>
                    <span class="sr-only">{{ __('Generic', 'Remove') }}</span>
                    <span class="glyphicon glyphicon-plus text-success"></span>
                    <span class="sr-only">{{ __('Generic', 'Add') }}</span>
                </p>
                {#{% if config.user_can_add_img_or_link %}#}
                <p>
                    {{  __('Step 2 classic', 'It\'s possible to propose links or images by using') }}
                    <a href="http://' . {{ locale }}. '.wikipedia.org/wiki/Markdown">{{  __('Step 2 classic', 'the Markdown syntax') }}</a>
                </p>
                {#{% endif %}#}
            </div>

            {% for i, choice in choices %}
            <div class="form-group choice-field">
                <label for="choice' . {{ i }} . '" class="col-sm-2 control-label"> {{ __('Generic', 'Choice') }} {{ i + 1 }}</label>
                <div class="col-sm-10 input-group">
                    <input type="text" class="form-control" name="choices[]" size="40" value="{{ choice.name }}" id="choice{{ i }}" />
                    {#{% if config.user_can_add_img_or_link %}#}
                        <span class="input-group-addon btn-link md-a-img" title="{{ __('Step 2 classic', 'Add a link or an image') }} - {{ __('Generic', 'Choice') }} {{ i + 1 }}" >
                            <span class="glyphicon glyphicon-picture"></span>
                            <span class="glyphicon glyphicon-link"></span>
                        </span>
                    {#{% endif %}#}
                </div>
            </div>
            {% endfor %}

            <div class="col-md-4">
                <div class="btn-group btn-group">
                    <button type="button" id="remove-a-choice" class="btn btn-default" title="{{  __('Step 2 classic', 'Remove a choice') }}"><span class="glyphicon glyphicon-minus text-info"></span><span class="sr-only">{{ __('Generic', 'Remove') }}</span></button>
                    <button type="button" id="add-a-choice" class="btn btn-default" title="{{ __('Step 2 classic', 'Add a choice') }}"><span class="glyphicon glyphicon-plus text-success"></span><span class="sr-only">{{ __('Generic', 'Add') }}</span></button>
                </div>
            </div>
            <div class="col-md-8 text-right">
                <a class="btn btn-default" href="{{ path('new_poll', {'type': 'classic'}) }}" title="{{ __('Step 2', 'Back to step 1') }}">{{ __('Generic', 'Back') }}</a>
                <button name="fin_sondage_autre" value="{{ __('Generic', 'Next') }}" type="submit" class="btn btn-success" title="{{ __('Step 2', 'Go to step 3') }}">{{ __('Generic', 'Next') }}</button>
            </div>
        </div>
    </div>
    <div class="modal fade" id="md-a-imgModal" tabindex="-1" role="dialog" aria-labelledby="md-a-imgModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">{{ __('Generic', 'Close') }}</span></button>
                    <p class="modal-title" id="md-a-imgModalLabel">{{ __('Step 2 classic', 'Add a link or an image') }}</p>
                </div>
                <div class="modal-body">
                    <p class="alert alert-info">{{ __('Step 2 classic', 'These fields are optional. You can add a link, an image or both.') }}</p>
                    <div class="form-group">
                        <label for="md-img"><span class="glyphicon glyphicon-picture"></span>{{ __('Step 2 classic', 'URL of the image') }}</label>
                        <input id="md-img" type="text" placeholder="http://…" class="form-control" size="40" />
                    </div>
                    <div class="form-group">
                        <label for="md-a"><span class="glyphicon glyphicon-link"></span>{{ __('Generic', 'Link') }}</label>
                        <input id="md-a" type="text" placeholder="http://…" class="form-control" size="40" />
                    </div>
                    <div class="form-group">
                        <label for="md-text">{{ __('Step 2 classic', 'Alternative text') }}</label>
                        <input id="md-text" type="text" class="form-control" size="40" />
                    </div>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">{{ __('Generic', 'Cancel') }}</button>
                    <button type="button" class="btn btn-primary">{{  __('Generic', 'Add') }}</button>
                </div>
            </div>
        </div>
    </div>
</form>

{% endblock %}
