{% extends 'base.html' %}                                                                                                                      
{% load i18n %}
{% load static %}

{% block title %}{% trans 'Upload a new photo' %} - ivatar{% endblock title %}

{% block header %}<link rel="prefetch" href="{% static 'css/jcrop.css' %}">
<link rel="prefetch" href="{% static '/js/jcrop.js' %}">{% endblock header %}

{% block content %}

<h1>{% trans 'Upload a new photo' %}</h1>

<form enctype="multipart/form-data" action="{% url 'upload_photo' %}" method="post">{% csrf_token %}
{% if email %}<input type="hidden" name="email" value="{{email}}">{% endif %}
{% if openid %}<input type="hidden" name="openid" value="{{openid}}">{% endif %}

{{ form.photo.errors }}
<p class="aligned wide">{{ form.photo.label_tag }} <input id="id_photo" type="file" name="photo" accept="image/*">
<br>{% blocktrans with max_file_size|filesizeformat as max_size %}Maximum file size of {{ max_size }}.{% endblocktrans %}</p>

<ul class="conditions">
  <li>{{ form.not_porn.errors }}{{ form.not_porn }} <label for="id_not_porn">{{ form.not_porn.label }}</label></li>
  <li>{{ form.can_distribute.errors }}{{ form.can_distribute }} <label for="id_can_distribute">{{ form.can_distribute.label }}</label></li>
</ul>

<p><input type="submit" value="{% trans 'Upload' %}" />
&nbsp;<a id="cancel-link" href="{% url 'profile' %}">{% trans 'Cancel' %}</a></p>

</form>

{% endblock content %}
