From 50798f2814f397fbdd85b70dabca9dfb26d4cd02 Mon Sep 17 00:00:00 2001 From: Andrea Lepori Date: Sun, 9 Aug 2020 18:19:11 +0200 Subject: comment code, minor bug fixes --- client/templates/client/approve.html | 6 ++++++ client/templates/client/index.html | 42 ++++++++++++++++++++---------------- 2 files changed, 30 insertions(+), 18 deletions(-) (limited to 'client/templates/client') diff --git a/client/templates/client/approve.html b/client/templates/client/approve.html index ddfc30c..3da2677 100644 --- a/client/templates/client/approve.html +++ b/client/templates/client/approve.html @@ -30,4 +30,10 @@ {% endif %} +{% endblock %} + +{% block script %} +$(document).ready(function(){ + $('.tooltipped').tooltip(); +}); {% endblock %} \ No newline at end of file diff --git a/client/templates/client/index.html b/client/templates/client/index.html index 1915792..1a63c2e 100644 --- a/client/templates/client/index.html +++ b/client/templates/client/index.html @@ -373,25 +373,31 @@ {% block script %} $(document).ready(function(){ - $('.collapsible').collapsible(); - $('.tap-target').tapTarget(); - $('.modal').modal(); $('.tooltipped').tooltip(); - {% if empty %} - $('.tap-target').tapTarget('open'); + {% if user.is_authenticated %} + {% if user.is_staff or perms.client.approved %} + $('.collapsible').collapsible(); + $('.tap-target').tapTarget(); + $('.modal').modal(); + {% if empty %} + $('.tap-target').tapTarget('open'); + {% endif %} + {% endif %} {% endif %} }); - -$('*').click(function(event) { - if (this === event.target) { - $('.tap-target').tapTarget('close'); +{% if user.is_authenticated %} + {% if user.is_staff or perms.client.approved %} + $('*').click(function(event) { + if (this === event.target) { + $('.tap-target').tapTarget('close'); + } + }); + function send(id) { + var form = document.getElementById('form') + var action = document.getElementById('action') + action.setAttribute('value', id); + form.submit() } -}); - -function send(id) { - var form = document.getElementById('form') - var action = document.getElementById('action') - action.setAttribute('value', id); - form.submit() -} -{% endblock %} \ No newline at end of file + {% endif %} +{% endif %} +{% endblock %} -- cgit v1.2.1