<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <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="{{ url_for('bepasty.xstatic', name='font_awesome', filename='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" class="pb-3">
                <nav class="navbar navbar-expand-lg navbar-light bg-light" role="navigation">
                    <div class="container-fluid">
                        <!-- Brand and toggle get grouped for better mobile display -->
                        <a class="navbar-brand" href="{{ url_for('bepasty.index') }}">
                            {{ config.SITENAME }}
                            <span class="navbar-text small">
                                (Permissions:{% for permission, permission_icon in flaskg.icon_permissions %} <i class="fa fa-{{ permission_icon }}" title="{{ permission }}"></i>{% endfor %})
                            </span>
                        </a>
                        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarHeader" aria-controls="navbarHeader" aria-expanded="false" aria-label="Toggle navigation">
                            <span class="navbar-toggler-icon"></span>
                        </button>

                        <!-- Collect the nav links, forms, and other content for toggling -->
                        <div class="collapse navbar-collapse" id="navbarHeader">
                            <ul class="navbar-nav mr-auto">
                                <li class="nav-item">
                                    <a class="nav-link" href="https://bepasty-server.readthedocs.org/en/latest/">Documentation</a>
                                </li>
                                {% if may(LIST) %}
                                <li class="nav-item">
                                    <a class="nav-link" href="{{ url_for('bepasty.filelist') }}">List all Items</a>
                                </li>
                                {% endif %}
                            </ul>
                            {% if flaskg.logged_in %}
                            <form class="form-inline" role="form" method="post" action="{{ url_for('bepasty.logout') }}">
                                <div class="form-row">
                                    <div class="col">
                                        <input class="btn btn-outline-secondary" type="submit" value="Logout">
                                    </div>
                                </div>
                            </form>
                            {% else %}
                            <form class="form-inline" role="form" method="post" action="{{ url_for('bepasty.login') }}">
                                <div class="form-row">
                                    <div class="col">
                                        <input class="form-control" type="password" name="token" placeholder="Password" autofocus>
                                    </div>
                                    <div class="col">
                                        <button type="submit" class="btn btn-outline-secondary">Login</button>
                                    </div>
                                </div>
                            </form>
                            {% endif %}
                        </div><!-- /.navbar-collapse -->
                    </div><!-- /.container-fluid -->
                </nav>
            </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.bundle.min.js') }}" type="text/javascript"></script>
        {% block extra_script %}{% endblock %}
    </body>
</html>
