aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Lepori <aleporia@gmail.com>2023-09-13 12:54:38 +0200
committerAndrea Lepori <aleporia@gmail.com>2023-09-13 12:54:39 +0200
commit3c4eccb13b7b261758fd6ef709d2a06ea0fb47df (patch)
treeade70004311698f52c8e42a745b8c20c508123d8
parentshorter approve pdf and updated terms (diff)
downloadscout-subs-3c4eccb13b7b261758fd6ef709d2a06ea0fb47df.tar.gz
scout-subs-3c4eccb13b7b261758fd6ef709d2a06ea0fb47df.zip
remove check for approved user
-rw-r--r--accounts/templates/accounts/user_edit.html4
-rw-r--r--client/templates/client/index.html22
-rw-r--r--client/views.py4
-rw-r--r--version.txt2
4 files changed, 17 insertions, 15 deletions
diff --git a/accounts/templates/accounts/user_edit.html b/accounts/templates/accounts/user_edit.html
index 3c4cada..2c0c8f4 100644
--- a/accounts/templates/accounts/user_edit.html
+++ b/accounts/templates/accounts/user_edit.html
@@ -37,7 +37,7 @@
<span class="helper-text" data-error="Campo richiesto"></span>
</div>
<div class="input-field col l4 s12">
- <input name="birth_date" value="{{birth_date}}" id="birth_date" type="text" {{validation_dic.birth_date|safe}} {{midata_disable}}>
+ <input name="birth_date" value="{{birth_date}}" class="datepicker" id="birth_date" type="text" {{validation_dic.birth_date|safe}} {{midata_disable}}>
<label for="birth_date">Data di nascita</label>
<span class="helper-text" data-error="Campo richiesto"></span>
</div>
@@ -216,7 +216,7 @@
<span class="helper-text" data-error="Campo richiesto"></span>
</div>
<div class="input-field col l4 s12">
- <input value="{{tetanus_date}}" name="tetanus_date" id="tetanus_date" type="text" {{validation_dic.tetanus_date|safe}}>
+ <input value="{{tetanus_date}}" name="tetanus_date" id="tetanus_date" class="datepicker" type="text" {{validation_dic.tetanus_date|safe}}>
<label for="tetanus_date">Ultima vacinazione contro il tetano</label>
<span class="helper-text" data-error="Campo richiesto"></span>
</div>
diff --git a/client/templates/client/index.html b/client/templates/client/index.html
index 2e714cd..1acdd8c 100644
--- a/client/templates/client/index.html
+++ b/client/templates/client/index.html
@@ -469,10 +469,9 @@
{% block script %}
$(document).ready(function(){
- {% if user.is_staff or perms.client.approved %}
$('.collapsible').collapsible();
$('.modal').modal();
- {% if docs|length == 0 and not all_invalid %}
+ {% if no_docs and not all_invalid %}
$('.tap-target').tapTarget();
$('.tap-target').tapTarget('open');
{% endif %}
@@ -486,12 +485,11 @@ $(document).ready(function(){
if (docid != undefined) {
$('#modal_approve'+docid).modal('open');
}
- {% endif %}
var lazyLoadInstance = new LazyLoad({
// Your custom settings go here
});
});
-{% if user.is_staff or perms.client.approved %}
+
{% if not all_invalid %}
$('*').click(function(event) {
if (this === event.target) {
@@ -499,12 +497,12 @@ $(document).ready(function(){
}
});
{% endif %}
- function send(id) {
- var form = document.getElementById('form')
- var action = document.getElementById('action')
- action.setAttribute('value', id);
- history.pushState(null, null, '/');
- form.submit()
- }
-{% endif %}
+
+function send(id) {
+ var form = document.getElementById('form')
+ var action = document.getElementById('action')
+ action.setAttribute('value', id);
+ history.pushState(null, null, '/');
+ form.submit()
+}
{% endblock %}
diff --git a/client/views.py b/client/views.py
index 236ae38..b470f8d 100644
--- a/client/views.py
+++ b/client/views.py
@@ -93,6 +93,7 @@ def index(request):
# divide the docs for each uc
all_invalid = True
+ no_docs = True
docs = []
for uc in ucs:
documents = Document.objects.filter(
@@ -117,14 +118,17 @@ def index(request):
invalid_flag = invalid_flag or no_attachment_flag
all_invalid = all_invalid and invalid_flag
docs.append([uc, documents, color, invalid_flag, no_attachment_flag, uc.branca == None])
+ no_docs = no_docs and (len(documents) == 0)
# show only docs of the user and non archived
vac_file = ["/server/media/", "/vac_certificate/doc"]
health_file = ["/server/media/", "/health_care_certificate/doc"]
sign_doc_file = ["/server/media/", "/signed_doc/doc"]
+ print(docs)
context = {
"docs": docs,
+ "no_docs": no_docs,
"all_invalid": all_invalid,
"vac_file": vac_file,
"health_file": health_file,
diff --git a/version.txt b/version.txt
index 0f8558e..f4c1006 100644
--- a/version.txt
+++ b/version.txt
@@ -1,2 +1,2 @@
version=0.7
-rev=7
+rev=8