8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-24 07:53:47 +00:00

Modifiacation du form pour la création des clubs + migration

This commit is contained in:
grisel-davy 2018-08-26 14:42:28 +02:00
parent 1d93912e7f
commit 6a0a671bd3
2 changed files with 51 additions and 2 deletions

View file

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2018-08-26 12:40
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0077_auto_20180824_1750'),
]
operations = [
migrations.AddField(
model_name='user',
name='disclaimer',
field=models.FileField(blank=True, upload_to='disclaimers'),
),
migrations.AlterField(
model_name='user',
name='state',
field=models.IntegerField(choices=[(0, 'STATE_ACTIVE'), (1, 'STATE_DISABLED'), (2, 'STATE_ARCHIVE')], default=0),
),
]

View file

@ -59,6 +59,7 @@ function submitBday() {
<h3>Informations générales</h3>
{% if action_name == 'Create a user' %}
<div class="form-row">
<div class="form-group col-md-4">
{{ userform.name.label_tag }}
@ -73,7 +74,20 @@ function submitBday() {
{% render_field userform.pseudo class="form-control" requiered=True %}
</div>
</div>
{% elif action_name == 'Create a club' %}
<div class="form-row">
<div class="form-group col-md-6">
{{ userform.surname.label_tag }}
{% render_field userform.surname class="form-control" requiered=True %}
</div>
<div class="form-group col-md-6">
{{ userform.pseudo.label_tag }}
{% render_field userform.pseudo class="form-control" requiered=True %}
</div>
</div>
{% endif %}
{% if action_name == 'Create a user' %}
<div class="form-row">
<div class="form-group col-md-4">
{{ userform.email.label_tag }}
@ -129,6 +143,7 @@ function submitBday() {
}
</script>
{% endif %}
<div class="form-group">
{{ userform.school.label_tag }}
@ -142,6 +157,13 @@ function submitBday() {
{{ userform.comment.label_tag }}
{% render_field userform.comment class="form-control" %}
</div>
{% if action_name == 'Create a club' %}
<div class="form-group">
{{ userform.mailing.label_tag }}
<input type="checkbox" id="{{userform.mailing.auto_id}}" name="box_mailing" />
</div>
{% endif %}
<h3>Informations avancées (facultatif)</h3>
<div class="table-responsive">
@ -155,6 +177,7 @@ function submitBday() {
{% render_field userform.shell class="form-control" placeholder=userform.shell.label %}
</td>
</tr>
{% if action_name == 'Create a user' %}
<tr>
<th>
{{ userform.gpg_fingerprint.label_tag }}
@ -163,10 +186,11 @@ function submitBday() {
{% render_field userform.gpg_fingerprint class="form-control" placeholder=userform.gpg_fingerprint.label %}
</td>
</tr>
{% endif %}
</table>
</div>
<button class="btn btn-success" type="submit">Créer un Utilisateur</button>
<button class="btn btn-success" type="submit">{{ action_name }}</button>
</form>
{% if load_js_file %}