{% load staticfiles %}
<!DOCTYPE html>
<html lang="en">
<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>OneEvent - All your events !</title>

    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="{% static "OneEvent/OneEvent.css" %}" />

    <!-- HTML5 Shim and Respond.js 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/libs/html5shiv/3.7.0/html5shiv.js"></script>
        <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <!--[if lt IE 7]>
      <p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
    <![endif]-->
    <nav class="navbar navbar-default navbar-fixed-top" role="navigation"
        {% if navbar_color %}style="background-color:{{ navbar_color }}"{% endif %}>
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed"
                    data-toggle="collapse" data-target="#navbar-menu-entries">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <span class="navbar-brand">{{ site_brand|default:"OneEvent" }}</span>
                <span class="navbar-text" style="float:left">{% block navbar_header_text %}{% endblock %}</span>
            </div>
            <div class="collapse navbar-collapse" id="navbar-menu-entries">
                <ul class="nav navbar-nav">
                    <li>
                        <a href="{% url 'index' %}"
                            data-toggle="tooltip" data-placement="top" title="Home">
                            <span class="glyphicon glyphicon-home"></span>
                            <span class="hidden-sm hidden-md hidden-lg">Home</span>
                        </a>
                    </li>
                    {% if user.is_authenticated %}
                    <li>
                        <a href="{% url 'messages_list' %}"
                            data-toggle="tooltip" data-placement="top" title="Contact/Messages">
                            <span class="glyphicon glyphicon-comment"></span>
                            <span class="hidden-sm hidden-md hidden-lg">Contact/Messages</span>
                        </a>
                    </li>
                    {% endif %}
                </ul>

                {% block navbar_extra %}{% endblock %}

                <ul class="nav navbar-nav navbar-right">
                    {% if user.is_staff %}
                    <li>
                        <a href="{% url 'admin:index' %}"
                            data-toggle="tooltip" data-placement="top" title="Admin">
                            <span class="glyphicon glyphicon-cog"></span>
                            <span class="hidden-sm hidden-md hidden-lg">Admin</span>
                        </a>
                    </li>
                    {% endif %}

                    <li>
                    {% if user.is_authenticated %}
                        <a href="{% url 'logout' %}?next={% url 'index' %}"
                            data-toggle="tooltip" data-placement="top" title="Logout">
                            <span class="glyphicon glyphicon-log-out"></span>
                            <span class="hidden-sm hidden-md hidden-lg">Logout</span>
                        </a>
                    {% else %}
                        <a href="{% url 'login' %}?next={% url 'index' %}"
                            data-toggle="tooltip" data-placement="top" title="Login">
                            <span class="glyphicon glyphicon-log-in"></span>
                            <span class="">Login</span>
                        </a>
                    {% endif %}
                    </li>

                    {% if user.is_authenticated %}
                    <li>
                        <p class="navbar-text"> {{user.get_full_name}}</p>
                    </li>
                    {% endif %}
                </ul>
            </div>
        </div>
    </nav>

    <div class="container">

        <div id="messages-row" class="row">
            <!-- This is the template message that is cloned to create new messages from JS. -->
            <div class="alert alert-dismissible hidden" id="alert-template">
                <button type="button" class="close" data-dismiss="alert">
                    <span aria-hidden="true">&times;</span>
                    <span class="sr-only">Close</span>
                </button>
            </div>
        {% if messages %}
            {% for message in messages %}
            <div class="alert alert-{{message.tags}} alert-dismissible" role="alert">
                <span>{{message}}</span>
                <button type="button" class="close" data-dismiss="alert">
                    <span aria-hidden="true">&times;</span>
                    <span class="sr-only">Close</span>
                </button>
            </div>
            {% endfor %}
        {% endif %}
        </div>

        <div id="main-row" class="row">
            <div class="container-fluid">
            {% block page_heading %}
                <div class="row text-center bottom-separation"><h1>
                    <span class="label label-primary">{% block heading_action %}{% endblock %}</span>
                    {% block heading_title %}{% endblock %}
                </h1></div>
            {% endblock %}

            {% block content %}{% endblock %}
            </div>
        </div>
    </div>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

    <!-- Include custom JS -->
    <script src="{% static 'OneEvent/OneEvent.js' %}"></script>
</body>
</html>
