{% load staticfiles %}
{% load i18n %}

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>{% block title %} statusboard {% endblock %}</title>

        {% block style %}
        <link rel="stylesheet" href="{% static "statusboard/css/bootstrap.min.css" %}"/>
        <link rel="stylesheet" href="{% static "statusboard/css/statusboard.css" %}"/>
        {% endblock %}

        {% block bootstrap_theme %}
        <link rel="stylesheet" href="{% static "statusboard/css/bootstrap-theme.min.css" %}"/>
        {% endblock %}

        {% block script %}
        <script src="{% static "statusboard/js/jquery-3.1.1.min.js" %}"></script>
        <script src="{% static "statusboard/js/bootstrap.min.js" %}"></script>
        {% endblock %}
    </head>
    <body>
        {% block header %}
        <nav class="navbar navbar-inverse navbar-fixed-top">
            <div class="container">
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                        <span class="sr-only">{% trans 'Toggle navigation' %}</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    {% block branding %}
                    <a class="navbar-brand" href="{% url 'statusboard:index' %}">Django Status Board</a>
                    {% endblock %}
                </div>
                <div id="navbar" class="collapse navbar-collapse">
                    <ul class="nav navbar-nav">
                        <li><a href="{% url 'statusboard:incident:archive-index' %}">{% trans "Incident archive" %}</a></li>
                        {% if perms.statusboard.create_servicegroup or perms.statusboard.create_service or perms.statusboard.create_incident or perms.statusboard.create_maintenance %}
                        <li class="dropdown">
                            <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{% trans "Manage" %}<span class="caret"></a>
                            <ul class="dropdown-menu">
                                {% if perms.statusboard.create_incident %}
                                <li><a href="{% url 'statusboard:incident:create' %}">{% trans 'Create new incident' %}</a></li>
                                {% endif %}
                                {% if perms.statusboard.create_servicegroup %}
                                <li><a href="{% url 'statusboard:servicegroup:create' %}">{% trans 'Create new service group' %}</a></li>
                                {% endif %}
                                {% if perms.statusboard.create_service %}
                                <li><a href="{% url 'statusboard:service:create' %}">{% trans 'Create new service' %}</a></li>
                                {% endif %}
                                {% if perms.statusboard.create_maintenance %}
                                <li><a href="{% url 'statusboard:maintenance:create' %}">{% trans 'Create new maintenance' %}</a></li>
                                {% endif %}
                            </ul>
                        </li>
                        {% endif %}
                    </ul>
                    <ul class="nav navbar-nav navbar-right">
                        {% block userlinks %}
                        {% if user.is_authenticated %}
                        <li><a href="{% url 'statusboard:logout' %}">{% trans 'Sign out' %}</a></li>
                        {% else %}
                        <li><a href="{% url 'statusboard:login' %}">{% trans 'Sign in' %}</a></li>
                        {% endif %}
                        {% endblock %}
                    </ul>
                </div>
            </div>
        </nav>
        {% endblock %}

        {% block content %} {% endblock %}
        {% block footer %} {% endblock %}
    </body>
</html>
