aboutsummaryrefslogtreecommitdiffstats
path: root/accounts
diff options
context:
space:
mode:
authorAndrea Lepori <alepori@student.ethz.ch>2020-07-20 23:53:03 +0200
committerAndrea Lepori <alepori@student.ethz.ch>2020-07-20 23:53:03 +0200
commit3a175662da52cc770d52e46a9abe2cd782aa2142 (patch)
treeb65ec8d8e717b1928e47482cb54bd0787f7a0f05 /accounts
parentreset password and decorators for login check (diff)
downloadscout-subs-3a175662da52cc770d52e46a9abe2cd782aa2142.tar.gz
scout-subs-3a175662da52cc770d52e46a9abe2cd782aa2142.zip
search users, show attachments, fancy pass reset
Diffstat (limited to 'accounts')
-rw-r--r--accounts/templates/accounts/index.html19
-rw-r--r--accounts/views.py4
2 files changed, 15 insertions, 8 deletions
diff --git a/accounts/templates/accounts/index.html b/accounts/templates/accounts/index.html
index a6e6edd..01240ad 100644
--- a/accounts/templates/accounts/index.html
+++ b/accounts/templates/accounts/index.html
@@ -51,11 +51,12 @@
{% endblock%}
{% block content %}
+<form action="{% url 'personal'%}" method="post" id="form" enctype="multipart/form-data">
<div id="personal" class="row">
<div class="col l8 offset-l2 s12">
<div class="card-panel">
<div class="row">
- <form action="{% url 'personal'%}" method="post" id="form" class="col s12" enctype="multipart/form-data">
+ <div class="col 12">
<input type="hidden" name="action" id="action">
<input type="hidden" name="delete_vac" id="delete_vac">
<input type="hidden" name="delete_health" id="delete_health">
@@ -130,6 +131,7 @@
<i class="large material-icons">save</i>
</a>
</div>
+ </div>
</div>
</div>
</div>
@@ -323,6 +325,7 @@
{% block script %}
function send(id) {
+ $('#form').trigger('reinitialize.areYouSure');
var form = document.getElementById('form');
var action = document.getElementById('action');
action.setAttribute('value', id);
@@ -364,17 +367,21 @@ var options = {
labelMonthSelect: 'Seleziona un mese',
labelYearSelect: 'Seleziona un anno'
}}
+
var instance = M.Tabs.init(elem, options);
+
document.addEventListener('DOMContentLoaded', function() {
-var elems = document.querySelectorAll('.datepicker');
-var instances = M.Datepicker.init(elems, options);
+ var elems = document.querySelectorAll('.datepicker');
+ var instances = M.Datepicker.init(elems, options);
});
+
document.addEventListener('DOMContentLoaded', function() {
-var elems = document.querySelectorAll('select');
-var instances = M.FormSelect.init(elems, options);
+ var elems = document.querySelectorAll('select');
+ var instances = M.FormSelect.init(elems, options);
});
+
$(document).ready(function() {
-$('input#sickness, input#vaccine, input#allergy, input#drugs, input#misc').characterCounter();
+ $('input#sickness, input#vaccine, input#allergy, input#drugs, input#misc').characterCounter();
});
/*!
diff --git a/accounts/views.py b/accounts/views.py
index 24e1b96..369e173 100644
--- a/accounts/views.py
+++ b/accounts/views.py
@@ -99,11 +99,11 @@ def personal(request):
medic.save()
if request.POST["delete_vac"] == 'vac':
- medic.vac_certificate.delete()
+ medic.vac_certificate = None
medic.save()
if request.POST["delete_health"] == 'health':
- medic.health_care_certificate.delete()
+ medic.health_care_certificate = None
medic.save()
if len(request.user.groups.values_list('name', flat=True)) == 0: