<!DOCTYPE html>
{% load i18n %}
{% load telemeta_tags %}
{% load bootstrap3 %}
{% settings_value 'INSTALLED_APPS' as INSTALLED_APPS %}
{% if 'googletools' in INSTALLED_APPS %}
{% load googletools %}
{% endif %}

{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_current_language_bidi as LANGUAGE_BIDI %}

<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>

<head>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />

{% block analytics %}
{% if 'googletools' in INSTALLED_APPS %}
{% site_verification_code %}
{% analytics_code %}
{% endif %}
{% endblock analytics %}

<link rel="alternate" href="/rss" title="RSS 2.0" type="application/rss+xml" />
<link rel="icon" href="{{ STATIC_URL }}telemeta/images/favicon.ico"/>

<title>{%block head_title %}{% organization %} - {% description %}{% endblock %}</title>

{% block stylesheets %}
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}telemeta/css/telemeta.css" />
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}telemeta/css/bootstrap.css" />

<!--[if IE]>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}telemeta/css/telemeta_ie.css" />
<![endif]-->
<!--[if lte IE 6]>
<link rel="stylesheet"type="text/css" href="{{ STATIC_URL }}telemeta/css/telemeta_ie6.css" />
<![endif]-->
{% endblock %}

{% block extra_stylesheets %}{% endblock %}

{% block javascript %}
<script src="{% url "django.views.i18n.javascript_catalog" %}" type="text/javascript"></script>
<script src="{{ STATIC_URL }}jquery/dist/jquery.min.js" type="text/javascript"></script>
<script src="{{ STATIC_URL }}telemeta/js/locale.js" type="text/javascript"></script>
<script src="{{ STATIC_URL }}telemeta/js/application.js" type="text/javascript"></script>
<script src="{{ STATIC_URL }}bootstrap/dist/js/bootstrap.min.js" type="text/javascript"></script>

{% if user.is_authenticated %}
<script type='text/javascript'>var CURRENT_USER_NAME="{{ user.username }}";</script>
{% else %}
<script type='text/javascript'>var CURRENT_USER_NAME=undefined;</script>
{% endif %}
{% endblock %}

{% block extra_javascript %}{% endblock %}
</head>

<body>
{% block layout %}
<div id="layout">
{% block header %}
<div id="header">
<div id="logo">
{% block logo %}
<a href="{% url "telemeta-home" %}"><img src="{% logo_url %}" alt="Telemeta" /></a>
{% endblock %}
</div>

<div id="auth_info"  {% if LANGUAGE_BIDI %}style="left : 1.1em;"{% else %}style="right : 1.1em;"{% endif %}>
{% if user.is_authenticated %}
<img src="{{ STATIC_URL }}telemeta/images/user.png" alt="user" style="vertical-align:middle" />
{% trans "Welcome" %},
<a href="{% url "telemeta-profile-detail" user.username %}">
{% if user.first_name or user.last_name %}
{{ user.first_name }} {{ user.last_name }}</a> |
{% else %}
  {{ user.username }}
{% endif %}
<a href="{% url "telemeta-flatpage" "help" %}">{% trans "Help" %}</a> |
<a href="{% url "telemeta-logout" %}">{% trans "Sign out" %}
<img src="{{ STATIC_URL }}telemeta/images/logout.png" alt="logout" style="vertical-align:middle" /></a>
{% else %}
<a href="{% url "telemeta-flatpage" "help" %}">{% trans "Help" %}</a> |
<a href="{% url "telemeta-login" %}">{% trans "Sign in" %}</a>
{% endif %}
</div>

{% block search %}
<div id="quick_search">
<form action="{% url "haystack_search" %}" id="_quickSearchForm" method="get">
    <div class="input-group">
       <input class="form-control" id="id_q" name="q" type="text" /><span class="input-group-btn"><button type="submit" id="btn" class="btn btn-default"><span class="glyphicon glyphicon-search"></span></button></span>
    </div>
</form>
</div>
{% endblock search %}

<div id="menu">
{% block menu %}

