{% extends "MuzichUserBundle::layout.html.twig" %}

{% block title %}Mon compte{% endblock %}

{% block content %}

  <h2>{{ 'my_account.title'|trans({}, 'userui') }}</h2>
  
  <ul>
    <li>
      <b>{{ 'my_account.username'|trans({}, 'userui') }}</b>: {{ user.name }}
    </li>
    <li>
      <b>{{ 'my_account.email'|trans({}, 'userui') }}</b>: {{ user.email }}
    </li>
  </ul>
  
  <h3>{{ 'my_account.favorite_tags'|trans({}, 'userui') }}</h3>
  
  {% include "MuzichCoreBundle:Tag:tagFavoritesForm.html.twig" with { 
    'form'             : form_tags_favorites,
    'redirect'         : 'account',
    'form_name'        : form_tags_favorites_name,
    'favorite_tags_id' : favorite_tags_id
  } %}
  
  <h3>{{ 'my_account.change_password'|trans({}, 'userui') }}</h3>
  
  <form action="{{ path('change_password') }}" method="post" {{ form_enctype(form_password) }}>
    
    {% include "MuzichUserBundle:Security:change_password_form.html.twig" with { 
      'form': form_password
    } %}

    <input type="submit" class="button" />
  </form>
  
  <h3>{{ 'my_account.change_email'|trans({}, 'userui') }}</h3>
  
  <form action="{{ path('change_email_request') }}" method="post" {{ form_enctype(change_email_form) }}>
    
    {% include "MuzichUserBundle:User:change_email_form.html.twig" with { 
      'form': change_email_form
    } %}

    <input type="submit" class="button" />
  </form>
  
  <h3>{{ 'my_account.address.title'|trans({}, 'userui') }}</h3>
  
  <p>{{ 'my_account.address.description'|trans({}, 'userui') }}</p>
  
  <form id="address_update" action="{{ path('update_address', {"token":app.user.getPersonalHash}) }}" method="post">
    <p>
      {{ 'my_account.address.form.ilivenear'|trans({}, 'userui') }}
      <input type="text" name="town" class="intext" value="{{ app.user.town }}" />
      {{ 'my_account.address.form.in'|trans({}, 'userui') }}
      <input type="text" name="country" class="intext" value="{{ app.user.country }}" />
      <input type="submit" value="{{ 'my_account.address.form.submit'|trans({}, 'userui') }}" class="button address_submit" />
      <img class="loader" style="display: none;" src="{{ asset('/bundles/muzichcore/img/ajax-loader.gif') }}" alt="loading"/>
    </p>
  </form>
    
{% endblock %}