aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2021-06-20 12:29:39 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2021-06-20 12:29:56 +0200
commit8cb645eb1125db9887360d32d9440a9ca8a1ae4d (patch)
tree5f2788f6e8cc91ec3ba9add930616132af707499
parentadd rev to version and create document from non primary group (diff)
downloadscout-subs-8cb645eb1125db9887360d32d9440a9ca8a1ae4d.tar.gz
scout-subs-8cb645eb1125db9887360d32d9440a9ca8a1ae4d.zip
add avs number to form
Diffstat (limited to '')
-rw-r--r--accounts/templates/accounts/index.html6
-rw-r--r--accounts/views.py2
-rw-r--r--client/migrations/0007_personaldata_avs_number.py18
-rw-r--r--client/migrations/0008_usercode_avs_number.py18
-rw-r--r--client/models.py2
-rw-r--r--client/templates/client/index.html6
-rw-r--r--client/views.py4
-rw-r--r--server/templates/server/doc_list.html6
-rw-r--r--server/templates/server/download_doc.html6
-rw-r--r--server/templates/server/user_list.html6
-rw-r--r--version.txt2
11 files changed, 68 insertions, 8 deletions
diff --git a/accounts/templates/accounts/index.html b/accounts/templates/accounts/index.html
index 34b2da1..1473834 100644
--- a/accounts/templates/accounts/index.html
+++ b/accounts/templates/accounts/index.html
@@ -49,10 +49,14 @@
</select>
<label>Branca</label>
</div>
- <div class="input-field col l8 s12">
+ <div class="input-field col l4 s12">
<input value="{{parent_name}}" name="parent_name" id="parent_name" type="text" >
<label for="parent_name">Nome dei genitori</label>
</div>
+ <div class="input-field col l4 s12">
+ <input value="{{avs_number}}" name="avs_number" id="avs_number" type="text" placeholder="756.1234.5678.90">
+ <label for="avs_number">Numero AVS</label>
+ </div>
<div class="input-field col l12 s12">
<input value="{{via}}" name="via" id="via" type="text" >
<label for="via">Via e numero</label>
diff --git a/accounts/views.py b/accounts/views.py
index 06b3306..c42bc52 100644
--- a/accounts/views.py
+++ b/accounts/views.py
@@ -150,6 +150,7 @@ def personal(request):
usercode.home_phone = request.POST["home_phone"]
usercode.phone = request.POST["phone"]
usercode.school = request.POST["school"]
+ usercode.avs_number = request.POST["avs_number"]
if request.POST["year"].isdigit():
usercode.year = request.POST["year"]
else:
@@ -344,6 +345,7 @@ def personal(request):
'phone': usercode.phone,
'school': usercode.school,
'year': usercode.year,
+ 'avs_number': usercode.avs_number,
'branca_default': branca_default,
'branca_castorini': branca_castorini,
'branca_lupetti': branca_lupetti,
diff --git a/client/migrations/0007_personaldata_avs_number.py b/client/migrations/0007_personaldata_avs_number.py
new file mode 100644
index 0000000..cd2a67c
--- /dev/null
+++ b/client/migrations/0007_personaldata_avs_number.py
@@ -0,0 +1,18 @@
+# Generated by Django 3.1.4 on 2021-06-20 10:06
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('client', '0006_documenttype_max_instances'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='personaldata',
+ name='avs_number',
+ field=models.CharField(default='', max_length=250),
+ ),
+ ]
diff --git a/client/migrations/0008_usercode_avs_number.py b/client/migrations/0008_usercode_avs_number.py
new file mode 100644
index 0000000..365aaad
--- /dev/null
+++ b/client/migrations/0008_usercode_avs_number.py
@@ -0,0 +1,18 @@
+# Generated by Django 3.1.4 on 2021-06-20 10:10
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('client', '0007_personaldata_avs_number'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='usercode',
+ name='avs_number',
+ field=models.CharField(default='', max_length=250),
+ ),
+ ]
diff --git a/client/models.py b/client/models.py
index d14a267..3d4e63d 100644
--- a/client/models.py
+++ b/client/models.py
@@ -33,6 +33,7 @@ class PersonalData(models.Model):
email = models.CharField(default="", max_length=250)
school = models.CharField(default="", max_length=250)
year = models.IntegerField(default=0)
+ avs_number = models.CharField(default="", max_length=250)
class MedicalData(models.Model):
@@ -111,3 +112,4 @@ class UserCode(models.Model):
phone = models.CharField(default="", max_length=250)
school = models.CharField(default="", max_length=250)
year = models.IntegerField(default=0)
+ avs_number = models.CharField(default="", max_length=250) \ No newline at end of file
diff --git a/client/templates/client/index.html b/client/templates/client/index.html
index 932af1c..7f0edec 100644
--- a/client/templates/client/index.html
+++ b/client/templates/client/index.html
@@ -109,10 +109,14 @@
<input disabled value="{{doc.4}}" id="branca" type="text">
<label for="branca">Branca</label>
</div>
- <div class="input-field col l8 s12">
+ <div class="input-field col l4 s12">
<input disabled value="{{doc.2.parent_name}}" id="parent_name" type="text" >
<label for="parent_name">Nome dei genitori</label>
</div>
+ <div class="input-field col l4 s12">
+ <input disabled value="{{doc.2.avs_number}}" id="avs_number" type="text">
+ <label for="avs_number">Numero AVS</label>
+ </div>
<div class="input-field col l12 s12">
<input value="{{doc.2.via}}" disabled id="via" type="text" >
<label for="via">Via e numero</label>
diff --git a/client/views.py b/client/views.py
index 32678f5..6f8efb3 100644
--- a/client/views.py
+++ b/client/views.py
@@ -221,7 +221,7 @@ def create(request):
# copy personal data and medical data
if document_type.personal_data:
personal_data = PersonalData(email=request.user.email, parent_name=usercode.parent_name, via=usercode.via, cap=usercode.cap, country=usercode.country,
- nationality=usercode.nationality, born_date=usercode.born_date, home_phone=usercode.home_phone, phone=usercode.phone, school=usercode.school, year=usercode.year)
+ nationality=usercode.nationality, born_date=usercode.born_date, home_phone=usercode.home_phone, phone=usercode.phone, school=usercode.school, year=usercode.year, avs_number=usercode.avs_number)
personal_data.save()
if document_type.medical_data:
@@ -281,7 +281,7 @@ def edit_wrapper(request, context):
if document.document_type.personal_data:
personal_data = PersonalData(email=request.user.email, parent_name=usercode.parent_name, via=usercode.via, cap=usercode.cap, country=usercode.country,
- nationality=usercode.nationality, born_date=usercode.born_date, home_phone=usercode.home_phone, phone=usercode.phone, school=usercode.school, year=usercode.year)
+ nationality=usercode.nationality, born_date=usercode.born_date, home_phone=usercode.home_phone, phone=usercode.phone, school=usercode.school, year=usercode.year, avs_number=usercode.avs_number)
personal_data.save()
old_data = document.personal_data
document.personal_data = personal_data
diff --git a/server/templates/server/doc_list.html b/server/templates/server/doc_list.html
index f98cbd5..fd90f12 100644
--- a/server/templates/server/doc_list.html
+++ b/server/templates/server/doc_list.html
@@ -211,10 +211,14 @@
<input disabled value="{{doc.4}}" id="branca" type="text">
<label for="branca">Branca</label>
</div>
- <div class="input-field col l8 s12">
+ <div class="input-field col l4 s12">
<input disabled value="{{doc.2.parent_name}}" id="parent_name" type="text" >
<label for="parent_name">Nome dei genitori</label>
</div>
+ <div class="input-field col l4 s12">
+ <input disabled value="{{doc.2.avs_number}}" id="avs_number" type="text">
+ <label for="avs_number">Numero AVS</label>
+ </div>
<div class="input-field col l12 s12">
<input value="{{doc.2.via}}" disabled id="via" type="text" >
<label for="via">Via e numero</label>
diff --git a/server/templates/server/download_doc.html b/server/templates/server/download_doc.html
index fe7cf18..cce0c26 100644
--- a/server/templates/server/download_doc.html
+++ b/server/templates/server/download_doc.html
@@ -51,10 +51,14 @@
<input placeholder=" " value="{{doc.4}}" id="branca" type="text">
<label class="active" for="branca">Branca</label>
</div>
- <div class="input-field col l8 s12">
+ <div class="input-field col l4 s12">
<input placeholder=" " value="{{doc.2.parent_name}}" id="parent_name" type="text" >
<label class="active" for="parent_name">Nome dei genitori</label>
</div>
+ <div class="input-field col l4 s12">
+ <input placeholder=" " value="{{doc.2.avs_number}}" id="avs_number" type="text">
+ <label for="avs_number">Numero AVS</label>
+ </div>
<div class="input-field col l12 s12">
<input placeholder=" " value="{{doc.2.via}}" id="via" type="text" >
<label class="active" for="via">Via e numero</label>
diff --git a/server/templates/server/user_list.html b/server/templates/server/user_list.html
index 31a7029..aa2f43e 100644
--- a/server/templates/server/user_list.html
+++ b/server/templates/server/user_list.html
@@ -87,10 +87,14 @@
<input disabled value="{{user.2}}" id="branca" type="text">
<label for="branca">Branca</label>
</div>
- <div class="input-field col l8 s12">
+ <div class="input-field col l4 s12">
<input disabled value="{{user.1.parent_name}}" id="parent_name" type="text" >
<label for="parent_name">Nome dei genitori</label>
</div>
+ <div class="input-field col l4 s12">
+ <input disabled value="{{user.1.avs_number}}" id="avs_number" type="text">
+ <label for="avs_number">Numero AVS</label>
+ </div>
<div class="input-field col l12 s12">
<input value="{{user.1.via}}" disabled id="via" type="text" >
<label for="via">Via e numero</label>
diff --git a/version.txt b/version.txt
index c406ae0..b64ad0e 100644
--- a/version.txt
+++ b/version.txt
@@ -1,2 +1,2 @@
version=0.2
-rev=1
+rev=2