{# spaces between li and a elements breaks layout #}

<ul id="nav">
 {% if user.is_authenticated %}
  <li><a href="{% url "telemeta-desk-lists" %}" class="blue">{% trans "Desk" %}</a></li>
 {% else %}
  <li><a href="{% url "telemeta-home" %}" class="blue">{% trans "Home" %}</a></li>
 {% endif %}

 <li><a href="#archives#" class="green">{% trans "Archives" %}</a>
  <ul>
    <li><a href="{% url "telemeta-resource-list" "fonds" %}">{% trans "Fonds" %}</a></li>
    <li><a href="{% url "telemeta-resource-list" "corpus" %}">{% trans "Corpus" %}</a></li>
    <li><a href="{% url "telemeta-collections" %}">{% trans "Collections" %}</a></li>
    <li><a href="{% url "telemeta-items" %}">{% trans "Items" %}</a></li>
  </ul>
 </li>

 <li><a href="{% url "telemeta-geo-continents" %}" class="yellow">{% trans "Geo Navigator" %}</a></li>

 <li><a href="{% url "haystack_advance_search" %}" class="orange">{% trans "Advanced search" %}</a></li>
 {% if user.is_authenticated %}
  {% if user.is_staff or not perms.telemeta.can_not_view_users_and_profiles %}
  <li><a href="{% url "telemeta-users" %}" class="red">{% trans "Users" %}</a></li>
  {% endif %}
 {% endif %}
 {% if user.is_staff %}
 <li><a href="#admin#" class="violet">{% trans "Admin" %}</a>
 <ul>
 <li><a href="{% url "telemeta-home" %}admin/django/" target="_blank">{% trans "General" context "admin" %}</a></li>
 <li><a href="{% url "telemeta-admin-enumerations" %}">{% trans "Enumerations" %}</a></li>
 <li><a href="{% url "telemeta-instrument-edit" %}">{% trans "Instruments" %}</a></li>
 <li><a href="{% url "telemeta-instrument-alias-edit" %}">{% trans "Instrument aliases" %}</a></li>
 </ul>
 </li>
{% endif %}
</ul>

{% endblock menu %}
</div>
</div>
{% endblock header %}

{% block postman_menu %}
{% endblock postman_menu %}

{% if breadcrumbs %}
<ul class="breadcrumbs">
  <li><a href="#">Home</a></li>
  <li><a href="#">Features</a></li>
  <li class="unavailable"><a href="#">Gene Splicing</a></li>
  <li class="current"><a href="#">Cloning</a></li>
</ul>
{% endif %}

<div id="content">
    <table id="content_header"><tr>
            <td class="leftcol"><h1>{% block title %}{% endblock %}</h1></td>
            {% block rightcol %}
            <td class="rightcol" {% if LANGUAGE_BIDI %}style="float : left;"{% else %}style="float : right;"{% endif %}>{% block title_buttons %}{% endblock %}</td>
            {% endblock rightcol %}
    </tr></table>

  {% block content %}{% endblock %}
  {% block delete %}{% endblock %}

</div>

{% block body %}
{% endblock body %}

{% block footer %}
<div id="footer">
 <hr>
 <div class="row" style="margin-left: 0; margin-right: 0;">
  <div class="col-md-2">
    <a id="telemeta_powered" href="{% telemeta_url %}" target="_blank"><img src="{{ STATIC_URL }}telemeta/images/logo_mini_2.png"
   alt="Telemeta Powered"/></a>
   <span style="font-weight: bold;"><br />&nbsp;v{% telemeta_version %}</span>
  </div>
  <div class="col-md-8" style="margin-top: 8px;">
    <center>
    {% trans "Usage of the archives in the respect of cultural heritage of the original communities." %}
    </center>
  </div>
  <div class="col-md-2" style="text-align: right;">
    Copyright &copy; {% current_year %} {% organization %}<br>
    <a href="{% url "telemeta-flatpage" "legal_notices" %}">{% trans "Legal notices" %}</a>
  </div>
 </div>
</div>
{% endblock %}
</div>
{% endblock layout %}

</body>
</html>
