8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 03:13:12 +00:00

Merge branch 'moamoak/improve_about' into 'master'

Add many information on about page

See merge request federez/re2o!120
This commit is contained in:
chirac 2018-04-11 18:40:48 +02:00
commit cd0e11815c
12 changed files with 368 additions and 71 deletions

View file

@ -1,3 +0,0 @@
#!/usr/bin/env python3
contributeurs = ['Gabriel Detraz', 'chirac', 'Maël Kervella', 'LEVY-FALK Hugo', 'Dalahro', 'lhark', 'root', 'Hugo LEVY-FALK', 'Chirac', 'guimoz', 'Mael Kervella', 'klafyvel', 'matthieu', 'Yoann Pietri', 'Simon Brélivet', 'chibrac', 'David Sinquin', 'Pierre Cadart', 'moamoak', 'Éloi Alain', 'FERNET Laouen', 'Hugo Levy-Falk', 'Joanne Steiner', 'Matthieu Michelet', 'Yoann PIETRI', 'B', 'Daniel STAN', 'Eloi Alain', 'Guimoz', 'Hugo Hervieux', 'Laouen Fernet', 'Lemesle', 'MICHELET matthieu', 'Nymous', 'Thibault de BOUTRAY', 'Tipunchetrhum', 'Éloi ALAIN']

View file

@ -238,7 +238,7 @@ install_base=$(dialog --clear \
2>&1 >/dev/tty)
echo "Installation des paquets de base"
apt-get -y install python3-django python3-dateutil texlive-latex-base texlive-fonts-recommended python3-djangorestframework python3-django-reversion python3-pip libsasl2-dev libldap2-dev libssl-dev python3-crypto
apt-get -y install python3-django python3-dateutil texlive-latex-base texlive-fonts-recommended python3-djangorestframework python3-django-reversion python3-pip libsasl2-dev libldap2-dev libssl-dev python3-crypto python3-git
pip3 install django-bootstrap3
pip3 install django-ldapdb
pip3 install django-macaddress

3
re2o/contributors.py Normal file
View file

@ -0,0 +1,3 @@
#!/usr/bin/env python3
CONTRIBUTORS = ['Gabriel "Chirac" Détraz', 'Maël "MoaMoaK" Kervella', 'Hugo "Klafyvel" Levy--Falk', 'Augustin "Dahlaro" Lemesle', 'Goulven "Lhark" Kermarec', 'Guillaume "Guimoz" Goessel', 'Yoann "Nanoy" Pietri', 'Matthieu "Lebanni" Michelet', 'Arthur "Grizzly" Grisel-Davy', 'Simon "Rezatoune" Brélivet', 'Sellem Lev-Arcady', 'David "5-1" Sinquin', 'Pierre "Redstorm" Cadart', 'Éloi "Goslig" Alain', 'Laouen "Volgarr" Fernet', 'Joanne Steiner', '"Krokmou"', 'Thibault "Tipunchetrhum" de Boutray', 'Baptiste "B" Fournier', 'Daniel "Dstan" Stan', 'Hugo "Shaka" Hervieux', '"Mikachu"', 'Thomas "Nymous" Gaudin', '"Esum"']

Binary file not shown.

View file

@ -0,0 +1,156 @@
# 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 © 2018 Maël Kervella
#
# 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.
msgid ""
msgstr ""
"Project-Id-Version: 2.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-31 14:05+0000\n"
"PO-Revision-Date: 2018-03-31 16:09+0002\n"
"Last-Translator: Maël Kervella <dev@maelkervella.eu>\n"
"Language-Team: \n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: templates/re2o/about.html:29 templates/re2o/about.html:35
msgid "About Re2o"
msgstr "A propos de Re2o"
#: templates/re2o/about.html:32
#, python-format
msgid "About %(AssoName)s"
msgstr "A propos de %(AssoName)s"
#: templates/re2o/about.html:36
msgid ""
"\n"
" Re2o is an administration tool initiated by\n"
" <a href=\"https://rezometz.org/\">Rezo Supelec Metz</a> and a few\n"
" members of other <a href=\"https://federez.net\">FedeRez</a> "
"associations\n"
" around the summer 2016.<br />\n"
" It is intended to be a tool independant from any network "
"infrastructure\n"
" so it can be setup in \"a few steps\". This tool is entirely free "
"and\n"
" available under a GNU Public License v2 (GPLv2) license on\n"
" <a href=\"https://gitlab.federez.net/federez/re2o/\">FedeRez gitlab</"
"a>.<br />\n"
" Re2o's mainteners are proud volunteers mainly from French "
"engineering\n"
" schools (but not limited to) who have given a lot of their time to "
"make\n"
" this project possible. So please be kind with them.<br />\n"
" If you want to get involved in the development process, we will be "
"glad to\n"
" welcome you so do not hesitate to contact us and come help us build "
"the\n"
" future of Re2o.\n"
" "
msgstr ""
"\n"
" Re2o est un outil d'administration initié par\n"
" <a href=\"https://rezometz.org/\">Rezo Supelec Metz</a> et quelques\n"
" membres d'autres assocations de "
"<a href=\"https://federez.net\">FedeRez</a>\n"
" autour de l'été 2016.<br />\n"
" Il se veut être un outil idépendant de toute infrastructure réseau\n"
" pour pouvoir être installé en \"quelques étapes\". Cet outil est "
"entièrement gratuit et\n"
" est disponible sous license GNU Public License v2 (GPLv2) sur le\n"
" <a href=\"https://gitlab.federez.net/federez/re2o/\">gitlab de FedeRez"
"</a>.<br />\n"
" Les mainteneurs de Re2o sont de fiers bénévoles venant principalement "
"d'écoles d'ingénieurs françaises\n"
" (mais pas seulement) qui ont donné beaucoup de leur temps pour faire "
"en sorte que\n"
" ce projet soit possible. Donc s'il vous plait soyez gentils avez eux."
"<br />\n"
" Si vous voulez prendre part au développement, nous serons heureux "
"de\n"
" vous accueillir donc n'hésitez pas à nous contacter et à venir nous "
"aider à construire le\n"
" futur de Re2o.\n"
" "
#: templates/re2o/about.html:57
msgid "Contributors list"
msgstr "Liste des contributeurs"
#: templates/re2o/about.html:66
msgid "Version informations"
msgstr "Informations de versions"
#: templates/re2o/about.html:68
#, python-format
msgid ""
"\n"
" <b>Remote URL</b>: %(git_info_remote)s\n"
" "
msgstr ""
"\n"
" <b>URL distante</b> : %(git_info_remote)s\n"
" "
#: templates/re2o/about.html:71
#, python-format
msgid ""
"\n"
" <b>Branch</b>: %(git_info_branch)s\n"
" "
msgstr ""
"\n"
" <b>Branche</b> : %(git_info_branch)s\n"
" "
#: templates/re2o/about.html:74
#, python-format
msgid ""
"\n"
" <b>Commit</b>: %(git_info_commit)s\n"
" "
msgstr ""
"\n"
" <b>Commit</b> : %(git_info_commit)s\n"
" "
#: templates/re2o/about.html:77
#, python-format
msgid ""
"\n"
" <b>Commit date</b>: %(git_info_commit_date)s\n"
" "
msgstr ""
"\n"
" <b>Date du commit</b> : %(git_info_commit_date)s\n"
" "
#: templates/re2o/about.html:82
msgid "Dependencies"
msgstr "Dépendances"
#: views.py:172
msgid "No Git repository configured"
msgstr "Aucun repository git configuré"
#: views.py:178
msgid "Unable to get the information"
msgstr "Impossible d'obtenir l'information"

View file

@ -33,7 +33,7 @@ class Command(BaseCommand):
def handle(self, *args, **options):
contributeurs = [item.split('\t')[1] for item in os.popen("git shortlog -s -n").read().split("\n") if '\t' in item]
self.stdout.write(self.style.SUCCESS("Exportation Sucessfull"))
contrib_file = open("contributors.py", "w")
contrib_file.write("#!/usr/bin/env python3\n")
contrib_file.write("\n")
contrib_file.write("contributeurs = " + str(contributeurs))
with open("re2o/contributors.py", "w") as contrib_file:
contrib_file.write("#!/usr/bin/env python3\n")
contrib_file.write("\n")
contrib_file.write("CONTRIBUTORS = " + str(contributeurs))

