diff --git a/core/views/cave_kataster.py b/core/views/cave_kataster.py index 161c13f..08aced6 100644 --- a/core/views/cave_kataster.py +++ b/core/views/cave_kataster.py @@ -31,9 +31,9 @@ def kataster(request, slug): return HttpResponseRedirect("/caves") knum = 9999 - cavename = str(cave) + ".html" + filename = str(cave) + ".html" - cave_data = Path( "cave_data", cavename ) + cave_data = Path( "cave_data", filename ) if not (settings.EXPOWEB / cave_data).is_file: cave_data = "does not exist" @@ -44,7 +44,16 @@ def kataster(request, slug): if str(ent.name).startswith(str(cave)): print(ent.name) entrance_data.append("entrance_data/"+ent.name) - + + loser_name = f"caves-{str(cave.areacode)}/{str(cave.unofficial_number)}" + loser_dir = settings.SURVEX_DATA / loser_name + loser_data = [] + if (loser_dir).is_dir(): + print(loser_dir) + for svx in loser_dir.iterdir(): + print(svx) + loser_data.append(Path(loser_dir , svx).name) + if request.method == "POST": # If the form has been submitted... form = KatasterForm(request.POST) # A form bound to the POST data if form.is_valid(): @@ -61,6 +70,7 @@ def kataster(request, slug): "form": form, "cave": cave, "cave_data": cave_data, "entrance_data": entrance_data, + "loser_name": loser_name, "loser_data": loser_data, "knum": knum, }, ) diff --git a/templates/cave_kataster.html b/templates/cave_kataster.html index 0dd99a3..7273371 100644 --- a/templates/cave_kataster.html +++ b/templates/cave_kataster.html @@ -27,7 +27,7 @@ This cave needs to be "katastered". If you have the new number issued by the Aus {% endif %} -

Rename the .html files

+

Rename the .html files in expoweb

{{cave_data|safe}}

@@ -43,13 +43,21 @@ This cave needs to be "katastered". If you have the new number issued by the Aus

  • Rename all the files listed above - always do this last otherwise it is hard to automatically discover which edits have not been done. -

    Rename the cave description directory

    +

    Rename the cave description directory in expoweb

    -

    Rename the survex directory

    + +

    Rename the survex directory in loser

    +
    +{{loser_name|safe}}/ +

    +{% for f in loser_data %} +   {{f|safe}}
    +{% endfor %} +

    -

    Set the historic alias forwarder

    + +

    Sort out the *fix point(s) in both loser and in expoweb

    + + +

    Set the historic alias forwarder in expoweb

    Finally

    +

    Ideal scenario

    +

    +

    Ideally you do this renumbering on a standalone instance of troggle running on a troggle development laptop and you don't push any of the git commits to the server until you have got all the niggles out of the conversion, i.e. the databaseReset runs locally without any warnings or errors introduced by your renaming and 'cavern' runs without any new survex errors. {% endblock %}