diff options
author | Andrea Lepori <alepori@student.ethz.ch> | 2020-07-28 20:40:06 +0200 |
---|---|---|
committer | Andrea Lepori <alepori@student.ethz.ch> | 2020-07-28 20:40:06 +0200 |
commit | 8c8981891e1fccc4a4491ffe02c26a9d4279f0e6 (patch) | |
tree | 7f73b6ae37bfa9edf43aae177e6b4fb0b66feb4c /accounts | |
parent | about page and licence (diff) | |
download | scout-subs-8c8981891e1fccc4a4491ffe02c26a9d4279f0e6.tar.gz scout-subs-8c8981891e1fccc4a4491ffe02c26a9d4279f0e6.zip |
local font feching, list for non interactive items
Diffstat (limited to 'accounts')
-rw-r--r-- | accounts/templates/accounts/index.html | 14 | ||||
-rw-r--r-- | accounts/views.py | 6 |
2 files changed, 9 insertions, 11 deletions
diff --git a/accounts/templates/accounts/index.html b/accounts/templates/accounts/index.html index 69d0717..e0674a7 100644 --- a/accounts/templates/accounts/index.html +++ b/accounts/templates/accounts/index.html @@ -11,17 +11,9 @@ {% if user.is_staff %} <li><a href="{% url 'server' %}">Pannello Admin</a></li> {% endif %} - {% if user.is_authenticated %} - <li><a href="{% url 'personal' %}">{{ user.username }}</a></li> - {% endif %} - {% if user.username != "" %} - <li> - <a href="{% url 'logout' %}"><i class="material-icons">exit_to_app</i></a> - </li> - {% else %} - <li><a href="{% url 'signup' %}">Registrazione</a></li> - <li><a href="{% url 'login' %}">Login</a></li> - {% endif %} + <li><a href="{% url 'personal' %}">{{ user.username }}</a></li> + <li><a class="tooltipped" data-position="bottom" data-tooltip="Informazioni" href="{% url 'about' %}"><i class="material-icons">info_outline</i></a></li> + <li><a href="{% url 'logout' %}"><i class="material-icons">exit_to_app</i></a></li> </ul> </div> <div class="nav-content teal"> diff --git a/accounts/views.py b/accounts/views.py index cc402d2..23f4212 100644 --- a/accounts/views.py +++ b/accounts/views.py @@ -40,12 +40,18 @@ def personal(request): if medic.vac_certificate != None: filename = os.path.basename(medic.vac_certificate.name) filename = filename[filename.find("_")+1:] + if filename.rfind('.') != -1: + filename = filename[:filename.rfind('.')] + filename = filename + ".jpg" return FileResponse(medic.vac_certificate.file, as_attachment=True, filename=filename) if request.POST['action'] == "download_health": if medic.health_care_certificate != None: filename = os.path.basename(medic.health_care_certificate.name) filename = filename[filename.find("_")+1:] + if filename.rfind('.') != -1: + filename = filename[:filename.rfind('.')] + filename = filename + ".jpg" return FileResponse(medic.health_care_certificate.file, as_attachment=True, filename=filename) request.user.first_name = request.POST["first_name"] |