base.html 4.83 KB
Newer Older
Gabriel Detraz's avatar
Gabriel Detraz committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
{% load staticfiles %}

{# Load the tag library #}
{% load bootstrap3 %}

<!DOCTYPE html>
<html lang="fr">
    <head>
        {# Load CSS and JavaScript #}
        {% bootstrap_css %}
        <link rel="stylesheet" href="{% static "/static/css/base.css" %}">

        {% bootstrap_javascript %}
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <title>{{ site_name }} : {% block title %}Accueil{% endblock %}</title>
    </head>

    <body>
        <div id="wrap">
            <nav class="navbar navbar-inverse">
                <div class="container-fluid">
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="/">{{ site_name }}</a>
                    </div>
                    <div class="collapse navbar-collapse" id="myNavbar">
                        <ul class="nav navbar-nav">
                            <li><a href="{% url "users:mon-profil" %}">Mon profil</a></li>
33
                            <li><a href="{% url "panier:index" %}">Les commandes</a></li>
Gabriel Detraz's avatar
Gabriel Detraz committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
                            {% if is_cableur %}
                            <li><a href="{% url "users:index" %}">Gérer les utilisateurs</a></li>
                            {% endif %}
                        </ul>
                        <div class="col-sm-3 col-md-3 navbar-right">
                                {% csrf_token %}
                                <div class="input-group">
                                    <input type="text" class="form-control" placeholder="Search" name="search_field" id="search-term">
                                    <div class="input-group-btn">
                                        <button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <ul class="nav navbar-nav navbar-right">
                            <li>
                                {% if request.user.is_authenticated %}
                                <a href="{% url 'logout' %}">
                                    <span class="glyphicon glyphicon-log-out"></span> Logout
                                </a>
                                {% else %}
                                <a href="{% url 'login' %}">
                                    <span class="glyphicon glyphicon-log-in"></span> Login
                                </a>
                                {% endif %}
                            </li>
                        </ul>
                    </div>
                </div>
            </nav>

            <div id="main" class="container-fluid text-center">
                <div class="row content">
                    <div class="col-sm-2 sidenav">
                        {% block sidebar %}
                        {% endblock %}
                    </div>
                    <div class="col-sm-8 text-left">
                        {# Display django.contrib.messages as Bootstrap alerts #}
                        {% bootstrap_messages %}

                        <hr>

                        {% block content %}{% endblock %}
                    </div>
                    <div class="col-sm-2 sidenav">
                        <div class="well">
                            {% if request_user.is_authenticated %}
                            <li>{{ request_user.name }} {{ request_user.surname }}</li>
                            <li>Pseudo : {{ request_user.pseudo }}</li>
                            {% if list_droits %}
                            <li>Droits : {% for droit in list_droits %}{{ droit.right }}{% if list_droits|length != forloop.counter %}  - {% endif %} {% endfor %}</li>
                            {% else %}
                            <li>Aucun</li>
                            {% endif %}
                            <p><a class="btn btn-success btn-sm" role="button"href="{% url "users:mon-profil" %}">Voir mon profil</a></p>
                            {% else %}
                            <p>Vous n'êtes pas authentifié</p>
                            {% endif %}
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <footer class="navbar">
            <div class="containerfluid text-center">
                <p>Re2o 2016 - Goulven Kermarec, Gabriel Détraz, Augustin Lemesle</p>
            </div>
        </footer>


        {# Read the documentation for more information #}
    </body>
</html>