{% extends "prod/actions/Bridge/wrapper.html.twig" %}

{% block menu %}
  {% trans %}Creer un Photoset{% endtrans %}
{% endblock %}

{% block response %}
<form class="bridge_form" method="POST" action="{{ path('bridge_account_do_action', { 'account_id' : account.get_id(), 'action' : action, 'element_type' : element_type }) }}">
  <input type="hidden" name='f_container_type' value="photoset">
  <table>
    <tr>
      <td class='column_left'>
        <label for='title'> *{{ 'Titre' | trans }}
          <br/>
          <span class='form_error'>&nbsp;</span>
        </label>
      </td>
      <td class='column_right'>
        <input name='title' type='text' value='' class='required_field' />
      </td>
    </tr>
    <tr>
      <td class='column_left'>
        <label for='description'> {{ 'Description' | trans }}
          <br/>
          <span class='form_error'>&nbsp;</span>
        </label>
      </td>
      <td class="column_right">
        <textarea name='description' rows='5' value=''></textarea>
      </td>
    </tr>

    {% set result = account.get_api().list_elements('photo',0,0)%}
    <tr>
      <td class='column_left'>
        <label for='f_container_primary_photo'> *{{ 'Photo principale' | trans }}
          <br/>
          <span class='form_error'>&nbsp;</span>
        </label>
      </td>
      <td class='column_right'>
        <select name='f_container_primary_photo' class='required_field'>
          {% for element in result.get_elements() %}
            <option value='{{element.get_id}}'>{{element.get_title}}</option>
          {% endfor %}
        </select>
      </td>
    </tr>
    <tr>
      <td></td>
      <td class='column_right'>
        <button class="form_submitter btn btn-inverse">{{ 'boutton::valider' | trans }}</button>
        <button class="back_link btn btn-inverse">{{ 'boutton::retour' | trans }}</button>
      </td>
    </tr>
  </table>
</form>
{% endblock %}
