{% load i18n cms_tags menu_tags leprikon_tags sekizai_tags staticfiles ganalytics %}
<!DOCTYPE html>
<html lang="cs-CZ">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->

    <title>
        {% block title %}{% endblock %} {% include 'leprikon/title.txt' %}
    </title>

    <!-- Bootstrap -->
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"/>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
        <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
        <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Stylesheet -->
    <link rel="stylesheet" type="text/css" media="all" href="{% static 'leprikon/css/layout.css' %}?0"/>
    <link rel="stylesheet" type="text/css" media="all" href="{% static 'leprikon/css/colors.css' %}"/>
    {% render_block "css" %}

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.2/jquery.min.js" integrity="sha384-o6l2EXLcx4A+q7ls2O2OP2Lb2W7iBgOsYvuuRI6G+Efbjbk6J4xbirJpHZZoHbfs" crossorigin="anonymous"></script>

    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>

    <!-- Shortcut icon -->
    <link rel="shortcut icon" href="{% static 'leprikon/img/favicon.ico' %}" />

    {% if backends %}
    <!-- Bootstrap social -->
    <link rel="stylesheet" type="text/css" media="all" href="{% static 'font-awesome/css/font-awesome.min.css' %}"/>
    <link rel="stylesheet" type="text/css" media="all" href="{% static 'bootstrap-social/bootstrap-social.css' %}"/>
    {% endif %}
</head>

<body>
{% cms_toolbar %}
    <div id="header">
        <div class="container">
            <div class="col-sm-9">
                {% include 'leprikon/brand.html' %}
            </div>
            <div class="col-sm-3">
                {% school_year_form %}
                {% if request.user.is_authenticated %}
                <div class="dropdown">
                    <button class="btn btn-default dropdown-toggle" type="button" id="user_menu" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
                        {{ request.user.get_full_name | default:request.user.get_username }}
                        <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu" aria-labelledby="user_menu">
                        <li><a href="{% url_with_back 'leprikon:user_update' %}">{% trans 'Edit' %}</a></li>
                        <li><a href="{% url_with_back 'leprikon:user_password' %}">{% trans 'Change password' %}</a></li>
                        <li><a href="{% url_with_back 'leprikon:user_logout' %}">{% trans 'Log out' %}</a></li>
                        {% if 'google-plus' in backends.not_associated %}
                        <li>
                            <a class="btn btn-social btn-google-plus" href="{% url 'social:begin' 'google-plus' %}?next={{ next }}">
                                &nbsp;&nbsp; <i class="fa fa-google-plus pull-left"></i>
                                propojit s&nbsp;Google+
                            </a>
                        </li>
                        {% endif %}
                        {% if 'facebook' in backends.not_associated %}
                        <li>
                            <a class="btn btn-social btn-facebook" href="{% url 'social:begin' 'facebook' %}?next={{ next }}">
                                &nbsp;&nbsp; <i class="fa fa-facebook pull-left"></i>
                                propojit s&nbsp;Facebookem
                            </a>
                        </li>
                        {% endif %}
                    </ul>
                </div>
                {% endif %}
            </div>
        </div>
    </div>

    <div id="body">
        <div class="container">
            <div class="row">
                <div class="col-sm-9" id="content">
                    {% if messages %}
                    <div class="modal fade" id="messages" tabindex="-1" role="dialog">
                        <div class="modal-dialog modal-lg" role="document">
                            <div class="modal-content">
                                <div class="modal-body">
                                    {% for message in messages %}
                                    <div class="alert alert-{% if message.level_tag == 'error' %}danger{% else %}{{ message.level_tag }}{% endif %}" role="alert">
                                        <span class="glyphicon glyphicon-{% if message.level_tag == 'error' %}exclamation{% else %}{{ message.level_tag }}{% endif %}-sign" aria-hidden="true"></span>
                                        {{ message }}
                                    </div>
                                    {% endfor %}
                                </div>
                                <div class="modal-footer">
                                    <button type="button" class="btn btn-success" data-dismiss="modal">{% trans 'OK' %}</button>
                                </div>
                            </div>
                        </div>
                    </div>
                    <script type="text/javascript">
                        $('#messages').modal({
                            backdrop: 'static',
                        });
                    </script>
                    {% endif %}
                    {% block content %}{% endblock %}
                </div>
                <div class="col-sm-3" id="sidebar">
                    <nav class="list-group">
                        {% show_menu_below_id 'leprikon' 0 100 0 1 'leprikon/menu.html' %}
                    </nav>
                    {% if request.user.is_authenticated %}
                    <form action="{% url 'leprikon:support' %}" method="post" class="form-horizontal">{% csrf_token %}
                        <input type="hidden" name="{% param_back %}" value="{% current_url %}"/>
                        <div class="box">
                            <div class="box-header">
                                <label for="id_question">{% trans 'Help needed?' %}</label>
                            </div>
                            <div class="box-content">
                                <textarea class="form-control" id="id_question" name="question" rows="3"></textarea>
                                <button class="btn btn-primary btn-xs" type="submit">{% trans 'send question or suggestion' %}</button>
                            </div>
                        </div>
                    </form>
                    {% endif %}
                </div>
            </div>
        </div>

        <a id="leprikon" href="https://leprikon.cz" target="_blank" title="{% trans 'Powered by Leprikón Information System' %}"><span>{% trans 'Powered by Leprikón Information System' %}</span></a>
    </div>

    {% render_block "js" %}

</body>
</html>
