{% extends "templates/base.html" %}

{% block content %}
{% if edited %}
<p class="edited">User successfuly updated</p>
{% endif %}
{% if user.is_superuser or user.id == user_to_edit.id %}
<form action="/user/edit/{{ user_to_edit.id }}" method="post">
{% csrf_token %}
{{ form.as_p }}
<p><label for="id_password">Password:</label> <input id="id_password" type="text" name="password" maxlength="128" /></p>
<input type="submit" name="edit" value="Edit" /><input type="submit" name="cancel" value="Cancel" />{% if user.is_superuser %}<input type="submit" name="delete" value="Delete"  onclick="return confirm('Do you really want to delete this item ?')"/>{% endif %}
</form>
{% else %}
<form action="/user/edit/{{ user_to_edit.id }}" method="post">
{% csrf_token %}
{{ form.as_p }}
<input type="submit" name="cancel" value="Cancel" />
</form>
{% endif %}
{% endblock %}
