blob: 72733710a847a6eac993738846cb5c4291a135e6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
{% extends "base.html" %}
{% block title %}Cave re-labelling from unofficial identifier to official Kataster number
<!-- cave_kataster.html - this text visible because this template has been included -->
{% endblock %}
{% block content %}
<h2>Cave re-labelling from unofficial identifier to official Kataster number</h2>
<h3>Cave <a href="/{{cave.url|safe}}">{{cave.slug|safe}}</a> '{{cave.official_name|safe}}'</h3>
<p>
{% if cave.kataster_number %}
<b>This cave has already been "katastered". area:{{cave.areacode |safe}} number:{{cave.kataster_number |safe}}
</b>
{% else %}
This cave needs to be "katastered". If you have the new number issued by the Austrians, we can do it now.
<form action="{% url 'kataster' cave.slug %}" method="post">
{% csrf_token %}
{{form.as_p}}
<button class="fancybutton" style="padding: 0.5em 25px; font-size: 100%;" type = "submit" >
See what the edits look like →
</button>
</form>
{% endif %}
<h3>Rename the .html files in <var>expoweb</var></h3>
<div style="font-family: monospace; font-weight: bold;">
{{cave_data|safe}}
<p>
{% for e in entrance_data %}
{{e|safe}}</br />
{% endfor %}
</div>
<ul style="list-style: disc">
<li> Edit the '<samp>kataster'number</samp>' field inside the <samp>cave_data</samp> file.
<li> Edit the '<samp>entranceslug</samp>' field inside each '<samp>entrance</samp>' field in the <samp>cave_data</samp> file.
<li> Rename all the files listed above - always do this <b>last</b> otherwise it is hard to automatically discover which edits have not been done.
</ul>
<h3>Rename the cave description directory in <var>expoweb</var></h3>
<ul style="list-style: disc">
<li> Edit all the '<samp>href=</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
<li> Rename the directory (if it exists) inside the areacode directory, e.g. rename <samp>/{{cave.areacode}}/{{cave.unofficial_number}}/</samp> as <samp>/{{cave.areacode}}/{{knum}}/</samp> (if {{knum}} is the correct new kataster number). Do this last.
</ul>
<h3>Rename the survex directory in <var>loser</var></h3>
<div style="font-family: monospace; font-weight: bold;">
{{loser_name|safe}}/
<p>
{% for f in loser_data %}
{{f|safe}}</br />
{% endfor %}
</div>
<ul style="list-style: disc">
<li> Find the survex files for this cave and edit the <samp>*include</samp> inside the survex files to use the new kataster number
<li> find and edit the '*_station' tags in each entrance_data file and in the fixed points files in the loser repo.
<li> Rename the survex files
<li> Run <samp>'cavern caves-{{cave.areacode |safe}}/{{knum}}/{{knum}}.svx'</samp> and check it all works as you hope
<li> Run <samp>'cavern caves-{{cave.areacode |safe}}/caves.svx' </samp> and check it all works as you hope
</ul>
<h3>Sort out the *fix point(s) in both <var>loser</var> and in <var>expoweb</var></h3>
<ul style="list-style: disc">
<li> Find the *fix point for each entrance (one or more in each <samp>entrance_data</samp> file) in <var>expoweb</var>
<li> Change the name of each *fix point in the relevant survex file in <var>loser</var>
<li> Make the same name change(s) in each entrance file (in each <samp>entrance_data</samp> file) in <var>expoweb</var>
</ul>
<h3>Set the historic alias forwarder in <var>expoweb</var></h3>
<ul style="list-style: disc">
<li> Add the line <br /><samp>("{{cave.slug|safe}}", "{{cave.areacode |safe}}-{{knum}}"),</samp></br /> to the end
of the file <var><a href="/cave_data/cavealiases.txt_edit">cave_data/cavealiases.txt</a></var> (don't forget the comma at the end of the line)
</ul>
<h3>Finally</h3>
<ul style="list-style: disc">
<li><samp>cd loser<br />
git add *<br />
git commit -m 'Katastering {{cave.slug|safe}} to {{cave.areacode |safe}}-{{knum}}'<br />
git pull<br />
git push<br />
cd ../expoweb<br />
git add *<br />
git commit -m 'Katastering {{cave.slug|safe}} to {{cave.areacode |safe}}-{{knum}}'<br />
git pull<br />
git push<br />
</samp>
<li>It is then vital to do a complete databaseReset as troggle has internally indexed all those {{cave.slug}} files, the indexes are now out of date and horrible things will happen when people try to use troggle with any cave that has been altered:<br />
<samp>uv run databaseReset reset K{{knum}}</samp>
<li>Look in the reset import warnings and errors report to see if anything has gone wrong:
<var><a href="http://expo.survex.com/dataissues">expo.survex.com/dataissues</a></var><br />
(in fact, look at this before you do any of this, so you can see what chnages.)
</ul>
<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.
{% endblock %}
|