{% form_theme form 'MuzichCoreBundle:Form:errors.html.twig' %}

{#{ form_errors(form) }#}

<input type="hidden" id="form_add_step" value="1" />
<script type="text/javascript">
  // bugfix: lors du rechargement du navigateur, il se peut que input#form_add_step
  // soit remplacé par la valeur 2 (si rechargé pendant la 2ème phase)
  $(document).ready(function(){
    $('input#form_add_step').val(1);
  });
</script>

<div id="form_add_first_part">

  <span class="help">
    {{ 'element_add.url.help'|trans({}, 'userui') }}
    <strong>
      <a href="{{ path('helpbox_bootstrap', {'ressource_id':'element_add_url'}) }}" class="helpbox">
        {{ 'element_add.url.more_help'|trans({}, 'userui') }}
      </a>
      </strong>
  </span>
  

  <div class="field fom_add_url">
    {{ form_errors(form.url) }}
    {{ form_widget(form.url, { 'attr': {
      'placeholder': 'element_add.url.name'|trans({}, 'userui'),
      'class': 'niceinput'
      },
      'type': 'URL'
    }) }}

    <input class="button" type="submit" value="{{ 'home.check_url'|trans({}, 'navigationui') }}" />

  </div>
    
</div>

<div id="form_add_second_part" style="display: none;">
  
  <div  id="add_url_title">
    {{ 'element.add.url_title_step2'|trans({}, 'elements') }}:
    <span id="add_url_title_url"></span>
  </div>
  
  
  <input type="submit" value="{{ 'element.share.share_button'|trans({}, 'userui') }}" class="button" />
  
  <table>
    <tr>
      <td style="vertical-align: top;">
        <div id="form_add_thumb">
          <img src="{{ asset('bundles/muzichcore/img/nothumb.png') }}" />
        </div>
      </td>
      <td style="vertical-align: top;">
        <div class="field fom_add_name">
          {{ form_errors(form.name) }}
          {{ form_widget(form.name, { 'attr':
            {
              'placeholder': 'element_add.name.name'|trans({}, 'userui'),
              'class' : 'niceinput'
            }
          }) }}
        </div>

          <p id="form_add_prop_tags_text" style="display: none;">
            {{ 'element_add.prop_tags.text'|trans({}, 'userui') }}
          </p>
          <ul id="form_add_prop_tags_api" style="display: none;"></ul>

          <div style="clear: both;"></div>
          
          {% include "MuzichCoreBundle:Tag:tagsPrompt.html.twig" with { 
            'form_name'     : form_name
          } %}

          {{ form_widget(form.tags, { 'attr': {'class': 'tagBox_tags_ids'} }) }}

        <div class="field">
          {{ form_errors(form.need_tags) }}
          {{ form_widget(form.need_tags) }}
          {{ form_label(form.need_tags, 'element_add.need_tags.name'|trans({}, 'userui')) }}
        </div>
      </td>
    </tr>
  </table>
    
</div>

    <img id="form_add_loader" class="tag_loader" style="display: none;" 
      src="{{ asset('/bundles/muzichcore/img/ajax-loader.gif') }}" alt="loading" 
    />

{{ form_row(form._token) }}