forked from expo/troggle
restored cave edit capability
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
<input id="omega-autofocus" type=search name=P value="testing" size=8 autofocus>
|
||||
<input type=submit value="Search"></li>
|
||||
{% if editable %}<li><a href="{% url "editexpopage" path %}" class="editlink"><strong>Edit this page</strong></a></li>{% endif %}
|
||||
{% if cave_editable %}<li><a href="{% url "edit_cave" cave_editable %}" class="editlink"><strong>Edit this cave</strong></a></li>{% endif %}
|
||||
{% if cave_editable %}<li><a href="{% url "edit_cave" cave.slug %}" class="editlink"><strong>Edit this cave</strong></a></li>{% endif %}
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user