Browse Source

Crée un champ téléphone

rewrite_authors
Gabriel Detraz 9 years ago
committed by root
parent
commit
68c0adc46d
  1. 20
      users/migrations/0051_user_telephone.py
  2. 7
      users/models.py
  3. 17
      users/templates/users/profil.html

20
users/migrations/0051_user_telephone.py

@ -0,0 +1,20 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-06-25 02:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0050_serviceuser_comment'),
]
operations = [
migrations.AddField(
model_name='user',
name='telephone',
field=models.CharField(blank=True, max_length=15, null=True),
),
]

7
users/models.py

@ -163,6 +163,7 @@ class User(AbstractBaseUser):
pwd_ntlm = models.CharField(max_length=255) pwd_ntlm = models.CharField(max_length=255)
state = models.IntegerField(choices=STATES, default=STATE_ACTIVE) state = models.IntegerField(choices=STATES, default=STATE_ACTIVE)
registered = models.DateTimeField(auto_now_add=True) registered = models.DateTimeField(auto_now_add=True)
telephone = models.CharField(max_length=15, blank=True, null=True)
uid_number = models.IntegerField(default=auto_uid, unique=True) uid_number = models.IntegerField(default=auto_uid, unique=True)
rezo_rez_uid = models.IntegerField(unique=True, blank=True, null=True) rezo_rez_uid = models.IntegerField(unique=True, blank=True, null=True)
@ -683,6 +684,7 @@ class BaseInfoForm(ModelForm):
'school', 'school',
'comment', 'comment',
'room', 'room',
'telephone',
] ]
class EditInfoForm(BaseInfoForm): class EditInfoForm(BaseInfoForm):
@ -696,6 +698,7 @@ class EditInfoForm(BaseInfoForm):
'comment', 'comment',
'room', 'room',
'shell', 'shell',
'telephone',
] ]
class InfoForm(EditInfoForm): class InfoForm(EditInfoForm):
@ -822,7 +825,3 @@ class WhitelistForm(ModelForm):
if date_end < timezone.now(): if date_end < timezone.now():
raise forms.ValidationError("Triple buse, la date de fin ne peut pas être avant maintenant... Re2o ne voyage pas dans le temps") raise forms.ValidationError("Triple buse, la date de fin ne peut pas être avant maintenant... Re2o ne voyage pas dans le temps")
return date_end return date_end
class ProfilForm(Form):
user = forms.CharField(label='Ok', max_length=100)

17
users/templates/users/profil.html

@ -69,17 +69,24 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<th>E-mail</th> <th>E-mail</th>
<td>{{ user.email }}</td> <td>{{ user.email }}</td>
</tr> </tr>
<tr>
<th>Chambre</th>
<td>{{ user.room }}</td>
<th>Téléphone</th>
<td>{{ user.telephone }}</td>
</tr>
<tr> <tr>
<th>École</th> <th>École</th>
<td>{{ user.school }}</td> <td>{{ user.school }}</td>
<th>Commentaire</th> <th>Commentaire</th>
<td>{{ user.comment }}</td> <td>{{ user.comment }}</td>
</tr> </tr>
<tr>
<th>Chambre</th> <tr>
<td>{{ user.room }}</td>
<th>Date d'inscription</th> <th>Date d'inscription</th>
<td>{{ user.registered }}</td> <td>{{ user.registered }}</td>
<th>Dernière connexion</th>
<td>{{ user.last_login }}</td>
</tr> </tr>
<tr> <tr>
<th>Fin d'adhésion</th> <th>Fin d'adhésion</th>
@ -123,10 +130,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% else %} {% else %}
<td>Aucun</td> <td>Aucun</td>
{% endif %} {% endif %}
<tr>
<th>Dernière connexion</th>
<td>{{ user.last_login }}</td>
</tr>
</table> </table>
<h2>Machines :</h2> <h2>Machines :</h2>
<h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' user.id %}"><i class="glyphicon glyphicon-phone"></i> Ajouter une machine</a></h4> <h4><a class="btn btn-primary btn-sm" role="button" href="{% url 'machines:new-machine' user.id %}"><i class="glyphicon glyphicon-phone"></i> Ajouter une machine</a></h4>

Loading…
Cancel
Save