2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-17 23:17:11 +00:00

Revert "Added some test pages showing different ways pages could be edited. This probably wants removing soon"

This reverts commit 2af88353f3.
This commit is contained in:
Martin Green
2022-06-28 00:24:57 +01:00
parent 2af88353f3
commit dbe6d10fff
6 changed files with 3 additions and 192 deletions

View File

@@ -18,7 +18,7 @@ import troggle.settings as settings
from troggle.core.views import expo
from troggle.core.models.troggle import Expedition, DataIssue
from troggle.core.models.caves import CaveSlug, Cave, CaveAndEntrance, QM, EntranceSlug, Entrance, Area, SurvexStation, GetCaveLookup
from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, EntranceForm, EntranceLetterForm, CaveFormCodeMirrorPreview, CaveFormTextArea, CaveFormTinyMCE
from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, EntranceForm, EntranceLetterForm
from .auth import login_required_if_public
'''Manages the complex procedures to assemble a cave description out of the compnoents
@@ -297,42 +297,6 @@ def caveEntrance(request, slug):
else:
return render(request,'cave_entrances.html', {'cave': cave})
def test_edit_cave(request, editor = "codemirror"):
'''This is the form that edits all the cave data and writes out an XML file in the :expoweb: repo folder
The format for the file being saved is in templates/dataformat/cave.xml
It does save the data into into the database directly, not by parsing the file.
It does NOT yet commit to the git repoSaving is not allowed
'''
form_type = {"codemirror": CaveForm, "codemirrorpreview": CaveFormCodeMirrorPreview, "textarea": CaveFormTextArea, "tinymce": CaveFormTinyMCE}[editor]
message = ""
try:
cave = Cave.objects.get(caveslug__slug = "1623-264")
except:
return render(request,'errors/badslug.html')
if request.POST:
form = form_type(request.POST, instance=cave)
ceFormSet = CaveAndEntranceFormSet(request.POST)
#versionControlForm = VersionControlCommentForm(request.POST)
if form.is_valid() and ceFormSet.is_valid():
pass
else:
message = f'! POST data is INVALID {cave}'
print(message)
else:
form = form_type(instance=cave)
ceFormSet = CaveAndEntranceFormSet(queryset=cave.caveandentrance_set.all())
#versionControlForm = VersionControlCommentForm()
return render(request,
'editcave.html',
{'form': form, 'cave': cave, 'message': message,
'caveAndEntranceFormSet': ceFormSet,
'editor': editor,
#'versionControlForm': versionControlForm
})
@login_required_if_public
def edit_cave(request, slug=None):
'''This is the form that edits all the cave data and writes out an XML file in the :expoweb: repo folder
@@ -341,7 +305,6 @@ def edit_cave(request, slug=None):
It does save the data into into the database directly, not by parsing the file.
It does NOT yet commit to the git repo
'''
message = ""
if slug is not None:
try: