2017-01-15 23:07:42 +00:00
{% 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.
2019-09-29 14:02:28 +00:00
Copyright © 2017 Lara Kermarec
2017-01-15 23:07:42 +00:00
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 %}
2016-06-30 23:46:14 +00:00
{% load staticfiles %}
{# Load the tag library #}
{% load bootstrap3 %}
2017-12-28 15:00:37 +00:00
{% load acl %}
2018-01-14 22:47:44 +00:00
{% load self_adhesion %}
2018-04-10 22:07:26 +00:00
{% load i18n %}
2018-01-14 22:47:44 +00:00
{% self_adhesion as var_sa %}
2016-06-30 23:46:14 +00:00
<!DOCTYPE html>
< html lang = "fr" >
2017-12-11 23:15:54 +00:00
< head prefix = "og: http://ogp.me/ns#" >
2019-01-12 08:07:37 +00:00
{# Open Graph for social media #}
< meta property = "og:title" content = "{{ name_website }}" / >
2018-06-22 18:51:51 +00:00
< 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" / >
2019-11-16 14:13:35 +00:00
< meta property = "og:description" content = "Networking managing website endorsed by FedeRez." / >
2018-09-18 20:11:25 +00:00
2018-09-24 09:56:48 +00:00
{# Preload JavaScript #}
{% bootstrap_javascript %}
< script src = "/static/js/typeahead/typeahead.js" > < / script >
< script src = "/static/js/bootstrap-tokenfield/bootstrap-tokenfield.js" > < / script >
2018-12-30 14:27:07 +00:00
< script src = "{% static 'js/collapse-from-url.js' %}" > < / script >
2018-09-24 09:56:48 +00:00
2020-04-21 15:37:17 +00:00
{% block custom_js %}{% endblock %}
2018-09-19 11:37:10 +00:00
{# Load CSS #}
2016-06-30 23:46:14 +00:00
{% bootstrap_css %}
2018-09-19 11:37:10 +00:00
< link href = "{% static 'css/typeaheadjs.css' %}" rel = "stylesheet" >
< link href = "{% static 'css/bootstrap-tokenfield.css' %}" rel = "stylesheet" >
< link href = "{% static 'css/font-awesome.min.css' %}" rel = "stylesheet" >
< link href = "{% static 'css/base.css' %}" rel = "stylesheet" >
2016-06-30 23:46:14 +00:00
2019-01-12 08:07:37 +00:00
{# Favicon with iOS, Android, touchbar support #}
< link rel = "apple-touch-icon" sizes = "180x180" href = "{% static 'favicon/apple-touch-icon.png' %}" >
< link rel = "icon" type = "image/png" sizes = "32x32" href = "{% static 'favicon/favicon-32x32.png' %}" >
< link rel = "icon" type = "image/png" sizes = "16x16" href = "{% static 'favicon/favicon-16x16.png' %}" >
< link rel = "manifest" href = "{% static 'favicon/site.webmanifest' %}" >
< link rel = "mask-icon" href = "{% static 'favicon/safari-pinned-tab.svg' %}" color = "#5bbad5" >
< link rel = "shortcut icon" href = "{% static 'favicon/favicon.ico' %}" >
< meta name = "theme-color" content = "#ffffff" >
{# Do not allow zooming on devices #}
2016-07-19 18:52:39 +00:00
< meta name = "viewport" content = "width=device-width, initial-scale=1" >
2019-01-12 08:07:37 +00:00
2018-06-23 17:12:32 +00:00
< title > {{ name_website }} : {% block title %}{% trans "Home" %}{% endblock %}< / title >
2016-06-30 23:46:14 +00:00
< / head >
2018-09-19 12:42:34 +00:00
< body id = "main" >
2018-09-18 20:11:25 +00:00
< nav class = "navbar navbar-inverse navbar-static-top" >
< 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" >
{% can_view_any_app users machines cotisations %}
< li class = "dropdown" >
2018-09-19 11:37:10 +00:00
< 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 >
2018-09-18 20:11:25 +00:00
< ul class = "dropdown-menu" >
{% can_view_app users %}
2018-09-19 11:37:10 +00:00
< 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 >
2019-09-20 12:48:37 +00:00
{% acl_end %}
2018-09-18 20:11:25 +00:00
{% can_view_app machines %}
2018-09-19 11:37:10 +00:00
< li > < a href = "{% url 'machines:index' %}" > < i class = "fa fa-desktop" > < / i > {% trans "Manage the machines" %}< / a > < / li >
2018-09-18 20:11:25 +00:00
{% acl_end %}
{% can_view_app cotisations %}
2018-09-19 15:11:52 +00:00
< li > < a href = "{% url 'cotisations:index' %}" > < i class = "fa fa-eur" > < / i > {% trans "Manage the subscriptions" %}< / a > < / li >
2018-09-18 20:11:25 +00:00
{% acl_end %}
2019-09-20 12:48:37 +00:00
2019-09-20 17:56:19 +00:00
{% for app, template in optionnal_templates_navbar_user_list %}
{% if app != 'topologie' %}
{{ template }}
{% endif %}
{% endfor %}
2018-09-18 20:11:25 +00:00
< / 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 > {% trans "Topology" %}< span class = "caret" > < / span > < / a >
< ul class = "dropdown-menu" >
2019-01-08 23:40:30 +00:00
< 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 >
2019-09-20 17:56:19 +00:00
{% for app, template in optionnal_templates_navbar_user_list %}
{% if app == 'topologie' %}
{{ template }}
{% endif %}
{% endfor %}
2018-09-18 20:11:25 +00:00
< / ul >
< / li >
{% acl_end %}
{% can_view_app logs %}
2019-01-08 23:40:30 +00:00
< li > < a href = "{% url 'logs:index' %}" > < i class = "fa fa-area-chart" > < / i > {% trans "Statistics" %}< / a > < / li >
2018-09-18 20:11:25 +00:00
{% acl_end %}
{% can_view_app preferences %}
< li >
< a href = "{% url 'preferences:display-options' %}" >
< i class = "fa fa-cogs" > < / i > {% trans "Administration" %}
< / a >
< / li >
{% acl_end %}
< / ul >
< ul class = "nav navbar-nav navbar-right" >
< li class = "dropdown" >
2019-08-16 14:13:20 +00:00
< a href = "#" class = "dropdown-toggle" data-toggle = "dropdown" role = "button" aria-haspopup = "true" aria-expanded = "false" > < i class = "fa fa-info" > < / i > {% trans "Information and contact" %}< span class = "caret" > < / span > < / a >
2018-09-18 20:11:25 +00:00
< ul class = "dropdown-menu" >
< li > < a href = "{% url 'about' %}" > < i class = "fa fa-info-circle" > < / i > {% trans "About" %}< / a > < / li >
2018-09-19 11:37:10 +00:00
< li > < a href = "{% url 'contact' %}" > < i class = "fa fa-at" > < / i > {% trans "Contact" %}< / a > < / li >
2019-07-25 14:44:40 +00:00
{% comment %}
2019-11-16 14:13:35 +00:00
< li > < a href = "{% url 'tickets:new-ticket' %}" > < i class = "fa fa-ticket" > < / i > {% trans "Open a ticket" %}< / a > < li >
2019-07-25 14:44:40 +00:00
{% endcomment %}
2018-09-18 20:11:25 +00:00
< / ul >
< / li >
{% if not request.user.is_authenticated %}
2019-08-11 16:03:45 +00:00
{% for template in optionnal_templates_navbar_logout_list %}
{{ template }}
{% endfor %}
2018-09-18 20:11:25 +00:00
{% if var_sa %}
2018-04-10 22:07:26 +00:00
< li >
2018-09-18 20:11:25 +00:00
< a href = "{% url 'users:new-user' %}" >
< i class = "fa fa-user-plus" > < / i > {% trans "Sign up" %}
2018-04-10 22:07:26 +00:00
< / a >
< / li >
2018-04-16 18:07:54 +00:00
{% endif %}
2018-09-18 20:11:25 +00:00
< li >
< a id = "toggle_login" href = "{% url 'login' %}" >
2018-09-19 11:37:10 +00:00
< i class = "fa fa-sign-in" > < / i > {% trans "Log in" %}
2018-09-18 20:11:25 +00:00
< / a >
2018-08-10 23:37:08 +00:00
< / li >
2018-09-18 20:11:25 +00:00
{% else %}
{% can_view_any_app users machines cotisations %}
2018-04-10 22:07:26 +00:00
< li >
2019-01-08 23:40:30 +00:00
< form action = "{% url 'search:search' %}" class = "navbar-form" role = "search" >
2018-09-18 20:11:25 +00:00
< div class = "input-group" >
< input type = "text" class = "form-control" placeholder = "{% trans " 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 >
2019-01-08 23:40:30 +00:00
< a href = "{% url 'search:searchp' %}" class = "btn btn-default" role = "button" > < i class = "fa fa-plus" > < / i > < / a >
2018-09-18 20:11:25 +00:00
< / div >
< / div >
< / form >
2018-04-10 22:07:26 +00:00
< / li >
2018-09-19 11:37:10 +00:00
{% acl_end %}
2018-09-18 20:11:25 +00:00
{% endif %}
{% 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" >
2019-01-08 23:40:30 +00:00
< li > < a href = "{% url 'users:mon-profil' %}" > < i class = "fa fa-user" > < / i > {% trans "My profile" %}< / a > < / li >
2018-09-19 11:37:10 +00:00
< li > < a id = "toggle_login" href = "{% url 'logout' %}" > < i class = "fa fa-sign-out" > < / i > {% trans "Log out" %}< / a > < / li >
2018-09-18 20:11:25 +00:00
< / ul >
< / li >
{% endif %}
< li >
{% include 'buttons/setlang.html' %}
< / li >
< / ul >
2016-06-30 23:46:14 +00:00
< / div >
2018-09-18 20:11:25 +00:00
< / div >
< / nav >
2016-06-30 23:46:14 +00:00
2018-09-18 20:11:25 +00:00
< div class = "container-fluid text-center" >
< div class = "row content" >
2018-09-19 12:42:34 +00:00
< div class = "col-sm-2 sidenav pt4" >
2018-09-18 20:11:25 +00:00
< div class = "panel panel-default" >
< div class = "text-left list-group" >
{% block sidebar %}
{% endblock %}
2016-11-18 10:53:10 +00:00
< / div >
2016-07-09 15:16:44 +00:00
< / div >
2018-09-18 20:11:25 +00:00
< / div >
2018-09-19 12:42:34 +00:00
< div class = "col-sm-8 text-left pt4" >
2018-09-18 20:11:25 +00:00
{# Display django.contrib.messages as Bootstrap alerts #}
{% bootstrap_messages %}
{% block content %}{% endblock %}
< / div >
2018-09-19 12:42:34 +00:00
< div class = "col-sm-2 sidenav pt4" >
2018-09-18 20:11:25 +00:00
< div class = "panel panel-default" >
2016-07-10 16:29:40 +00:00
{% if request_user.is_authenticated %}
2018-09-18 20:11:25 +00:00
< div class = "panel-heading" >
< h4 > {{ request_user.name }} {{ request_user.surname }}< / h4 >
2020-05-17 10:51:05 +00:00
{% if request_user.image_url %}
2020-05-21 15:08:44 +00:00
< img src = "{{ request_user.image_url }}" height = "42" width = "42" / >
2020-05-17 10:51:05 +00:00
{% endif %}
2016-07-09 15:16:44 +00:00
< / div >
2018-09-18 20:11:25 +00:00
< table class = "table" >
< tr >
< th scope = "row" > {% trans "Username" %}< / th >
< td class = "text-right" > {{ request_user.pseudo }}< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Room" %}< / th >
< td class = "text-right" > {{ request_user.room }}< / td >
< / tr >
< tr >
2018-09-19 11:37:10 +00:00
< th scope = "row" > {% trans "Internet access" %}< / th >
2018-09-18 20:11:25 +00:00
< td class = "text-right" >
{% if request_user.has_access %}
2019-01-08 23:40:30 +00:00
< i class = "text-success" > {% blocktrans with end_access_date=request.user.end_access|date:"d b Y" %}Until {{ end_access_date }}{% endblocktrans %}< / i >
2018-09-18 20:11:25 +00:00
{% else %}
< i class = "text-danger" > {% trans "Disabled" %}< / i >
{% endif %}
< / td >
< / tr >
< tr >
< th scope = "row" > {% trans "Membership" %}< / th >
< td class = "text-right" >
{% if request_user.is_adherent %}
2019-01-08 23:40:30 +00:00
< i class = "text-success" > {% blocktrans with end_adhesion_date=request_user.end_adhesion|date:"d b Y" %}Until {{ end_adhesion_date }}{% endblocktrans %}< / i >
2018-09-18 20:11:25 +00:00
{% else %}
2019-01-08 23:40:30 +00:00
< i class = "text-danger" > {% trans "Non member" %}< / i >
2018-09-18 20:11:25 +00:00
{% endif %}
< / td >
< / tr >
< / table >
< div class = "list-group" >
2019-01-08 23:40:30 +00:00
< a class = "list-group-item list-group-item-info" role = "button" href = "{% url 'users:mon-profil' %}" >
2018-09-18 20:11:25 +00:00
< i class = "fa fa-user-circle" > < / i >
2018-09-19 11:37:10 +00:00
{% trans "View my profile" %}
2018-09-18 20:11:25 +00:00
< / a >
< / div >
{% else %}
2018-09-27 20:35:04 +00:00
< div class = "panel-body" >
< p > {% trans "You are not logged in." %}< / p >
< / div >
2016-07-10 16:29:40 +00:00
{% endif %}
2016-06-30 23:46:14 +00:00
< / div >
2018-09-18 20:11:25 +00:00
{% if request_user.is_authenticated %}
< div class = "panel panel-default" >
< div class = "panel-heading" >
< h4 > {% blocktrans count interfaces|length as nb %}{{ nb }} active machine{% plural %}{{ nb }} active machines{% endblocktrans %}< / h4 >
< / div >
< ul class = "list-group" >
{% for interface in interfaces|slice:":5" %}
2019-01-08 23:40:30 +00:00
< div class = "list-group-item" > {{ interface }}< / div >
2018-09-18 20:11:25 +00:00
{% endfor %}
{% if interfaces|length > 5 %}
2019-01-08 23:40:30 +00:00
< a class = "list-group-item list-group-item-info" role = "button" href = "{% url 'users:mon-profil' %}" >
2018-09-18 20:11:25 +00:00
< i class = "fa fa-plus" > < / i >
{% trans "View my machines" %}
< / a >
{% endif %}
< / ul >
< / div >
{% endif %}
2016-06-30 23:46:14 +00:00
< / div >
< / div >
< / div >
2018-09-18 20:11:25 +00:00
< footer class = "text-muted" >
< div class = "container" >
< p class = "pull-right" >
< a href = "#" > {% trans "Back to top" %}< / a >
< / p >
2020-05-28 12:49:29 +00:00
< p > {{ name_website }} {% trans "powered by" %} Re2o 2016– 2020< / p >
2018-09-18 20:11:25 +00:00
< p >
{% blocktrans trimmed %}
Brought to you with < i class = "fa fa-heart text-danger" > < / i > .
{% endblocktrans %}
< a href = "{{ request.scheme }}://{{ request.get_host }}/about/" > {% trans "About this website" %}< / a > .
< / p >
< p >
{% blocktrans trimmed %}
This software is under the terms of the
< a href = "http://www.gnu.org/licenses/gpl-2.0.txt" target = "_blank" rel = "nofollow" > GPLv2< / a > License.
{% endblocktrans %}
< / p >
2016-07-01 01:26:24 +00:00
< / div >
2016-06-30 23:46:14 +00:00
< / footer >
2018-09-18 20:11:25 +00:00
2018-09-19 11:37:10 +00:00
{# Load JavaScript #}
< script src = "/static/js/konami/konami.js" > < / script >
2018-09-19 16:31:21 +00:00
< script src = "/static/js/sapphire.js" > < / script >
< script >
// Konami activate sapphire
let s = Sapphire();
Konami(s.activate);
< / script >
2019-09-20 12:48:37 +00:00
{% if request.user.shortcuts_enabled %}
2018-09-19 11:37:10 +00:00
< script src = "/static/js/shortcuts.js" > < / script >
2019-09-20 12:48:37 +00:00
{% endif %}
2016-06-30 23:46:14 +00:00
{# Read the documentation for more information #}
< / body >
< / html >
2018-05-20 19:21:29 +00:00