mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-11-25 22:03:10 +00:00
256 lines
14 KiB
HTML
256 lines
14 KiB
HTML
{% 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 %}
|
|
|
|
{% load staticfiles %}
|
|
|
|
{# Load the tag library #}
|
|
{% load bootstrap3 %}
|
|
{% load acl %}
|
|
{% load self_adhesion %}
|
|
{% load i18n %}
|
|
|
|
{% self_adhesion as var_sa %}
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head prefix="og: http://ogp.me/ns#">
|
|
<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"/>
|
|
<meta property="og:description" content="Site de gestion de réseau supporté par FedeRez." />
|
|
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/all.js"></script>
|
|
{# Load CSS and JavaScript #}
|
|
{% bootstrap_css %}
|
|
<link href="/static/css/typeaheadjs.css" rel="stylesheet">
|
|
<link href="/static/css/bootstrap-tokenfield.css" rel="stylesheet">
|
|
|
|
{% bootstrap_javascript %}
|
|
<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>
|
|
<script src="/static/js/shortcuts.js"></script>
|
|
<link rel="stylesheet" href="{% static 'css/base.css' %}">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="shortcut icon" type="image/svg" href="{% static 'images/logo_re2o.svg' %}">
|
|
<title>{{ name_website }} : {% 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="/">
|
|
<img src="{% static 'images/logo_re2o_navbar.svg' %}" height=32>
|
|
{{ name_website }}
|
|
</a>
|
|
</div>
|
|
<div class="collapse navbar-collapse" id="myNavbar">
|
|
<ul class="nav navbar-nav">
|
|
{% if request.user.is_authenticated %}
|
|
<li class="dropdown">
|
|
<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>
|
|
<ul class="dropdown-menu">
|
|
<li><a href="{% url "users:mon-profil" %}"><i class="fa fa-user"></i> Mon profil</a></li>
|
|
<li><a id="toggle_login" href="{% url 'logout' %}"><i class="fa fa-sign-out-alt"></i> Se déconnecter</a></li>
|
|
</ul>
|
|
</li>
|
|
{% endif %}
|
|
{% can_view_any_app users machines cotisations %}
|
|
<li class="dropdown">
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-users"></i> Adhérents<span class="caret"></span></a>
|
|
<ul class="dropdown-menu">
|
|
{% can_view_app users %}
|
|
<li><a href="{% url 'users:index' %}"><i class="fa fa-user"></i> Gérer les adhérents</a></li>
|
|
<li><a href="{% url 'users:index-clubs' %}"><i class="fa fa-users"></i> Gérer les clubs</a></li>
|
|
{% acl_end %}
|
|
{% can_view_app machines %}
|
|
<li><a href="{% url 'machines:index' %}"><i class="fa fa-desktop"></i> Gérer les machines</a></li>
|
|
{% acl_end %}
|
|
{% can_view_app cotisations %}
|
|
<li><a href="{% url 'cotisations:index' %}"><i class="fa fa-dollar-sign"></i> Gérer les cotisations</a></li>
|
|
{% acl_end %}
|
|
</ul>
|
|
</li>
|
|
{% acl_end %}
|
|
{% can_view_app topologie %}
|
|
<li class="dropdown">
|
|
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false"><i class="fa fa-sitemap"></i> Topologie<span class="caret"></span></a>
|
|
<ul class="dropdown-menu">
|
|
<li><a href="{% url "topologie:index" %}"><i class="fa fa-microchip"></i> Switchs</a></li>
|
|
<li><a href="{% url "topologie:index-ap" %}"><i class="fa fa-wifi"></i> Bornes WiFi</a></li>
|
|
<li><a href="{% url "topologie:index-room" %}"><i class="fa fa-home"></i> Chambres et locaux</a></li>
|
|
</ul>
|
|
</li>
|
|
{% acl_end %}
|
|
{% can_view_app logs %}
|
|
<li><a href="{% url "logs:index" %}"><i class="fa fa-chart-area"></i> Statistiques</a></li>
|
|
{% acl_end %}
|
|
</ul>
|
|
<ul class="nav navbar-nav navbar-right">
|
|
{% can_view_app preferences %}
|
|
<li>
|
|
<a href="{% url 'preferences:display-options' %}">
|
|
<i class="fa fa-cogs"></i> Preferences
|
|
</a>
|
|
</li>
|
|
{% acl_end %}
|
|
<li>
|
|
<a href="{% url 'about' %}"><i class="fa fa-info-circle"></i> {% trans "About" %}</a>
|
|
</li>
|
|
{% if not request.user.is_authenticated %}
|
|
{% if var_sa %}
|
|
<li>
|
|
<a href="{% url 'users:new-user' %}">
|
|
<i class="fa fa-user-plus"></i> Créer un compte
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
<li>
|
|
<a id="toggle_login" href="{% url 'login' %}">
|
|
<i class="fa fa-sign-in-alt"></i> Login
|
|
</a>
|
|
</li>
|
|
{% else %}
|
|
<li>
|
|
<form action="{% url "search:search"%}" class="navbar-form" role="search">
|
|
<div class="input-group">
|
|
<input type="text" class="form-control" placeholder="Search" name="q" id="search-term" {% if search_term %}value="{{ search_term }}"{% endif %}>
|
|
<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>
|
|
</div>
|
|
</form>
|
|
</li>
|
|
{% endif %}
|
|
<li>
|
|
{% include 'buttons/setlang.html' %}
|
|
</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">Chambre</th>
|
|
<td class="text-right">{{ request_user.room }}</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Connexion</th>
|
|
<td class="text-right">
|
|
{% if request_user.has_access %}
|
|
<i class="text-success">jusqu'au {{ request.user.end_access|date:"d b Y" }}</i>
|
|
{% else %}
|
|
<i class="text-danger">Désactivée</i>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<th scope="row">Adhésion</th>
|
|
<td class="text-right">
|
|
{% if request_user.is_adherent %}
|
|
<i class="text-success">jusqu'au {{ request_user.end_adhesion|date:"d b Y" }}</i>
|
|
{% else %}
|
|
<i class="text-danger">Non adhérent</i>
|
|
{% endif %}
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<div class="list-group">
|
|
<a class="list-group-item list-group-item-info" role="button"href="{% url "users:mon-profil" %}">
|
|
<i class="fa fa-user-circle"></i>
|
|
Voir mon profil
|
|
</a>
|
|
</div>
|
|
{% else %}
|
|
<p>Vous n'êtes pas authentifié</p>
|
|
{% endif %}
|
|
</div>
|
|
{% if request_user.is_authenticated %}
|
|
<div class="panel panel-default">
|
|
<div class="panel-heading">
|
|
<h4>{{ interfaces|length }} machines actives</h4>
|
|
</div>
|
|
<ul class="list-group">
|
|
{% for interface in interfaces|slice:":5" %}
|
|
<div class="list-group-item">{{interface}}</div>
|
|
{% endfor %}
|
|
{% if interfaces|length > 5 %}
|
|
<a class="list-group-item list-group-item-info" role="button" href="{% url "users:mon-profil" %}">
|
|
<i class="fa fa-plus"></i>
|
|
Voir mes machines
|
|
</a>
|
|
{% endif %}
|
|
</ul>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<footer class="navbar">
|
|
<div class="containerfluid text-center">
|
|
<p> <a href="\\{{request.get_host}}/about/">Re2o 2016-2018</a> - Gabriel Détraz, <a href="https://gitlab.rezometz.org/lhark">Goulven Kermarec</a>, Augustin Lemesle, Maël Kervella, Hugo Levy-Falk</p>
|
|
</div>
|
|
</footer>
|
|
{# Read the documentation for more information #}
|
|
</body>
|
|
</html>
|