View file

@ -123,6 +123,12 @@ WSGI_APPLICATION = 're2o.wsgi.application'
LANGUAGE_CODE = 'en'
# Proritary location search for translations
# then searches in {app}/locale/ for app in INSTALLED_APPS
LOCALE_PATHS = [
BASE_DIR + '/templates/locale/' # to define translations outside of apps
]
TIME_ZONE = 'Europe/Paris'
USE_I18N = True

View file

@ -24,39 +24,69 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endcomment %}
{% load bootstrap3 %}
{% load i18n %}
{% block title %}Historique{% endblock %}
{% block title %}{% trans "About Re2o" %}{% endblock %}
{% block content %}
<h2>À propos de {{AssoName}}</h2>
<h2>{% blocktrans %}About {{AssoName}}{% endblocktrans %}</h2>
{{ description }}
<h2>À propos de Re2o</h2>
<p>Re2o est un logiciel d'administration développé initialement au RézoMetz. Il
se veut indépendant de l'architecture du réseau considéré, de manière à être installable en
quelques clics.
C'est un logiciel totallement libre disponible sur le <a href="https://gitlab.federez.net/federez/re2o/">gitlab de FedeRez</a>.
</p>
<h3>Liste des contributeurs</h3>
<div class="row">
<div class="col-md-6">
<ul>
{% for i in contrib_1 %}
<li> {{i}} </li>
{% endfor %}
</ul>
</div>
<div class="col-md-6">
<ul>
{% for i in contrib_2 %}
<li> {{i}} </li>
{%endfor%}
</ul>
</div>
</div>
<br />
<br />
<br />
<h2>{% trans "About Re2o" %}</h2>
<p>{% blocktrans %}
Re2o is an administration tool initiated by
<a href="https://rezometz.org/">Rezo Supelec Metz</a> and a few
members of other <a href="https://federez.net">FedeRez</a> associations
around the summer 2016.<br />
It is intended to be a tool independant from any network infrastructure
so it can be setup in "a few steps". This tool is entirely free and
available under a GNU Public License v2 (GPLv2) license on
<a href="https://gitlab.federez.net/federez/re2o/">FedeRez gitlab</a>.<br />
Re2o's mainteners are proud volunteers mainly from French engineering
schools (but not limited to) who have given a lot of their time to make
this project possible. So please be kind with them.<br />
If you want to get involved in the development process, we will be glad to
welcome you so do not hesitate to contact us and come help us build the
future of Re2o.
{% endblocktrans %}
</p>
<div class="row">
<div class="col-md-6">
<h3>{% trans "Contributors list" %}</h3>
<ul>
{% for contributor in git_info_contributors %}
<li>{{ contributor }}</li>
{% endfor %}
</ul>
</div>
<div class="col-md-6">
<h3>{% trans "Version informations" %}</h3>
<ul>
<li>{% blocktrans %}
<b>Remote URL</b>: {{ git_info_remote }}
{% endblocktrans %}</li>
<li>{% blocktrans %}
<b>Branch</b>: {{ git_info_branch }}
{% endblocktrans %}</li>
<li>{% blocktrans %}
<b>Commit</b>: {{ git_info_commit }}
{% endblocktrans %}</li>
<li>{% blocktrans %}
<b>Commit date</b>: {{ git_info_commit_date }}
{% endblocktrans %}</li>
</ul>
<h3>{% trans "Dependencies" %}</h3>
<ul>
{% for dependency in dependencies %}
<li>{{ dependency }}</li>
{% endfor %}
</ul>
</div>
</div>
{% endblock %}

View file

