{#
# GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011 MediaGoblin contributors.  See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-#}
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>{% block title %}{{ app_config['html_title'] }}{% endblock %}</title>
    <link rel="stylesheet" type="text/css"
          href="{{ request.staticdirect('/css/extlib/reset.css') }}"/>
    <link rel="stylesheet" type="text/css"
          href="{{ request.staticdirect('/css/extlib/text.css') }}"/>
    <link rel="stylesheet" type="text/css"
          href="{{ request.staticdirect('/css/extlib/960_16_col.css') }}"/>
    <link rel="stylesheet" type="text/css"
          href="{{ request.staticdirect('/css/base.css') }}"/>
    <link rel="stylesheet" type="text/css"
          href="{{ request.staticdirect('/css/video-js.css') }}"/>
    <link rel="shortcut icon"
          href="{{ request.staticdirect('/images/goblin.ico') }}" />
    {% block mediagoblin_head %}
    {% endblock mediagoblin_head %}
  </head>

  <body>
    {% block mediagoblin_body %}
    <div class="mediagoblin_body">
      {% block mediagoblin_header %}
        <div class="container_16">
          <div class="grid_16 mediagoblin_header">
            {% block mediagoblin_logo %}
              <a class="mediagoblin_logo"
                 href="{{ request.urlgen('index') }}"
                 ><img src="{{ request.staticdirect('/images/logo.png') }}"
                     alt="{% trans %}MediaGoblin logo{% endtrans %}" /></a>
            {% endblock %}
            {% if request.user and request.user.status == 'active' %}
              <a class="button_action"
                 href="{{ request.urlgen('mediagoblin.submit.start') }}">
                {% trans %}Submit media{% endtrans %}
              </a>
            {% endif %}
            {% block mediagoblin_header_title %}{% endblock %}
            <div class="mediagoblin_header_right">
              {% if request.user %}
                {# the following link should only appear when verification is needed #}
                {% if request.user.status == "needs_email_verification" %}
                  <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
                                              user=request.user.username) }}"
                     class="button_action_highlight">
                    {% trans %}Verify your email!{% endtrans %}</a>
                {% endif %}

                <a href="{{ request.urlgen('mediagoblin.user_pages.user_home',
                                            user= request.user.username) }}">
                  {{ request.user.username }}</a>

                (<a href="{{ request.urlgen('mediagoblin.auth.logout') }}">{% trans %}log out{% endtrans %}</a>)
              {% else %}
                <a href="{{ request.urlgen('mediagoblin.auth.login') }}">
                  {% trans %}Log in{% endtrans %}</a>
              {% endif %}
            </div>
          </div>
        </div>
      {% endblock %}
      <div class="container_16 mediagoblin_content">
        <div class="grid_16">
          {% include "mediagoblin/utils/messages.html" %}
          {% block mediagoblin_content %}
          {% endblock mediagoblin_content %}
        </div>
      </div>
      {% block mediagoblin_footer %}
        <div class="container_16">
          <div class="grid_16 mediagoblin_footer">
            {% trans -%}
              Powered by <a href="http://mediagoblin.org">MediaGoblin</a>, a <a href="http://gnu.org/">GNU</a> project
            {%- endtrans %}
          </div>
        </div>
      {% endblock %}
    {% endblock mediagoblin_body %}
    </div>
  </body>
</html>
