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

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

{% block content %}
<h1>{{ user.username }}</h1>
<div class="buttons">
	{% if user.is_authenticated %}
		<div class="user-details">
			{% trans 'You are logged in as' %} <code>{{ user.username }}</code> {% trans 'with email' %}<code>{{ user.email }}</code>!
			<a class="btn btn-primary" href="{% url 'sp_logout_page' %}" id="logout"><i class="fa fa-sign-out"></i>{% trans 'Logout' %}</a>
		</div>
		<div class="user-details">
			<img src="{{ user.image_url.value|default:'http://www.gravatar.com/avatar/00000000000000000000000000000000?d=mm' }}">
			<i>{{ user.first_name }} {{ user.last_name }}</i>
		</div>

		{% if request.user.username == user.username %}
			<div class="user-details">
				<a class="btn btn-primary" href="{% url 'sp_profile_edit_page' user.id %}" id="edit"><i class="fa fa-edit"></i>{% trans 'Edit' %}</a>
				<a class="btn btn-primary" href="{% url 'user_sessions:session_list' %}" ><i class="fa fa-sign-out"></i>{% trans 'Active Sessions' %}</a>
			</div>
		{% endif %}

	{% else %}
		<div class="user-details">
		  {% trans 'You are not logged in!' %}
		</div>

		<div class="user-details">
			<a class="btn btn-primary" href="{% url 'sp_select_page' %}" id="login"><i class="fa fa-sign-in"></i>{% trans 'Login' %}</a>
		</div>
	{% endif %}
</div>
{% endblock %}
