{% extends "base.html" %}
{% load i18n staticfiles %}
{% load socialprofile_tags %}

{% block headtitle %}{% trans "Profile for " %}{{ user.username }}{% endblock %}

{% block content %}
<div class="container" id="layout">
   <!-- Docs nav ================================================== -->
   <div class="row">
        <div class="col-lg-9 col-sm-9" id="article">
			<section title="profile" data-role="content">
				<section title="{% trans 'Picture' %}" class="sp-profile-img">
					<h1 class="sp-profile-name">{{ user.first_name.value|default:"&nbsp;" }} {{ user.last_name.value|default:"&nbsp;" }}</h1>
					{% if request.user.username == user.username.value %}
						<p>
							<a href="{% url 'sp_profile_edit_page' %}?returnTo={{ user.returnTo.value }}" data-role="button" data-mini="true" data-ajax="false"><button class="ui-button-info">{% trans "Edit Profile" %}</button></a>
						</p>
					{% endif %}
					<p>
						<img src="{{ user.image_url.value|default:'http://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm' }}">
					</p>
				</section>
				<ul class="sp-profile-block" data-role="listview" data-inset="true" data-theme="b">
					<li>{{ user.username.label_tag }}{{ user.username.value|default:"&nbsp;" }}</li>

					<li>{{ user.email.label_tag }}{{ user.email.value|default:"&nbsp;" }}</li>

					<li>{{ user.gender.label_tag }}{{ user.gender.value|title|default:"&nbsp;" }}</li>

					<li>{{ user.url.label_tag }}&nbsp;
						<div>{{ user.url.value|urlize }}</div>
					</li>

					<li>{{ user.description.label_tag }}{{ user.description.value|default:"&nbsp;" }}</li>
					{% if request.user.username == user.username.value %}
						<li><label>{% trans "Authentication" %}</label>
							{% for user_social_auth in user.social_auth.all %}
								{{ user_social_auth.provider|social_provider_name }}{% if not forloop.last %},&nbsp;{% endif %}
							{% empty %}
								{% trans "No Social Authentications." %}
							{% endfor %}
						</li>
					{% endif %}
				</ul>
			</section>
		</div>
    </div>
</div>
{% endblock %}
