{% load avatars djblets_utils i18n rb_extensions %}

{% if not settings.DISABLE_FOLLOW_MENU %}
<li>
 <a href="#">
  {% trans "Follow" %}
  <span class="rb-icon rb-icon-dropdown-arrow"></span>
 </a>
 <ul>
  <li><a href="https://www.reviewboard.org/news/"><span class="fa fa-rss"></span> {% trans "Review Board News" %}</a></li>
  <li><a href="https://twitter.com/reviewboard/"><span class="fa fa-twitter"></span> {% trans "Twitter" %}</a></li>
  <li><a href="https://www.facebook.com/reviewboard.org"><span class="fa fa-facebook"></span> {% trans "Facebook" %}</a></li>
  <li><a href="https://reddit.com/r/reviewboard"><span class="fa fa-reddit"></span> {% trans "Reddit" %}</a></li>
  <li><a href="https://www.youtube.com/channel/UCTnwzlRTtx8wQOmyXiA_iCg"><span class="fa fa-youtube"></span> {% trans "YouTube" %}</a></li>
 </ul>
</li>
{% endif %}
<li>
 <a href="#">
  {% trans "Support" %}
  <span class="rb-icon rb-icon-dropdown-arrow"></span>
 </a>
 <ul>
  <li><a href="{{RB_MANUAL_URL}}">{% trans "Documentation" %}</a></li>
  <li><a href="{% url 'support' %}">{% trans "Get Support" %}</a></li>
 </ul>
</li>
{% if request.user.is_authenticated %}
<li>
{%  spaceless %}
 <a class="user-nav-item" href="{% url 'user' request.user.username %}">
{%   if siteconfig_settings.avatars_enabled %}
  {% avatar user 32 %}
{%   endif %}
   {{request.user.username}}
   <span class="rb-icon rb-icon-dropdown-arrow"></span>
 </a>
{%  endspaceless %}
 <ul>
  <li><a href="{% url 'user-preferences' %}">{% trans "My account" %}</a></li>
{%  if request.user.is_staff %}
  <li><a href="{% url 'reviewboard.admin.views.dashboard' %}">{% trans "Admin" %}</a></li>
{%  endif %}
  <li><a href="{% url 'logout' %}">{% trans "Log out" %}</a></li>
 </ul>
</li>
{% else %}
<li><a href="{% url 'login' %}?next={{request.path}}">{% trans "Log in" %}</a></li>
{#  XXX Using default sucks, but siteconfig defaults don't #}
{#      work from templates.                               #}
{%  if auth_backends.0.supports_registration and siteconfig_settings.auth_enable_registration|default_if_none:1 %}
<li><a href="{% url 'register' %}">{% trans "Register" %}</a></li>
{%  endif %}
{% endif %}{# !is_authenticated #}
