base.html 6.73 KB
Newer Older
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 33 34 35 36
{% comment %}
Re2o est un logiciel d'administration développé initiallement au rezometz. Il
se veut agnostique au réseau considéré, de manière à être installable en
quelques clics.

Copyright © 2017  Gabriel Détraz
Copyright © 2017  Goulven Kermarec
Copyright © 2017  Augustin Lemesle

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
{% endcomment %}

{% load staticfiles %}

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

<!DOCTYPE html>
<html lang="fr">
    <head>
        {# Load CSS and JavaScript #}
        {% bootstrap_css %}

        {% bootstrap_javascript %}
Gabriel Detraz's avatar
Gabriel Detraz committed
37
        <link rel="stylesheet" href="{% static "/css/base.css" %}">
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
        <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>
Mediatek's avatar
Mediatek committed
57
                            {% if is_perm %}
58 59
                            <li><a href="{% url "users:index" %}">Utilisateurs</a></li>
                            {% endif %}
Mediatek's avatar
Mediatek committed
60
                            <li><a href="{% url "media:index" %}">Media</a></li>
Mediatek's avatar
Mediatek committed
61 62 63
                            {% if is_perm %}
                            <li><a href="{% url "logs:index" %}">Statistiques</a></li>
                            {% endif %}
64
                        </ul>
Mediatek's avatar
Mediatek committed
65 66 67 68 69 70 71 72 73 74 75 76
                        <div class="col-sm-3 col-md-3 navbar-right">
                            <form action="{% url "search:search"%}"  method="POST" class="navbar-form" role="search">
                                {% 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>
                                         <a href="{% url "search:searchp" %}" class="btn btn-default" role="button"><i class="glyphicon glyphicon-plus"></i></a>
                                    </div>
                                </div>
                             </form>
                        </div>
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 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
                        <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">
                        <div class="panel panel-default">
                            <div class="text-left list-group">
                            {% block sidebar %}
                            {% endblock %}
                            </div>
                        </div>
                    </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="panel panel-default">
                            {% if request_user.is_authenticated %}
                            <div class="panel-heading">
                                <h4>{{ request_user.name }} {{ request_user.surname }}</h4>
                            </div>
                            <table class="table">
                                <tr>
                                    <th scope="row">Pseudo</th>
                                    <td class="text-right">{{ request_user.pseudo }}</td>
                                </tr>
                                <tr>
                                    <th scope="row">Nom</th>
                                    <td class="text-right">{{ request_user.surname }}</td>
                                </tr>
                                <tr>
                                    <th scope="row">Prénom</th>
                                    <td class="text-right">{{ request_user.name }}</td>
                                </tr>
                           </table>
                            {% else %}
                            <p>Vous n'êtes pas authentifié</p>
                            {% endif %}
                        </div>
                   </div>
                </div>
            </div>
        </div>

        <footer class="navbar">
            <div class="containerfluid text-center">
Mediatek's avatar
Mediatek committed
143
                <p>Med 2017 - Gabriel Détraz (from Re2o 2016 - Détraz-Kermarec-Lemesle)</p>
144 145 146 147 148 149 150
            </div>
        </footer>


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