{% extends "djangovoice/container.html" %}
{% load user_name from djangovoice_tags %}
{% load trans from i18n %}

{% block sectionid %}feedback{% endblock %}

{% block script_base %}
  <link rel="alternate" type="application/rss+xml" title="{% trans "Latest feedback" %}" href="{% url feeds_latest %}" />
{% endblock %}

{% block body %}
  <header>
    <div class="navbar navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <a class="brand" href="{% url djangovoice_home %}">{{ site.name }} {% trans "Feedback" %}</a>
          <ul class="nav">
            {% block navigation %}
              <li><a href="{% url djangovoice_list 'all' %}">{% trans "All" %}</a></li>
              <li><a href="{% url djangovoice_list 'open' %}">{% trans "Open" %}</a></li>
              <li><a href="{% url djangovoice_list 'closed' %}">{% trans "Closed" %}</a></li>
              <li><a href="{% url djangovoice_list 'mine' %}">{% trans "Mine" %}</a></li>
              <li class="feed-link">
                <a href="{% url feeds_latest %}" title="{% trans "Subscribe to the feedback RSS feed" %}">
                  <img src="{{ STATIC_URL }}djangovoice/images/rss.png" alt="RSS" />
                </a>
              </li>
            {% endblock %}
          </ul>
          <ul class="nav pull-right">
            {% if user.is_authenticated %}
              <li class="dropdown">
                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                  {% user_name user %}
                  <b class="caret"></b>
                </a>
                <ul class="dropdown-menu">
                  <li>
                    <a href="/">{% trans "Back to mainpage" %}</a>
                  </li>
                  <li class="divider"></li>
                  <li>
                    <a href="{% url django.contrib.auth.views.logout %}?next={% url djangovoice_home %}">
                      {% trans "Sign out" %}
                    </a>
                  </li>
                </ul>
              </li>
            {% else %}
              <li>
                <a href="{% url django.contrib.auth.views.login %}?next={% url djangovoice_home %}">{% trans "Sign in" %}</a>
              </li>
            {% endif %}
          </ul>
        </div>
      </div>
    </div>
  </header>

  <div role="main">
    <div id="wrapper">
      <div class="container" id="actions">
        <ul>
          <li><a href="{% url djangovoice_submit %}">{% trans "Submit feedback" %}</a></li>
          {% block actions %}{% endblock %}
        </ul>
      </div>
    </div>
  </div>

  <div class="container">
    <div id="content">
      <div class="row">
        <div class="span9">
          <div id="feedback">
            {% for message in messages %}
              <div class="alert-message{% if message.tags %} {{ message.tags }}{% endif %}">
                <a class="close" href="#">×</a>
                <p>{{ message }}</p>
              </div>
            {% endfor %}

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

        <div class="span3">
          <div id="sidebar">
            {% block sidebar %}{% endblock %}
          </div>
        </div>
      </div>
    </div>
  </div>

  <footer>
    <div class="container">
      <p>
        <a href="https://github.com/alageek/django-voice">{% trans "Powered by django-voice" %}</a>
      </p>
    </div>
  </footer>
{% endblock %}
