summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/views/caves.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/core/views/caves.py b/core/views/caves.py
index b4c2932..c0576c6 100644
--- a/core/views/caves.py
+++ b/core/views/caves.py
@@ -251,12 +251,19 @@ def rendercave(request, cave, slug, cave_id=''):
else:
svxstem = Path(cave.survex_file).parent / Path(cave.survex_file).stem
svx3d = Path(cave.survex_file).stem
+
# NOTE the template itself loads the 3d file using javascript before it loads anything else.
# Django cannot see what this javascript is doing, so we need to ensure that the 3d file exists first.
# run this just for the side-effect of generating the 3d file? Nope, crashes.
- # TO DO - restructure this so that the regeneration is callable form here.
+ # TO DO - restructure this so that the regeneration is callable from here.
#discard_response = cave3d(request, cave_id=cave_id)
- return render(request,'cave.html', {'settings': settings, 'cave': cave, 'cavepage': True,
+
+ if request.user.is_authenticated:
+ editable = True
+ else:
+ editable = False
+ print(" ! rendercave:'{}' svxstem:{} svx3d:'{}'".format(cave, svxstem, svx3d))
+ return render(request,'cave.html', {'cave_editable': editable, 'settings': settings, 'cave': cave, 'cavepage': True,
'cave_id': cave_id, 'svxstem': svxstem, 'svx3d':svx3d})
def cavepage(request, karea, subpath):