Put colour bar on wallet editor

This commit is contained in:
Philip Sargent 2022-12-23 22:14:00 +00:00
parent 194470841e
commit 8374500da5
7 changed files with 35 additions and 25 deletions

View File

@ -31,7 +31,7 @@ from troggle.core.models.troggle import DataIssue
from troggle.core.models.troggle import Expedition, Person, PersonExpedition from troggle.core.models.troggle import Expedition, Person, PersonExpedition
from troggle.core.models.caves import LogbookEntry, QM, Cave, PersonTrip from troggle.core.models.caves import LogbookEntry, QM, Cave, PersonTrip
from troggle.core.models.survex import DrawingFile, Wallet, SurvexBlock, SurvexFile, SurvexPersonRole from troggle.core.models.survex import DrawingFile, Wallet, SurvexBlock, SurvexFile, SurvexPersonRole
from troggle.core.views.scans import oldwallet from troggle.core.views.scans import oldwallet, caveifywallet
from troggle.core.views.caves import getCave from troggle.core.views.caves import getCave
@ -324,6 +324,7 @@ def scanupload(request, path=None):
except: except:
print(f'!-- Wallet string {walletname}, FAIL TO GET or create WALLET OBJECT') print(f'!-- Wallet string {walletname}, FAIL TO GET or create WALLET OBJECT')
raise raise
return w
def commit_json(waldata): def commit_json(waldata):
destfolder = contents_path.parent destfolder = contents_path.parent
@ -441,7 +442,7 @@ def scanupload(request, path=None):
#print(f'--- {wd["survex file"]} - {type(wd["survex file"])}') #print(f'--- {wd["survex file"]} - {type(wd["survex file"])}')
save_json(wd) save_json(wd)
make_wallet(wallet) walletobject = make_wallet(wallet)
commit_json(wd) commit_json(wd)
else: else:
@ -479,7 +480,7 @@ def scanupload(request, path=None):
filesaved = True filesaved = True
#print(f'--- FORM scanupload multiple BUT EMPTY METADATA supposedly {WALLET_BLANK_JSON["date"]=}') #print(f'--- FORM scanupload multiple BUT EMPTY METADATA supposedly {WALLET_BLANK_JSON["date"]=}')
save_json(waldata) save_json(waldata)
make_wallet(wallet) walletobject = make_wallet(wallet)
commit_json(waldata) commit_json(waldata)
# #
# Not a POST, so a GET starts here. And also control gets here after a POST is processed. # Not a POST, so a GET starts here. And also control gets here after a POST is processed.
@ -676,10 +677,16 @@ def scanupload(request, path=None):
survexsize = str(min(len(str(waldata["survex file"])), 46)) survexsize = str(min(len(str(waldata["survex file"])), 46))
thiswallet = Wallet.objects.get(walletname=wallet)
caveifywallet(thiswallet)
thiswallet.ticks = thiswallet.get_ticks() # the complaints in colour form
#fixsurvextick(thiswallet, thiswallet.ticks)
print(thiswallet)
context = {'year': year, 'prev': prev, 'next': next, 'prevy': prevy, 'nexty': nexty, context = {'year': year, 'prev': prev, 'next': next, 'prevy': prevy, 'nexty': nexty,
'files': files, 'dirs': dirs, 'waldata': waldata, 'svxfiles': svxfiles, 'files': files, 'dirs': dirs, 'waldata': waldata, 'svxfiles': svxfiles,
'checked': checked, 'checked': checked,
'trips': trips, 'trips': trips,
'manywallets': [thiswallet],
'svxothers': svxothers, 'svxothers': svxothers,
'create': create, 'metadataurl': metadataurl, 'create': create, 'metadataurl': metadataurl,
'complaints': complaints, 'complaints': complaints,
@ -693,7 +700,7 @@ def scanupload(request, path=None):
#'url': waldata["description url"], 'urlsize': str(len(str(waldata["description url"]))), #'url': waldata["description url"], 'urlsize': str(len(str(waldata["description url"]))),
'survex': waldata["survex file"], 'survexsize': survexsize, 'survex': waldata["survex file"], 'survexsize': survexsize,
'cave': cave, 'psg': psg, 'freetext': freetext,'psgsize': str(max(12,len(str(psg)))), 'freetextsize': str(max(60,len(str(freetext))))}) 'cave': cave, 'psg': psg, 'freetext': freetext,'psgsize': str(max(12,len(str(psg)))), 'freetextsize': str(max(60,len(str(freetext))))})
else: # no wallet data: should never happen as their should be default data in all cases else: # no wallet data: should never happen as there should be default data in all cases
context = {'year': year, 'prev': prev, 'next': next, 'prevy': prevy, 'nexty': nexty, context = {'year': year, 'prev': prev, 'next': next, 'prevy': prevy, 'nexty': nexty,
'files': files, 'dirs': dirs, 'waldata': waldata, 'svxfiles': svxfiles, 'files': files, 'dirs': dirs, 'waldata': waldata, 'svxfiles': svxfiles,
'checked': checked, 'checked': checked,

View File

@ -21,6 +21,7 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c
| <a <a href="/wallets/year/{{ otherexpedition.year }}">{{otherexpedition.year}}</a> | <a <a href="/wallets/year/{{ otherexpedition.year }}">{{otherexpedition.year}}</a>
{% endfor %}</ul></ul> {% endfor %}</ul></ul>
{% include 'wallet_table.html' %} {% include 'wallet_table.html' %}
<p>Note that names in italics are copied from the related survex file block name.
<br /> <br />
<table width=95%> <table width=95%>
<tr><th>Wallet</th><th width=13%>Wallet Date</th><th>Wallet Name</th><th width=25%>People</th><th>Scans</th><th>Survex blocks</th><th>Drawings using these scans</th></tr> <tr><th>Wallet</th><th width=13%>Wallet Date</th><th>Wallet Name</th><th width=25%>People</th><th>Scans</th><th>Survex blocks</th><th>Drawings using these scans</th></tr>

View File

@ -64,10 +64,6 @@ an "S" for a survey trip. The colours are the same for people on the same trip.
{% endfor %} {% endfor %}
</table> </table>
{% if logged_in %}
<form action="" method="GET"><input type="submit" name="reload" value="Reload from logbook"></form>
{% endif %}
<h3 id="trips"> {{expedition.name}} - Records per day</h3> <h3 id="trips"> {{expedition.name}} - Records per day</h3>
<table class="expeditionlogbooks"> <table class="expeditionlogbooks">

View File

@ -20,6 +20,7 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c
{% endfor %}</ul> {% endfor %}</ul>
{% include 'wallet_table.html' %} {% include 'wallet_table.html' %}
<p>Note that names in italics are copied from the related survex file block name.
<br /> <br />
<table width=95%> <table width=95%>
<tr><th>Wallet</th><th width=13%>Wallet Date</th><th>Wallet Name</th><th width=28%>Team</th><th width=8%>>Cave</th><th>Scans</th><th>Survex blocks</th><th>Drawings using these scans</th></tr> <tr><th>Wallet</th><th width=13%>Wallet Date</th><th>Wallet Name</th><th width=28%>Team</th><th width=8%>>Cave</th><th>Scans</th><th>Survex blocks</th><th>Drawings using these scans</th></tr>

View File

@ -3,17 +3,17 @@
<tr><th>Wallet</th><th width=15%>Wallet Date</th><th>Cave</th><th>Wallet Name</th><th>Survex</th> <tr><th>Wallet</th><th width=15%>Wallet Date</th><th>Cave</th><th>Wallet Name</th><th>Survex</th>
<!-- survex file--> <!-- survex file-->
<th style="font-family: monospace; font-size: 150%;" title="Survex data">S</th> <th style="font-family: monospace; font-size: 150%;" title="Survex file exists">S</th>
<th style="font-family: monospace; font-size: 150%;" title="Survex Cave Description">C</th> <th style="font-family: monospace; font-size: 150%;" title="Cave Description in Survex file">C</th>
<th style="font-family: monospace; font-size: 150%;" title="Survex QMs">Q</th> <th style="font-family: monospace; font-size: 150%;" title="QMs in Survex file">Q</th>
<!-- scanned--> <!-- scanned-->
<th style="font-family: monospace; font-size: 150%;" title="Notes">N</th> <th style="font-family: monospace; font-size: 150%;" title="Notes exit">N</th>
<th style="font-family: monospace; font-size: 150%;" title="Plan">P</th> <th style="font-family: monospace; font-size: 150%;" title="Plan done">P</th>
<th style="font-family: monospace; font-size: 150%;" title="Elevation">E</th> <th style="font-family: monospace; font-size: 150%;" title="Elevation done">E</th>
<th style="font-family: monospace; font-size: 150%;" title="Tunnel or Therion">T</th> <th style="font-family: monospace; font-size: 150%;" title="Tunnel or Therion done">T</th>
<th style="font-family: monospace; font-size: 150%;" title="Website updated">W</th> <th style="font-family: monospace; font-size: 150%;" title="Website updated">W</th>
</tr> </tr>
@ -38,16 +38,16 @@
{% endfor %} {% endfor %}
<td style="padding:1px; background-color:{{wallet.ticks.S}}">&nbsp;</td> <td style="padding:1px; background-color:{{wallet.ticks.S}}" title="Survex file exists">&nbsp;</td>
<td style="padding:1px; background-color:{{wallet.ticks.C}}">&nbsp;</td> <td style="padding:1px; background-color:{{wallet.ticks.C}}" title="Cave Description in Survex file">&nbsp;</td>
<td style="padding:1px; background-color:{{wallet.ticks.Q}}">&nbsp;</td> <td style="padding:1px; background-color:{{wallet.ticks.Q}}" title="QMs in Survex file">&nbsp;</td>
<td style="padding:1px; background-color:{{wallet.ticks.N}}">&nbsp;</td> <td style="padding:1px; background-color:{{wallet.ticks.N}}" title="Notes exit">&nbsp;</td>
<td style="padding:1px; background-color:{{wallet.ticks.P}}">&nbsp;</td> <td style="padding:1px; background-color:{{wallet.ticks.P}}" title="Plan done">&nbsp;</td>
<td style="padding:1px; background-color:{{wallet.ticks.E}}">&nbsp;</td> <td style="padding:1px; background-color:{{wallet.ticks.E}}" title="Elevation done">&nbsp;</td>
<td style="padding:1px; background-color:{{wallet.ticks.T}}">&nbsp;</td> <td style="padding:1px; background-color:{{wallet.ticks.T}}" title="Tunnel or Therion done">&nbsp;</td>
<td style="padding:1px; background-color:{{wallet.ticks.W}}">&nbsp;</td> <td style="padding:1px; background-color:{{wallet.ticks.W}}" title="Website updated">&nbsp;</td>
</tr> </tr>
{% empty %} <h2>No Wallets for this year</h2> {% empty %} <h2>No Wallets for this year</h2>
<b>Before 1998</b> we used a survey book system, not wallets. But 1983 has some scraps recreated as wallets. <b>Before 1998</b> we used a survey book system, not wallets. But 1983 has some scraps recreated as wallets.
@ -61,4 +61,4 @@ their wallet names and the drawings that were created using them at <a href="/dw
which is probably more useful. which is probably more useful.
{% endfor %} {% endfor %}
</table> </table>
<p>Note that names in italics are copied from the related survex file block name.

View File

@ -106,7 +106,11 @@
{% endif %} {% endif %}
{% endif %} {% endif %}
<hr />
<!-- This won't work with a standard wallet object. To make it work we added extra fields to teh wallet object,-->
setting the .ticks field etc, e.g. in caveifywallet() in scans.py
{% include 'wallet_table.html' %}
{% if not create %} {% if not create %}
<br> <br>

View File

@ -28,6 +28,7 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c
</ul> </ul>
{% include 'wallet_table.html' %} {% include 'wallet_table.html' %}
<p>Note that names in italics are copied from the related survex file block name.
<br /> <br />
<table width=95%> <table width=95%>
<tr><th>Wallet</th><th width=13%>Wallet Date</th><th>Wallet Name</th><th width=25%>People</th><th width=8%>Cave</th><th>Scans</th><th>Survex blocks</th><th>Drawings using these scans</th></tr> <tr><th>Wallet</th><th width=13%>Wallet Date</th><th>Wallet Name</th><th width=25%>People</th><th width=8%>Cave</th><th>Scans</th><th>Survex blocks</th><th>Drawings using these scans</th></tr>