{% if user.is_authenticated %}
<ul class="nav navbar-nav">
	<li class="dropdown">
		<a href="#" class="dropdown-toggle" data-toggle="dropdown">
            <img src="{{ user.avatar }}" width="16" height="16" alt="{{ user }}" />
            {% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %} <span class="caret"></span></a>
		<ul class="dropdown-menu" role="menu">
            <li><a href="{% url 'accounts_profile_detail' user.username %}">{% trans "Profile" %}</a></li>
            <li class="divider"></li>
            {% if user.is_staff %}<li><a href="/admin/">{% trans "Admin" %}</a></li>{% endif %}
            <li><a href="{% url 'accounts_settings' %}">{% trans "Settings" %}</a></li>
            <li><a href="{% url 'accounts_logout' %}">{% trans "Logout" %}</a></li>
		</ul>
	</li>
</ul> 		    		
{% else %}
<p class="navbar-text">
	<a class="navbar-link" href="{% url 'accounts_login' %}">{% trans 'Log In' %}</a>
    {% trans "or" %}
	<a class="navbar-link" href="{% url 'accounts_register' %}">{% trans 'Register' %}</a>
</p>
{% endif %}