@ -33,15 +33,22 @@ from django.template.context_processors import csrf
from django.contrib.auth.decorators import login_required, permission_required
from reversion.models import Version
from django.contrib import messages
from preferences.models import Service
from preferences.models import OptionalUser, GeneralOption, AssoOption
from django.conf import settings
from contributors import contributeurs
from django.utils.translation import ugettext as _
from django.views.decorators.cache import cache_page
import git
import os
import time
from itertools import chain
from preferences.models import Service
from preferences.models import OptionalUser, GeneralOption, AssoOption
import users, preferences, cotisations, topologie, machines
from .utils import re2o_paginator
from .settings import BASE_DIR, INSTALLED_APPS, MIDDLEWARE_CLASSES
from .contributors import CONTRIBUTORS
def form(ctx, template, request):
"""Form générique, raccourci importé par les fonctions views du site"""
@ -160,14 +167,38 @@ def history(request, application, object_name, object_id):
)
@cache_page(7 * 24 * 60 * 60)
def about_page(request):
option = AssoOption.objects.get()
n = len(contributeurs)
contrib_1 = contributeurs[:n//2]
contrib_2 = contributeurs[n//2:]
git_info_contributors = CONTRIBUTORS
try:
git_repo = git.Repo(BASE_DIR)
git_info_remote = ", ".join(git_repo.remote().urls)
git_info_branch = git_repo.active_branch.name
last_commit = git_repo.commit()
git_info_commit = last_commit.hexsha
git_info_commit_date = last_commit.committed_datetime
except:
NO_GIT_MSG = _("Unable to get the information")
git_info_remote = NO_GIT_MSG
git_info_branch = NO_GIT_MSG
git_info_commit = NO_GIT_MSG
git_info_commit_date = NO_GIT_MSG
dependencies = INSTALLED_APPS + MIDDLEWARE_CLASSES
return render(
request,
"re2o/about.html",
{'description': option.description , 'AssoName' : option.name , 'contrib_1' : contrib_1 , 'contrib_2' : contrib_2}
{
'description': option.description ,
'AssoName' : option.name ,
'git_info_contributors': git_info_contributors,
'git_info_remote': git_info_remote,
'git_info_branch': git_info_branch,
'git_info_commit': git_info_commit,
'git_info_commit_date': git_info_commit_date,
'dependencies': dependencies
}
)

View file

@ -27,6 +27,8 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% load bootstrap3 %}
{% load acl %}
{% load self_adhesion %}
{% load i18n %}
{% self_adhesion as var_sa %}
<!DOCTYPE html>
<html lang="fr">
@ -39,17 +41,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<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">
{% comment %}<link href="/static/css/jquery-ui.css" rel="stylesheet">{% endcomment %}
<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>
{% comment %}<script src="/static/js/jquery-ui.js"></script>{% endcomment %}
<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>
<link rel="stylesheet" href="{% static "/css/base.css" %}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{ site_name }} : {% block title %}Accueil{% endblock %}</title>
@ -86,7 +86,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<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 %}
{% 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 %}
@ -99,17 +99,57 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<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>
<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>
<div class="col-sm-3 col-md-3 navbar-right">
<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 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 %}
</ul>
</ul>
{% comment %}
<div class="navbar-right">
<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 %}>
@ -135,20 +175,19 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</a>
</li>
{% endif %}
</ul>
{% can_view_app preferences %}
<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>
<li>
<a href="{% url 'about' %}"><i class="fa fa-info-circle"></i> A propos</a>
</li>
</ul>
{% acl_end %}
</div>
</li>
{% acl_end %}
<li>
<a href="{% url 'about' %}"><i class="fa fa-info-circle"></i> A propos</a>
</li>
</ul>
{% endcomment %}
</div>
</div>
</nav>
@ -239,7 +278,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<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>
<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 #}

Binary file not shown.

View file

@ -0,0 +1,35 @@
# 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 © 2018 Maël Kervella
#
# 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.
msgid ""
msgstr ""
"Project-Id-Version: 2.5\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-03-31 14:05+0000\n"
"PO-Revision-Date: 2018-03-31 16:09+0002\n"
"Last-Translator: Maël Kervella <dev@maelkervella.eu>\n"
"Language-Team: \n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: base.html:121
msgid "About"
msgstr "A propos"