Ce serveur Gitlab sera éteint le 30 juin 2020, pensez à migrer vos projets vers les serveurs gitlab-research.centralesupelec.fr et gitlab-student.centralesupelec.fr !

base.html 14.9 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
{% 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  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 %}

lhark's avatar
lhark committed
24 25 26 27
{% load staticfiles %}

{# Load the tag library #}
{% load bootstrap3 %}
28
{% load acl %}
29
{% load self_adhesion %}
30 31
{% load i18n %}

32
{% self_adhesion as var_sa %}
lhark's avatar
lhark committed
33 34
<!DOCTYPE html>
<html lang="fr">
35
    <head prefix="og: http://ogp.me/ns#">
36 37 38 39 40 41
        <meta property="og:title" content="Re2o" />
        <meta property="og:type" content="website" />
        <meta property="og:url" content="{{ request.scheme }}://{{ request.get_host }}/" />
        <meta property="og:image" content="{% static 'images/logo_re2o.svg' %}"/>
        <meta property="og:image:type" content="image/svg"/>
        <meta property="og:image:alt" content="The Re2o logo"/>
42 43
    	<meta property="og:description" content="{% trans "Networking managing website endorsed by FedeRez." %}" />
    	<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/all.js"></script>
lhark's avatar
lhark committed
44 45
        {# Load CSS and JavaScript #}
        {% bootstrap_css %}
46 47
        <link href="/static/css/typeaheadjs.css" rel="stylesheet">
        <link href="/static/css/bootstrap-tokenfield.css" rel="stylesheet">
lhark's avatar
lhark committed
48 49

        {% bootstrap_javascript %}
50 51 52 53 54
        <script src="/static/js/typeahead/typeahead.js"></script>
        <script src="/static/js/handlebars/handlebars.js"></script>
        <script src="/static/js/konami/konami.js"></script>
        <script src="/static/js/sapphire.js"> var s=Sapphire(); Konami(s.activate); </script>
        <script src="/static/js/bootstrap-tokenfield/bootstrap-tokenfield.js"></script>
55 56
        <script src="/static/js/shortcuts.js"></script>
        <link rel="stylesheet" href="{% static 'css/base.css' %}">
chirac's avatar
chirac committed
57
        <meta name="viewport" content="width=device-width, initial-scale=1">
58
        <link rel="shortcut icon" type="image/svg" href="{% static 'images/logo_re2o.svg' %}">
59
        <title>{{ name_website }} : {% block title %}{% trans "Home" %}{% endblock %}</title>
lhark's avatar
lhark committed
60 61 62
    </head>

    <body>
chirac's avatar
chirac committed
63 64 65 66 67 68 69 70 71
        <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>
72 73
                        <a class="navbar-brand" href="/">
                            <img src="{% static 'images/logo_re2o_navbar.svg' %}" height=32>
74
                            {{ name_website }}
75
                        </a>
chirac's avatar
chirac committed
76 77 78
                    </div>
                    <div class="collapse navbar-collapse" id="myNavbar">
                        <ul class="nav navbar-nav">
Pietri Yoann's avatar
Pietri Yoann committed
79 80
                            {% can_view_any_app users machines cotisations %}
                            <li class="dropdown">
81
				    <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-users"></i> {% trans "Users" %}<span class="caret"></span></a>
Pietri Yoann's avatar
Pietri Yoann committed
82 83
                                <ul class="dropdown-menu">
                                    {% can_view_app users %}
84 85
				    <li><a href="{% url 'users:index' %}"><i class="fa fa-user"></i> {% trans "Manage the users" %}</a></li>
				    <li><a href="{% url 'users:index-clubs' %}"><i class="fa fa-users"></i> {% trans "Manage the clubs" %}</a></li>
86
                                    {% acl_end %}                              
87
                                    {% can_view_app machines %}
88
				    <li><a href="{% url 'machines:index' %}"><i class="fa fa-desktop"></i> {% trans "Manage the machines" %}</a></li>
Pietri Yoann's avatar
Pietri Yoann committed
89 90
                                    {% acl_end %}
                                    {% can_view_app cotisations %}
91
				    <li><a href="{% url 'cotisations:index' %}"><i class="fa fa-dollar-sign"></i> {% trans "Manage the subscriptions" %}</a></li>
Pietri Yoann's avatar
Pietri Yoann committed
92 93 94
                                    {% acl_end %}
                                </ul>
                            </li>
95 96
                            {% acl_end %}
                            {% can_view_app topologie %}
97
                            <li class="dropdown">
98
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-sitemap"></i> {% trans "Topology" %}<span class="caret"></span></a>
99
                                <ul class="dropdown-menu">
100 101 102
					<li><a href="{% url "topologie:index" %}"><i class="fa fa-microchip"></i> {% trans "Switches" %}</a></li>
					<li><a href="{% url "topologie:index-ap" %}"><i class="fa fa-wifi"></i> {% trans "Access points" %}</a></li>
					<li><a href="{% url "topologie:index-room" %}"><i class="fa fa-home"></i> {% trans "Rooms" %}</a></li>
103 104
                                </ul>
                            </li>
105 106
                            {% acl_end %}
                            {% can_view_app logs %}
107
                            <li><a href="{% url "logs:index" %}"><i class="fa fa-chart-area"></i> {% trans "Statistics" %}</a></li>
108
                            {% acl_end %}
109 110 111
                            {% can_view_app preferences %}
                            <li>
                                <a href="{% url 'preferences:display-options' %}">
112
                                    <i class="fa fa-cogs"></i> {% trans "Administration" %}
113 114 115
                                </a>
                            </li>
                            {% acl_end %}
116 117
                        </ul>
                        <ul class="nav navbar-nav navbar-right">
grisel-davy's avatar
grisel-davy committed
118
                            <li class="dropdown">
119
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fas fa-info"></i> {% trans "More information" %}<span class="caret"></span></a>
grisel-davy's avatar
grisel-davy committed
120 121 122 123
                                <ul class="dropdown-menu">
                                    <li><a href="{% url 'about' %}"><i class="fa fa-info-circle"></i> {% trans "About" %}</a></li>
                                    <li><a href="{% url 'contact' %}"><i class="fas fa-at"></i> {% trans "Contact" %}</a></li>
                                </ul>
124 125
                            </li>
                            {% if not request.user.is_authenticated %}
126 127 128
                                {% if var_sa %}
                                <li>
                                    <a href="{% url 'users:new-user' %}">
129
                                        <i class="fa fa-user-plus"></i> {% trans "Sign up" %}
130 131 132 133 134 135 136 137
                                    </a>
                                </li>
                                {% endif %}
                                <li>
                                    <a id="toggle_login" href="{% url 'login' %}">
                                        <i class="fa fa-sign-in-alt"></i> {% trans "Log in" %}
                                    </a>
                                </li>
138
                            {% else %}
139 140 141 142
                            {% can_view_any_app users machines cotisations %}
                                <li>
                                    <form action="{% url "search:search"%}" class="navbar-form" role="search">
                                        <div class="input-group">
143
                                            <input type="text" class="form-control" placeholder="{% trans "Search" %}" name="q" id="search-term" {% if search_term %}value="{{ search_term }}"{% endif %}>
144 145 146 147
                                            <div class="input-group-btn">
                                                <button class="btn btn-default" type="submit"><i class="fa fa-search"></i></button>
                                                <a href="{% url "search:searchp" %}" class="btn btn-default" role="button"><i class="fa fa-plus"></i></a>
                                            </div>
148
                                        </div>
149 150 151
                                    </form>
                                </li>
			    {% acl_end %}
Maël Kervella's avatar
Maël Kervella committed
152
                            {% endif %}
153 154
                            {% if request.user.is_authenticated %}
                            <li class="dropdown">
155
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-user-circle"></i> {{ request.user.pseudo|slice:":15" }} <span class="caret"></span></a>
156 157 158 159 160 161
                                <ul class="dropdown-menu">
                                    <li><a href="{% url "users:mon-profil" %}"><i class="fa fa-user"></i> {% trans "My profile" %}</a></li>
                                    <li><a id="toggle_login" href="{% url 'logout' %}"><i class="fa fa-sign-out-alt"></i> {% trans "Log out" %}</a></li>
                                </ul>
                            </li>
                            {% endif %}
162
                            <li>
Maël Kervella's avatar
Maël Kervella committed
163
                                {% include 'buttons/setlang.html' %}
164 165 166
                            </li>
                        </ul>
                    </div>
lhark's avatar
lhark committed
167
                </div>
chirac's avatar
chirac committed
168
            </nav>
lhark's avatar
lhark committed
169

chirac's avatar
chirac committed
170 171 172
            <div id="main" class="container-fluid text-center">
                <div class="row content">
                    <div class="col-sm-2 sidenav">
lhark's avatar
lhark committed
173 174 175 176 177 178
                        <div class="panel panel-default">
                            <div class="text-left list-group">
                            {% block sidebar %}
                            {% endblock %}
                            </div>
                        </div>
chirac's avatar
chirac committed
179 180 181 182 183 184
                    </div>
                    <div class="col-sm-8 text-left">
                        {# Display django.contrib.messages as Bootstrap alerts #}
                        {% bootstrap_messages %}
                        <hr>
                        {% block content %}{% endblock %}
lhark's avatar
lhark committed
185
                    </div>
chirac's avatar
chirac committed
186
                    <div class="col-sm-2 sidenav">
lhark's avatar
lhark committed
187
                        <div class="panel panel-default">
188
                            {% if request_user.is_authenticated %}
lhark's avatar
lhark committed
189 190 191 192 193
                            <div class="panel-heading">
                                <h4>{{ request_user.name }} {{ request_user.surname }}</h4>
                            </div>
                            <table class="table">
                                <tr>
194
                                    <th scope="row">{% trans "Username" %}</th>
lhark's avatar
lhark committed
195 196 197
                                    <td class="text-right">{{ request_user.pseudo }}</td>
                                </tr>
                                <tr>
198
                                    <th scope="row">{% trans "Room" %}</th>
lhark's avatar
lhark committed
199 200 201
                                    <td class="text-right">{{ request_user.room }}</td>
                                </tr>
                                <tr>
202
				    <th scope="row">{% trans "Internet access" %}</th>
lhark's avatar
lhark committed
203 204
                                    <td class="text-right">
                                    {% if request_user.has_access %}
205
                                        <i class="text-success">{% blocktrans with request.user.end_access|date:"d b Y" as date %}Until {{ date }}{% endblocktrans %}</i>
lhark's avatar
lhark committed
206
                                    {% else %}
207
                                        <i class="text-danger">{% trans "Disabled" %}</i>
lhark's avatar
lhark committed
208 209 210 211
                                    {% endif %}
                                    </td>
                                </tr>
                                <tr>
212
                                    <th scope="row">{% trans "Membership" %}</th>
lhark's avatar
lhark committed
213
                                    <td class="text-right">
214
                                    {% if request_user.is_adherent %}
215
                                        <i class="text-success">{% blocktrans with request_user.end_adhesion|date:"d b Y" as date %}Until {{ date }}{% endblocktrans %}</i>
lhark's avatar
lhark committed
216
                                    {% else %}
217
                                        <i class="text-danger">{% trans "Not a member" %}</i>
lhark's avatar
lhark committed
218 219 220 221 222 223
                                    {% endif %}
                                    </td>
                                </tr>
                            </table>
                            <div class="list-group">
                                <a class="list-group-item list-group-item-info" role="button"href="{% url "users:mon-profil" %}">
Pietri Yoann's avatar
Pietri Yoann committed
224
                                    <i class="fa fa-user-circle"></i>
225
				    {% trans "View my profile" %}
lhark's avatar
lhark committed
226 227
                                </a>
                            </div>
228
                            {% else %}
229
			    <p>{% trans "You are not logged in." %}</p>
230
                            {% endif %}
chirac's avatar
chirac committed
231
                        </div>
chirac's avatar
chirac committed
232
                        {% if request_user.is_authenticated %}
lhark's avatar
lhark committed
233 234
                        <div class="panel panel-default">
                            <div class="panel-heading">
235
                                <h4>{% blocktrans count interfaces|length as nb %}{{ nb }} active machine{% plural %}{{ nb }} active machines{% endblocktrans %}</h4>
lhark's avatar
lhark committed
236 237 238
                            </div>
                            <ul class="list-group">
                            {% for interface in interfaces|slice:":5" %}
chirac's avatar
chirac committed
239
                                <div class="list-group-item">{{interface}}</div>
lhark's avatar
lhark committed
240 241 242
                            {% endfor %}
                            {% if interfaces|length > 5 %}
                                <a class="list-group-item list-group-item-info" role="button" href="{% url "users:mon-profil" %}">
243
                                    <i class="fa fa-plus"></i>
244
				    {% trans "View my machines" %}
lhark's avatar
lhark committed
245 246 247
                                </a>
                            {% endif %}
                            </ul>
chirac's avatar
chirac committed
248
                        </div>
chirac's avatar
chirac committed
249
                        {% endif %}
lhark's avatar
lhark committed
250 251 252 253 254
                    </div>
                </div>
            </div>
        </div>

chirac's avatar
chirac committed
255
        <footer class="navbar">
256
            <div class="containerfluid text-center">
257
                <p> <a href="\\{{request.get_host}}/about/">Re2o 2016-2018</a> </p>
258
            </div>
lhark's avatar
lhark committed
259 260 261 262
        </footer>
        {# Read the documentation for more information #}
    </body>
</html>
263