{% extends "cranefly/usercp/layout.html" %}
{% import "_forms.html" as form_theme with context %}
{% import "cranefly/macros.html" as macros with context %}

{% block title %}{{ macros.page_title(title=_('Upload Avatar')) }}{% endblock %}

{% block action %}
<div class="form-container">

  <div class="form-header">
    <h1>{% trans %}Upload Avatar{% endtrans %} <small>{% trans %}Change your Avatar{% endtrans %}</h1>
  </div>

  {% if message %}
  <div class="messages-list">
    {{ macros.draw_message(message) }}
  </div>
  {% endif %}

  <form action="{% url 'usercp_avatar_upload' %}" method="post" enctype="multipart/form-data">
    <input type="hidden" id="js_check" name="js_check" value="0">
    {{ form_theme.form_widget(form, width=9) }}
    <div class="form-actions">
      <button name="save" type="submit" class="btn btn-primary">{% trans %}Upload Avatar{% endtrans %}</button>
      <a href="{% url 'usercp_avatar' %}" class="btn">{% trans %}Cancel{% endtrans %}</a>
    </div>
  </form>
  
</div>
{% endblock %}


{% block javascripts %}
{{ super() }}
    <script type="text/javascript">
      $(function($){
        $('#js_check').val(1);
      });
    </script>
{% endblock %}