<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="">
        <meta name="author" content="">
        <!-- Favicon -->
        <link rel="icon" href="{{ url_for('static', filename='app/favicon.ico') }}" type="image/x-icon">

        <title>Bepasty</title>

        <!-- Bootstrap styles -->
        <link rel="stylesheet" href="{{ url_for('bepasty.xstatic', name='bootstrap', filename='css/bootstrap.min.css') }}" type="text/css">
        <!-- jQuery UI styles -->
        <link rel="stylesheet" href="{{ url_for('bepasty.xstatic', name='jquery_ui', filename='themes/smoothness/jquery-ui.css') }}" type="text/css">
        <!-- Font Awesome -->
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css">
        <!-- Bepasty styles -->
        <link rel="stylesheet" href="{{ url_for('static', filename='app/css/style.css' ) }}" type="text/css">
        {% block extra_link %}{% endblock %}
    </head>

    <body>
        <div id="wrapper">
            <!-- Begin header -->
            <div id="header">
                <div class="container">
                    <nav class="navbar navbar-default" 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="#navbar-collapse">
                                    <span class="sr-only">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_for('bepasty.index') }}">
                                    {{ config.SITENAME }} (Permissions: {% for permission, permission_icon in flaskg.icon_permissions %}<i class="fa fa-{{ permission_icon }}" title="{{ permission }}"></i>  {% endfor %})
                                </a>
                            </div>
                            <!-- Collect the nav links, forms, and other content for toggling -->
                            <div class="collapse navbar-collapse" id="navbar-collapse">
                                <ul class="nav navbar-nav">
                                    <li><a href="http://bepasty-server.readthedocs.org/en/latest/">Documentation</a></li>
                                    {% if may(LIST) %}
                                    <li><a href="{{ url_for('bepasty.filelist') }}">List all Items</a></li>
                                    {% endif %}
                                </ul>
                                {% if flaskg.logged_in %}
                                <form class="navbar-form navbar-right" role="form" method="post" action="{{ url_for('bepasty.logout') }}">
                                    <input class="btn btn-default" type="submit" value="Logout">
                                </form>
                                {% else %}
                                <form class="navbar-form navbar-right form-inline" role="form" method="post" action="{{ url_for('bepasty.login') }}">
                                    <div class="form-group">
                                        <input class="form-control" type="password" name="token" autofocus>
                                    </div>
                                    <button type="submit" class="btn btn-default">Login</button>
                                </form>
                                {% endif %}
                            </div><!-- /.navbar-collapse -->
                        </div><!-- /.container-fluid -->
                    </nav>
                </div>
            </div>
            <!-- /.header -->

            <!-- Begin page content -->
            <div class="container">
                {% block content %}{% endblock %}
            </div>
            <!-- /.container -->
        </div>
        <!-- /.wrapper -->

        <!-- Begin footer -->
        <div id="footer">
            <div class="container">
            </div>
        </div>
        <!-- /.footer -->

        <!-- jQuery -->
        <script src="{{ url_for('bepasty.xstatic', name='jquery', filename='jquery.min.js') }}" type="text/javascript"></script>
        <!-- jQuery UI -->
        <script src="{{ url_for('bepasty.xstatic', name='jquery_ui', filename='jquery-ui.min.js') }}" type="text/javascript"></script>
        <!-- Bootstrap -->
        <script src="{{ url_for('bepasty.xstatic', name='bootstrap', filename='js/bootstrap.min.js') }}" type="text/javascript"></script>
        {% block extra_script %}{% endblock %}
    </body>
</html>
