diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2025-02-08 23:04:19 +0000 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2025-02-08 23:04:19 +0000 |
commit | c4f990f002eb451c729d580beec1bd696714203c (patch) | |
tree | fec44d83927ddf7f835d5b90317f1df66db95b37 | |
parent | 875145fc386d8e5ad65d824b436289ba9d60688e (diff) | |
download | troggle-c4f990f002eb451c729d580beec1bd696714203c.tar.gz troggle-c4f990f002eb451c729d580beec1bd696714203c.tar.bz2 troggle-c4f990f002eb451c729d580beec1bd696714203c.zip |
Better description
-rw-r--r-- | core/views/editor_helpers.py | 2 | ||||
-rw-r--r-- | templates/cave_fix.html | 17 |
2 files changed, 10 insertions, 9 deletions
diff --git a/core/views/editor_helpers.py b/core/views/editor_helpers.py index f6369f9..01e526b 100644 --- a/core/views/editor_helpers.py +++ b/core/views/editor_helpers.py @@ -149,7 +149,7 @@ def new_image_form(request, path): thumbnail.save(tb, format="jpeg", quality = 70) image_rel_path, thumb_rel_path, desc_rel_path = form.get_rel_paths() print(f"new_image_form(): \n {image_rel_path=}\n {thumb_rel_path=}\n {desc_rel_path=}") - image_page_template = loader.get_template("image_page_template.html") # this is the .html file in the /l/ folder + image_page_template = loader.get_template("image_page_template.html") image_page = image_page_template.render( { "header": form.cleaned_data["header"], diff --git a/templates/cave_fix.html b/templates/cave_fix.html index 41b21f7..ec4b021 100644 --- a/templates/cave_fix.html +++ b/templates/cave_fix.html @@ -9,6 +9,11 @@ <h2>Cave fix misplaced images and descriptive files</h2> +This page and the code behind it ( in troggle/core/views/cave_kataster.py) is for one-off data reformatting and rearrangment fixes. Once the fix has been done it never needs to be done again. +<p>This is in contrast to the <a href="/kataster/1623-1992-X01">katastering tool</a> which is used regularly: whenever a cave with a discovery unofficial name gets an official kataster number. +<p> +In the past we have reformatted the URLs and filenames for caves which were incompletely katastered, and for caves where for several months the images in the cave descriptions were put in the worng place by unfinished software. In the future we expect to have to tidy up the incoherent QMs system, move non-cave "guidebook" material out of the /1623/ directory tree, extract EXIF GPS data from photos and a lot more. Making the logbook entries have properly persistent internal IDs would also be a good thing. + <form action="{% url 'fix' areacode %}" method="post"> <p> @@ -24,20 +29,16 @@ <h3>Rename the cave description directories in <var>expoweb/<a href="/{{areacode|safe}}">{{areacode|safe}}</a>/</var></h3> -In 1623 there are <strike>82</strike> 69 cave description sub-files, i.e. single pages with a larger image and caption using the t/i/l convention, are not in <br> -<samp><b>1623/[cave]/l/*.html</b></samp> but are directly in <br /> -<samp><b>1623/l/[cave]*.html</b></samp> <br> -due to early versions of Martin's image insertion tool for editing cave descriptions. 21 of these <strike>do</strike> did not even have filenames beginning with [cave], the cave unofficial identifier, but are all digits. They seem to be all 2023 discoveries or caves which have had images added to their descriptions in 2023. +Done. + <p><b><samp> {% if misplaced %} <samp><b>1623/l/ :</samp></b><br /> {% endif %} {{misplaced|safe}} </samp></b><br /> -If we don't edit these, things will still work, i.e. cave description images will still appear, but the names of the files no longer match the new kataster name of the cave. This renaming tool fixes this - so that these files are stored together with the rest of the stuff just for that cave. -It needed doing as troggle does some weird perversions to display these images and these code perversions which lead to odd glitches can now be removed. -<p> +<h3>Fix the old-style URLS "115/ent.jpg" to "ent.jpg" or "/1623/115/ent.jpg" in <var>expoweb/<a href="/{{areacode|safe}}">{{areacode|safe}}</a>/</var></h3> <p> <ul style="list-style: disc"> <li> Edit all the '<samp>href=</samp>' and '<samp>src=</samp>' <small>URLS</small> (if they exist) inside all the <samp>cave_data</samp> and <samp>entrance_data</samp> files descriptive text to refer to the new directory @@ -66,7 +67,7 @@ OR we can do an online rename of the "Cave" object in the database [code yet to <h3>Ideal scenario</h3> <p> -<p>Ideally you do this renumbering on a standalone instance of troggle running on a <var> ⚒ <a href="/handbook/troggle/troglaptop.html">troggle development laptop</a></var> 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 <em>and</em> 'cavern' runs without any new survex errors. +<p>Ideally you do this renumbering and fixups on a standalone instance of troggle running on a <var> ⚒ <a href="/handbook/troggle/troglaptop.html">troggle development laptop</a></var> 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 <em>and</em> 'cavern' runs without any new survex errors. <h3>Copy this script and edit it to match the directory names on your PC</h3> <textarea id="script" name="script" rows="{{rows}}" cols="110" style="font-size:small; font-weight: bold; background-color: LemonChiffon"> |