{% extends "cranefly/base.html" %}
{% from "cranefly/macros.html" import messages_list %}

{% block body %}
<div id="wrap">

  {#{% if acl.special.can_use_mcp() %}
  <div class="navbar navbar-inverse navbar-modbar navbar-static-top">
    <div class="navbar-inner">
      <div class="container">
        <ul class="nav">
          <li><a href="#">Frontlines</a></li>
          <li><a href="#">Reports <span class="label label-important">5</span></a></li>
          <li><a href="#">Warnings</a></li>
        </ul>
        <form class="navbar-form pull-right">
          <div class="navbar-search-form">
            <input type="text" class="span2" placeholder="{% trans %}Enter IP Address or Username...{% endtrans %}">
            <button type="submit" class="btn btn-link"><i class="icon-search"></i></button>
          </div>
        </form>
      </div>
    </div>
  </div>
  {% endif %}#}

  <div class="navbar navbar-header navbar-static-top">
    <div class="navbar-inner">
      <div class="container">
        <a href="{% url 'index' %}" class="brand">{% if settings.board_header %}{{ settings.board_header }}{% else %}{{ settings.board_name }}{% endif %}</a>
        {% if not user.is_crawler() %}
        <form class="navbar-form pull-left">
          <div class="navbar-search-form">
            <input type="text" class="span2" placeholder="{% trans %}Search community...{% endtrans %}">
            <button type="submit" class="btn btn-link"><i class="icon-search"></i></button>
          </div>
        </form>
        {% endif %}
        <ul class="nav navbar-blocks pull-left">
          <li><a href="{% url 'index' %}" title="{% trans %}Forum Home{% endtrans %}" class="tooltip-bottom"><i class="icon-th-list"></i></a></li>
          <li><a href="{% url 'popular_threads' %}" title="{% trans %}Popular Threads{% endtrans %}" class="hot tooltip-bottom"><i class="icon-fire"></i></a></li>
          <li><a href="{% url 'new_threads' %}" title="{% trans %}New Threads{% endtrans %}" class="fresh tooltip-bottom"><i class="icon-leaf"></i></a></li>{% if not user.crawler %}
          {% if not user.is_crawler() %}
          <li><a href="#" title="{% trans %}Search Community{% endtrans %}" class="tooltip-bottom"><i class="icon-search"></i></a></li>{% endif %}
          {% endif %}
          <li><a href="{% url 'users' %}" title="{% trans %}Browse Users{% endtrans %}" class="tooltip-bottom"><i class="icon-user"></i></a></li>
          {% if settings.tos_url or settings.tos_content %}<li><a href="{% if settings.tos_url %}{{ settings.tos_url }}{% else %}{% url 'tos' %}{% endif %}" title="{% if settings.tos_title %}{{ settings.tos_title }}{% else %}{% trans %}Forum Terms of Service{% endtrans %}{% endif %}" class="tooltip-bottom"><i class="icon-certificate"></i></a></li>{% endif %}
        </ul>
        {% if not user.is_crawler() %}
        {% if user.is_authenticated() %}
        <ul class="nav navbar-blocks pull-right">
          <li class="user-profile"><a href="{% url 'user' user=user.id, username=user.username_slug %}" title="{% trans %}Go to your profile{% endtrans %}" class="tooltip-bottom"><div><img src="{{ user.get_avatar(28) }}" alt=""> {{ user.username }}</div></a></li>
          <li><a href="{% url 'alerts' %}" title="{% if user.alerts %}{% trans %}You have new notifications!{% endtrans %}{% else %}{% trans %}Your Notifications{% endtrans %}{% endif %}" class="tooltip-bottom"><i class="icon-asterisk"></i>{% if user.alerts %}<span class="label label-important">{{ user.alerts }}</span>{% endif %}</a></li>
          {% if settings.enable_private_threads and acl.private_threads.can_participate() %}
          <li><a href="{% url 'private_threads' %}" title="{% if user.unread_pds %}{% trans %}There are unread Private Threads!{% endtrans %}{% else %}{% trans %}Your Private Threads{% endtrans %}{% endif %}" class="tooltip-bottom"><i class="icon-inbox"></i>{% if user.unread_pds %}<span class="label label-important">{{ user.unread_pds }}</span>{% endif %}</a></li>
          {% endif %}
          <li><a href="{% url 'newsfeed' %}" title="{% trans %}Your News Feed{% endtrans %}" class="tooltip-bottom"><i class="icon-signal"></i></a></li>
          <li><a href="{% url 'watched_threads' %}" title="{% trans %}Threads you are watching{% endtrans %}" class="tooltip-bottom"><i class="icon-bookmark"></i></a></li>
          <li><a href="{% url 'usercp' %}" title="{% trans %}Edit your profile options{% endtrans %}" class="tooltip-bottom"><i class="icon-cog"></i></a></li>
          <li><form action="{% url 'sign_out' %}" method="post"><input type="hidden" name="{{ csrf_id }}" value="{{ csrf_token }}"><button type="submit" title="{% trans %}Sign Out and browse as guest{% endtrans %}" class="btn btn-link danger tooltip-bottom"><i class="icon-off"></i></button></form></li>
        </ul>
        {% else %}
        <ul class="nav navbar-user-nav pull-right">
          <li><a href="{% url 'sign_in' %}" title="{% trans %}Sign In to Your Account{% endtrans %}" class="tooltip-bottom btn btn-danger"><i class="icon-check"></i> {% trans %}Sign In{% endtrans %}</a></li>{% if settings.account_activation != 'block' %}
          <li><a href="{% url 'register' %}" title="{% trans %}Register new account{% endtrans %}" class="tooltip-bottom btn btn-inverse"><i class="icon-edit"></i> {% trans %}Register{% endtrans %}</a></li>{% endif %}
        </ul>
        {% endif %}
        {% endif %}
      </div>
    </div>
  </div>

  {% block container %}
  <div class="container container-primary">
    {{ messages_list(messages) }}
    
    {% block content %}
    {% endblock %}
  </div>
  {% endblock %}

</div><!--/#wrap -->

<footer>
  <div class="container">
    <ul class="breadcrumb">
      {% block breadcrumb %}<li class="first"><a href="{% url 'index' %}">{{ settings.board_name }}</a>{% endblock %}</li>
      <li class="pull-right"><i class="icon-move"></i> <a href="{% url 'forum_map' %}">{% trans %}Forum Map{% endtrans %}</a></li>
    </ul>
    <hr>
    <div class="credits">
      <p>
        {% if settings.board_credits %}
        {{ settings.board_credits|safe }}<br>
        {% endif %}
        <a href="http://misago-project.org">This community is powered by Misago forum software by Rafał Pitoń</a>
      </p>
    </div>
  </div>
</footer>{% endblock %}
