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

{% block content %}
	<h2>User settings</h2>
	<div class="settings">
	{% if user.is_authenticated %}
		<p class="form-message">{{ msg }}</p>
		{% if state %}
		{% else %}
			<p class="avatar">
				{% if avatar == "" %}
					<img src="{{ STATIC_URL }}/img/admin_noavatar.jpg" />
				{% else %}
					<img src="{% url get_avatar_data "user" user.id %}" />
				{% endif %}
			</p>

			<form class="form" action="/settings/" method="post" enctype="multipart/form-data">
				{% csrf_token %}
				{{ form.as_p }}
				<input type="submit" value="Submit" />
			</form>
		{% endif %}
	{% else %}
		<a href="/login">login</a>
	{% endif %}
	</div>
{% endblock %}
