{# This template has header, footer and body #}
{% extends "base.html" %}
{% load i18n %}
{% load staticfiles %}

{% block body %}

<div id="top_wrapper" class="wrapper">

  <div class="top-bar">
      <div class="login-box">
        {% if request.user.is_anonymous %}
          <p>You are not logged in.</p>
          <a class="btn btn-sm btn-default" href="{% url "login" %}">{% trans "Login" %}</a>
        {% else %}
          <p>Hello, <span>{% firstof request.user.first_name request.user.username %}</span>.</p>
          <a class="btn btn-sm btn-default" href="{% url "logout" %}">{% trans "Logout" %}</a>
        {% endif %}
      </div>
  </div>

  <div id="header" class="header-wrapper">
    <a href="http://spilgames.com/" class="menu-heading"><img src="{% static "img/spilgames.png" %}" alt="Spil Games Logo"></a>
     <ul class="menu" id="navbar">

       <li>
         <a class="{% block home_selected %}{% endblock %}" href="/">
           {% trans "Home" %}
         </a>
       </li>

       <li>
         <a class="{% block upload_selected %}{% endblock %}" href="{% url "tictactoe.contest.views.upload" %}">
          {% trans "Upload" %}
         </a>
       </li>

       {% if not request.user.is_anonymous %}
       <li>
         <a class="{% block user_entries_selected %}{% endblock %}" href="{% url "tictactoe.contest.views.entries" uid=request.user.id %}">
          {% trans "My entries" %}
        </a>
       </li>
       {% endif %}

       <li>
         <a class="{% block all_entries_selected %}{% endblock %}" href="{% url "tictactoe.contest.views.entries" %}">
          {% trans "All entries" %}
         </a>
      </li>

       <li>
         <a class="{% block ranking_selected %}{% endblock %}" href="{% url "tictactoe.contest.views.ranking" %}">
          {% trans "Ranking table" %}
         </a>
       </li>

       <li>
         <a class="{% block rules_selected %}{% endblock %}" href="{% url "rules" %}">{% trans "Rules" %}</a>
       </li>
     </ul>
  </div>

  <div id="content" class="content-wrapper">
    {% if messages %}
    <ul class="messages">
      {% for message in messages %}
        <li{% if message.tags %} class="{{ message.tags }}"{% endif %}>
        {{ message }}
        </li>
      {% endfor %}
    </ul>
    {% endif %}

    {% block content %}{% endblock %}
  </div>

  {# Haha there is no footer #}
</div><!-- /top_wrapper -->

{% endblock body %}
