{% load i18n %}
{% load static %}
{% load translations %}
{% load compress %}

{% if not request.is_ajax %}
<!DOCTYPE html>

<html lang="{{ LANGUAGE_CODE }}" dir="{% if LANGUAGE_BIDI %}rtl{% else %}ltr{% endif %}">
 <head>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="referrer" content="origin" />
  <meta name="author" content="Michal Čihař" />
  <meta name="copyright" content="Copyright &copy; 2003 - {{ current_year }} Michal Čihař" />
  {% if not allow_index %}<meta name="robots" content="noindex,nofollow" />{% endif %}

  <title>{% include "title.html" %}</title>
  <meta name="description" content="{{ description }}" />

{% compress css %}
  <link rel="stylesheet" type="text/css" href="{% static 'bootstrap/css/bootstrap.css' %}" />
{% if LANGUAGE_BIDI %}
  <link rel="stylesheet" type="text/css" href="{% static 'bootstrap/css/bootstrap-rtl.css' %}" />
{% endif %}
  <link rel="stylesheet" type="text/css" href="{% static 'bootstrap/css/bootstrap-theme.css' %}" />
  <link rel="stylesheet" type="text/css" href="{% static 'bootstrap/css/bootstrap-datepicker3.css' %}" />
  <link rel="stylesheet" type="text/css" href="{% static 'font-awesome/css/font-awesome.css' %}" />
  <link rel="stylesheet" type="text/css" href="{% static 'font-linux/font-linux.css' %}" />
  <link rel="stylesheet" type="text/css" href="{% static 'chartist.css' %}" />
  <link rel="stylesheet" type="text/css" href="{% static 'multi-select.css' %}" />
  <link rel="stylesheet" type="text/css" href="{% static 'style-bootstrap.css' %}" />
{% endcompress %}
  <script src="{% url 'js-catalog' %}" type="text/javascript"></script>
{% compress js %}
{% if rollbar_token %}
<script>
var _rollbarConfig = {
    accessToken: "{{ rollbar_token }}",
    captureUncaught: true,
    ignoredMessages: ["__gCrWeb"],
    captureUnhandledRejections: false,
    payload: {
        environment: "{{ rollbar_environment }}"
    },
    checkIgnore: function(isUncaught, args, payload) {
        if (window.navigator.userAgent && (window.navigator.userAgent.indexOf('Baiduspider') !== -1 || window.navigator.userAgent.indexOf('Seznam screenshot-generator') !== -1)) {
            // ignore javascript errors from spiders with know javascript problems
            return true;
        }
        // no other ignores
        return false;
    }
};
// Rollbar Snippet
!function(r){function e(n){if(o[n])return o[n].exports;var t=o[n]={exports:{},id:n,loaded:!1};return r[n].call(t.exports,t,t.exports,e),t.loaded=!0,t.exports}var o={};return e.m=r,e.c=o,e.p="",e(0)}([function(r,e,o){"use strict";var n=o(1).Rollbar,t=o(2);_rollbarConfig.rollbarJsUrl=_rollbarConfig.rollbarJsUrl||"https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/1.9.4/rollbar.nojson.min.js";var a=n.init(window,_rollbarConfig),i=t(a,_rollbarConfig);a.loadFull(window,document,!_rollbarConfig.async,_rollbarConfig,i)},function(r,e){"use strict";function o(r){return function(){try{return r.apply(this,arguments)}catch(r){try{console.error("[Rollbar]: Internal error",r)}catch(r){}}}}function n(r,e,o){window._rollbarWrappedError&&(o[4]||(o[4]=window._rollbarWrappedError),o[5]||(o[5]=window._rollbarWrappedError._rollbarContext),window._rollbarWrappedError=null),r.uncaughtError.apply(r,o),e&&e.apply(window,o)}function t(r){var e=function(){var e=Array.prototype.slice.call(arguments,0);n(r,r._rollbarOldOnError,e)};return e.belongsToShim=!0,e}function a(r){this.shimId=++c,this.notifier=null,this.parentShim=r,this._rollbarOldOnError=null}function i(r){var e=a;return o(function(){if(this.notifier)return this.notifier[r].apply(this.notifier,arguments);var o=this,n="scope"===r;n&&(o=new e(this));var t=Array.prototype.slice.call(arguments,0),a={shim:o,method:r,args:t,ts:new Date};return window._rollbarShimQueue.push(a),n?o:void 0})}function l(r,e){if(e.hasOwnProperty&&e.hasOwnProperty("addEventListener")){var o=e.addEventListener;e.addEventListener=function(e,n,t){o.call(this,e,r.wrap(n),t)};var n=e.removeEventListener;e.removeEventListener=function(r,e,o){n.call(this,r,e&&e._wrapped?e._wrapped:e,o)}}}var c=0;a.init=function(r,e){var n=e.globalAlias||"Rollbar";if("object"==typeof r[n])return r[n];r._rollbarShimQueue=[],r._rollbarWrappedError=null,e=e||{};var i=new a;return o(function(){if(i.configure(e),e.captureUncaught){i._rollbarOldOnError=r.onerror,r.onerror=t(i);var o,a,c="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(o=0;o<c.length;++o)a=c[o],r[a]&&r[a].prototype&&l(i,r[a].prototype)}return e.captureUnhandledRejections&&(i._unhandledRejectionHandler=function(r){var e=r.reason,o=r.promise,n=r.detail;!e&&n&&(e=n.reason,o=n.promise),i.unhandledRejection(e,o)},r.addEventListener("unhandledrejection",i._unhandledRejectionHandler)),r[n]=i,i})()},a.prototype.loadFull=function(r,e,n,t,a){var i=function(){var e;if(void 0===r._rollbarPayloadQueue){var o,n,t,i;for(e=new Error("rollbar.js did not load");o=r._rollbarShimQueue.shift();)for(t=o.args,i=0;i<t.length;++i)if(n=t[i],"function"==typeof n){n(e);break}}"function"==typeof a&&a(e)},l=!1,c=e.createElement("script"),p=e.getElementsByTagName("script")[0],s=p.parentNode;c.crossOrigin="",c.src=t.rollbarJsUrl,c.async=!n,c.onload=c.onreadystatechange=o(function(){if(!(l||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){c.onload=c.onreadystatechange=null;try{s.removeChild(c)}catch(r){}l=!0,i()}}),s.insertBefore(c,p)},a.prototype.wrap=function(r,e){try{var o;if(o="function"==typeof e?e:function(){return e||{}},"function"!=typeof r)return r;if(r._isWrap)return r;if(!r._wrapped){r._wrapped=function(){try{return r.apply(this,arguments)}catch(e){throw"string"==typeof e&&(e=new String(e)),e._rollbarContext=o()||{},e._rollbarContext._wrappedSource=r.toString(),window._rollbarWrappedError=e,e}},r._wrapped._isWrap=!0;for(var n in r)r.hasOwnProperty(n)&&(r._wrapped[n]=r[n])}return r._wrapped}catch(e){return r}};for(var p="log,debug,info,warn,warning,error,critical,global,configure,scope,uncaughtError,unhandledRejection".split(","),s=0;s<p.length;++s)a.prototype[p[s]]=i(p[s]);r.exports={Rollbar:a,_rollbarWindowOnError:n}},function(r,e){"use strict";r.exports=function(r,e){return function(o){if(!o&&!window._rollbarInitialized){var n=window.RollbarNotifier,t=e||{},a=t.globalAlias||"Rollbar",i=window.Rollbar.init(t,r);i._processShimQueue(window._rollbarShimQueue||[]),window[a]=i,window._rollbarInitialized=!0,n.processPayloads()}}}}]);
// End Rollbar Snippet
</script>
{% endif %}
  <script src="{% static 'js/jquery-1.12.4.js' %}" type="text/javascript"></script>
  <script src="{% static 'js/js.cookie.js' %}" type="text/javascript"></script>
  <script src="{% static 'js/autosize.js' %}" type="text/javascript"></script>
  <script src="{% static 'js/jquery.sortElements.js' %}" type="text/javascript"></script>
  <script src="{% static 'js/jquery.multi-select.js' %}" type="text/javascript"></script>
  <script src="{% static 'js/mousetrap.js' %}" type="text/javascript"></script>
  <script src="{% static 'js/mousetrap-global-bind.js' %}" type="text/javascript"></script>
  <script src="{% static 'js/chartist.js' %}" type="text/javascript"></script>
  <script src="{% static 'bootstrap/js/bootstrap.js' %}" type="text/javascript"></script>
  <script src="{% static 'loader-bootstrap.js' %}" type="text/javascript"></script>
  <script src="{% static 'bootstrap/js/bootstrap-datepicker.js' %}" type="text/javascript"></script>
{% endcompress %}
  <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />

  <link rel="icon" href="/favicon.ico" type="image/x-icon" />
  <link rel="image_src" type="image/png" href="{% static 'weblate-128.png' %}"/>
  <link rel="apple-touch-icon" href="{% static 'weblate-128.png' %}"/>
  <meta name="robots" content="index, follow" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <meta property="og:site_name" content="{% if site_title %}{{ site_title }}{% else %}Weblate{% endif %}" />
  <meta property="og:title" content="{% if title %}{{ title }}{% else %}{% if object %}{{ object }}{% else %}{% if page_profile %}{{ page_profile.get_user_name }}{% else %}{% if site_title %}{{ site_title }}{% else %}Weblate{% endif %}{% endif %}{% endif %}{% endif %}" />
  <meta property="og:description" content="{{ description }}" />

{% block extra_meta %}
{% endblock %}

 </head>

 <body {% if LANGUAGE_BIDI %}class="dir-rtl"{% endif %}>
 <header>
<nav class="navbar navbar-default navbar-static-top navbar-inverse" role="navigation">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#wl-navbar-main" id="navbar-toggle">
        <span class="sr-only">{% trans "Toggle navigation" %}</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="{% url 'home' %}"><img class="avatar" src="{% static 'weblate-128.png' %}" /> {{ site_title }}</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="wl-navbar-main">
      <ul class="nav navbar-nav">
        <li><a href="{% url 'home' %}">{% trans "Dashboard" %}</a></li>
        {% if subscribed_projects %}
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">{% trans "Watched projects" %}<b class="caret"></b></a>
          <ul class="dropdown-menu">
            {% for project in subscribed_projects %}
            <li><a href="{{ project.get_absolute_url }}">{{ project }}</a></li>
            {% endfor %}
            <li role="separator" class="divider"></li>
            <li><a href="{% url 'profile' %}#subscriptions">{% trans "Manage watched projects" %}</a></li>
          </ul>
        </li>
        {% endif %}
        <li><a href="{% documentation 'index' %}">{% trans "Documentation" %}</a></li>
      </ul>
      <ul class="nav navbar-nav navbar-right flip">
        {% if user.is_authenticated %}
        <li><a class="button" id="profile-button" href="{% url 'profile' %}" title="{% trans "Your profile" %}">{{ user.profile.get_user_display }}</a></li>
        {% if user.is_staff %}
        <li><a class="button" id="admin-button" href="{% url 'admin:index' %}" title="{% trans "Administration" %}"><i class="fa fa-wrench"></i></a></li>
        {% endif %}
        <li><a class="button link-post" id="logout-button" href="{% url 'logout' %}" title="{% trans "Logout" %}"><i class="fa fa-sign-out"></i></a></li>
        {% else %}
        {% if registration_open %}
        <li><a class="button" id="register-button" href="{% url 'register' %}">{% trans "Register" %}</a></li>
        {% endif %}
        <li><a class="button" id="login-button" href="{% url 'login' %}{% if not skip_next %}?next={{ login_redirect_url|urlencode }}{% endif %}">{% trans "Login" %}</a></li>
        {% endif %}
      </ul>
    </div>
  </div>
</nav>
{% block breadcrumbs_container %}
<h1>
<ol class="breadcrumb">
{% block breadcrumbs %}
<li><a href="{% url 'home' %}">{% trans "Dashboard" %}</a></li>
{% endblock %}
</ol>
</h1>
{% endblock %}
</header>

<div class="content">
<!--[if lte IE 8]>
{% show_message "error" _('Weblate does not support Microsoft Internet Explorer 8 and older, please use some more recent browser like <a href="https://www.mozilla.org/firefox/">Firefox</a>.') %}
<![endif]-->
{% if messages %}
{% for message in messages %}
{% show_message message.tags message %}
{% endfor %}
{% endif %}

{% endif %}

{% block content %}
{% endblock %}

{% if not request.is_ajax %}
</div>
<form id="link-post" method="POST">
{% csrf_token %}
</form>
<!-- Creates the bootstrap modal where the image will appear -->
<div class="modal fade fullmodal" id="imagemodal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">{% trans "Close" %}</span></button>
        <h4 class="modal-title" id="myModalLabel"></h4>
      </div>
      <div class="modal-body">
        <img src="" id="imagepreview" class="img-responsive">
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">{% trans "Close" %}</button>
      </div>
    </div>
  </div>
</div>
{% include 'footer.html' %}
 </body>
</html>
{% endif %}
