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 !

Commit 92e66bb1 authored by Fardale's avatar Fardale

Merge branch 'fix_trad_and_autocapture' into 'dev'

Traductions, style et fixe de bugs sur la page d'enregistrement mac/room

See merge request federez/re2o!322
parents 152b0a64 52818dab
......@@ -378,12 +378,12 @@ class AdherentCreationForm(AdherentForm):
+ "using the forgotten password button on the "\
+ "login page or contacting support.")
former_user_check = forms.BooleanField(required=True, help_text=former_user_check_info)
former_user_check.label = _("I have not had an account before")
former_user_check.label = _("I certifie that I have not had an account before")
# Checkbox for GTU
gtu_check = forms.BooleanField(required=True)
gtu_check.label = mark_safe("{}<a href='/media/{}' download='CGU'>{}</a>{}".format(
_("I commit to accept the "), GeneralOption.get_cached_value('GTU'), _("General Terms of Use"), _(".")))
gtu_check.label = mark_safe("{} <a href='/media/{}' download='CGU'>{}</a>{}".format(
_("I commit to accept the"), GeneralOption.get_cached_value('GTU'), _("General Terms of Use"), _(".")))
def __init__(self, *args, **kwargs):
super(AdherentCreationForm, self).__init__(*args, **kwargs)
......@@ -417,7 +417,7 @@ class AdherentEditForm(AdherentForm):
class ClubForm(FormRevMixin, FieldPermissionFormMixin, ModelForm):
"""Formulaire de base d'edition d'un user. Formulaire de base, utilisé
pour l'edition de self par self ou un cableur. On formate les champs
......@@ -730,11 +730,11 @@ class InitialRegisterForm(forms.Form):
self.nas_type = Nas.objects.filter(nas_type__interface__ipv4__ipv4=switch_ip).first()
super(InitialRegisterForm, self).__init__(*args, **kwargs)
if hasattr(self, 'new_room'):
self.fields['register_room'].label = _("New connection from room %s. Is it yours? If that is the case, type OK." % self.new_room)
self.fields['register_room'].label = _("This room is my room")
if hasattr(self, 'mac_address'):
self.fields['register_machine'].label = _("New connection from new device. Register it? Say Yes to get Internet access from it (MAC Address : %s)." % self.mac_address)
self.fields['register_machine'].label = _("This new connected device is mine")
This diff is collapsed.
{% extends "users/sidebar.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 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
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 bootstrap3 %}
{% load massive_bootstrap_form %}
{% load static %}
{% load i18n %}
{% block title %}{% trans "Users" %}{% endblock %}
{% block content %}
{% bootstrap_form_errors userform %}
<h2>{% blocktrans %}Device and room register form{% endblocktrans %}</h2>
<form class="form" method="post">
{% csrf_token %}
<div class="dashboard_container">
<div class="row">
<div class="col-sm-6 col-md-6">
<div class="panel panel-success">
<div class="panel-heading dashboard">{% blocktrans %}Connected from :{% endblocktrans %}</div>
<div class="panel-body dashboard">
<h5>{% blocktrans %}Room {% endblocktrans %} {{ port.room }}</h5>
<h5>{% blocktrans %}Port {% endblocktrans %} {{ port }}</h5>
<h3>{{ userform.register_room }} {{ userform.register_room.label }}</h3>
<div class="col-sm-6 col-md-6">
<div class="panel panel-success">
<div class="panel-heading dashboard">{% blocktrans %}Connected with device :{% endblocktrans %}</div>
<div class="panel-body dashboard">
<h5>{% blocktrans %}Mac address {% endblocktrans %} {{ mac }}</h5>
<h3>{{ userform.register_machine }} {{ userform.register_machine.label }}</h3>
<center>{% bootstrap_button "Ok" button_type="submit" icon='ok' button_class='btn-success' %}</center>
{% endblock %}
......@@ -70,7 +70,7 @@ from re2o.acl import (
from cotisations.utils import find_payment_method
from topologie.models import Port
from .serializers import MailingSerializer, MailingMemberSerializer
from .models import (
......@@ -133,7 +133,7 @@ def new_user(request):
'GTU_sum_up': GTU_sum_up,
'showCGU': True,
'action_name': _("Create a user")
'action_name': _("Commit")
......@@ -1085,13 +1085,18 @@ def process_passwd(request, req):
def initial_register(request):
u_form = InitialRegisterForm(request.POST or None, user=request.user, switch_ip=request.GET.get('switch_ip', None), switch_port=request.GET.get('switch_port', None), client_mac=request.GET.get('client_mac', None))
switch_ip = request.GET.get('switch_ip', None)
switch_port = request.GET.get('switch_port', None)
client_mac = request.GET.get('client_mac', None)
u_form = InitialRegisterForm(request.POST or None, user=request.user, switch_ip=switch_ip, switch_port=switch_port, client_mac=client_mac)
if not u_form.fields:
messages.error(request, _("Incorrect URL, or already registered device"))
return redirect(reverse(
kwargs={'userid': str(request.user.id)}
if switch_ip and switch_port:
port = Port.objects.filter(switch__interface__ipv4__ipv4=switch_ip, port=switch_port).first()
if u_form.is_valid():
messages.success(request, _("Successful registration! Please"
" disconnect and reconnect your Ethernet"
......@@ -1102,8 +1107,8 @@ def initial_register(request):
return form(
{'userform': u_form, 'action_name': _("Register device or room")},
{'userform': u_form, 'port': port, 'mac': client_mac},
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment