diff options
-rw-r--r-- | core/models/survex.py | 2 | ||||
-rw-r--r-- | core/views/scans.py | 9 | ||||
-rw-r--r-- | parsers/scans.py | 6 | ||||
-rw-r--r-- | parsers/survex.py | 2 | ||||
-rw-r--r-- | templates/cavewallets.html | 4 | ||||
-rw-r--r-- | templates/personwallets.html | 2 | ||||
-rw-r--r-- | templates/wallet_table.html | 3 | ||||
-rw-r--r-- | templates/yearwallets.html | 2 |
8 files changed, 22 insertions, 8 deletions
diff --git a/core/models/survex.py b/core/models/survex.py index e5fd150..cdf3e59 100644 --- a/core/models/survex.py +++ b/core/models/survex.py @@ -280,7 +280,7 @@ class Wallet(models.Model): waldata["survex file"] = [waldata["survex file"]] ngood = 0 nbad = 0 - ticks["S"] = "lightblue" + ticks["S"] = "black" for svx in waldata["survex file"]: if svx !="": if (Path(settings.SURVEX_DATA) / svx).is_file(): diff --git a/core/views/scans.py b/core/views/scans.py index 8c380c1..7274563 100644 --- a/core/views/scans.py +++ b/core/views/scans.py @@ -55,12 +55,21 @@ def caveifywallet(w): '''Gets the cave from the list of survex files, only selects one of them though. Only used for display. ''' + blocknames = [] blocks = SurvexBlock.objects.filter(scanswallet = w) for b in blocks: # NB b.cave is not populated by parser. Use b.survexfile.cave instead, or we could parse b.survexpath if b.survexfile.cave: w.cave = b.survexfile.cave # just gets the last one, randomly. SHould make this a list or many:many ideally + if b.name: + blocknames.append(b.name) + + if w.name(): + w.displaynames = [w.name()] + else: + w.displaynames = blocknames + def fillblankpeople(w): wp = w.people() if not wp: # an -empty list diff --git a/parsers/scans.py b/parsers/scans.py index b18dd64..f9ec449 100644 --- a/parsers/scans.py +++ b/parsers/scans.py @@ -72,6 +72,10 @@ def load_all_scans(): and builds up the models we can access later. It does NOT read or validate anything in the JSON data attached to each wallet. Those checks are done at runtime, when a wallet is accessed, not at import time. + + NOTE that parsers/survex.py does NOT create a wallet if it finds an unrecognised *REF wallet. + Instead it reports an error in DataIssues. But it does make a link in the db between the + existing wallet (probably no JSON, just a folder containing scans) and the survex file. ''' print(' - Loading Survey Scans') @@ -113,7 +117,7 @@ def load_all_scans(): else: - # but We should load all the scans, even for nonstandard names. + # but We *should* load all the scans, even for nonstandard names. print(f'\n - IGNORE {walletname} - {fpath}') # but we also need to check if JSON exists, even if there are no uploaded scan files diff --git a/parsers/survex.py b/parsers/survex.py index 07f5799..4eec86b 100644 --- a/parsers/survex.py +++ b/parsers/survex.py @@ -514,7 +514,7 @@ class LoadingSurvex(): print(manywallets[0]) survexblock.save() if len(manywallets) > 1: - message = " ! Wallet *REF {} - more than one found {} scan folders in {}".format(refscan, len(manywallets), survexblock.survexfile.path) + message = " ! Wallet *REF {} - more than one found {} scan folders in block {}".format(refscan, len(manywallets), survexblock.survexfile.path) print(self.insp+message) DataIssue.objects.create(parser='survex', message=message, url=url) else: diff --git a/templates/cavewallets.html b/templates/cavewallets.html index df3b009..1647c0c 100644 --- a/templates/cavewallets.html +++ b/templates/cavewallets.html @@ -27,8 +27,8 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c <td style="padding:2px"><a href="{{wallet.get_absolute_url}}">{{wallet.walletname}}</a></td> <td style="padding:2px">{% if wallet.date %}{{wallet.date}}{% else %} {% endif %}</td> - <td style="padding:2px">{% if wallet.name %}{{wallet.name}}{% else %} {% endif %}</td> - <td style="padding:2px">{{wallet.persons}}</td> + <td style="padding:2px">{% if wallet.name %}{{wallet.name}}{% else %}<em>{% if wallet.displaynames %} {% for dn in wallet.displaynames %}{{dn}}{%if not forloop.last %}, {% endif %} {% endfor %}{% else %} {% endif %}</em>{% endif %}</td> + <td style="padding:2px">{{wallet.persons }} </td> <td align="center" style="padding:2px"><a href="{{wallet.get_absolute_url}}">{{wallet.singlescan_set.all|length}}</a></td> <td style="padding:2px"> diff --git a/templates/personwallets.html b/templates/personwallets.html index 0ec4f63..0c52765 100644 --- a/templates/personwallets.html +++ b/templates/personwallets.html @@ -26,7 +26,7 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c <td style="padding:2px"><a href="{{wallet.get_absolute_url}}">{{wallet.walletname}}</a></td> <td style="padding:2px" >{% if wallet.date %}{{wallet.date}}{% else %} {% endif %}</td> - <td style="padding:2px">{% if wallet.name %}{{wallet.name}}{% else %} {% endif %}</td> + <td style="padding:2px">{% if wallet.name %}{{wallet.name}}{% else %}<em>{% if wallet.displaynames %} {% for dn in wallet.displaynames %}{{dn}}{%if not forloop.last %}, {% endif %} {% endfor %}{% else %} {% endif %}</em>{% endif %}</td> <td style="padding:2px">{{wallet.persons}}</td> <td style="padding:2px">{% if wallet.cave %}{{wallet.cave}}{% else %} {% endif %}</td> diff --git a/templates/wallet_table.html b/templates/wallet_table.html index bad144a..a7114d1 100644 --- a/templates/wallet_table.html +++ b/templates/wallet_table.html @@ -23,7 +23,7 @@ <td style="padding:2px">{% if wallet.date %}{{wallet.date}}{% else %} {% endif %}</td> <td style="padding:2px">{% if wallet.cave %}{{wallet.cave}}{% else %} {% endif %}</td> - <td style="padding:2px">{% if wallet.name %}{{wallet.name}}{% else %} {% endif %}</td> + <td style="padding:2px">{% if wallet.name %}{{wallet.name}}{% else %}<em>{% if wallet.displaynames %} {% for dn in wallet.displaynames %}{{dn}}{%if not forloop.last %}, {% endif %} {% endfor %}{% else %} {% endif %}</em>{% endif %}</td> <td style="padding:1px; background-color:{{wallet.ticks.S}}"> </td> <td style="padding:1px; background-color:{{wallet.ticks.C}}"> </td> @@ -38,3 +38,4 @@ </tr> {% endfor %} </table> +<p>Note that names in italics are copied from the related survex file block name. diff --git a/templates/yearwallets.html b/templates/yearwallets.html index df6c7ac..231f0e9 100644 --- a/templates/yearwallets.html +++ b/templates/yearwallets.html @@ -26,7 +26,7 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c <td style="padding:2px"><a href="{{wallet.get_absolute_url}}">{{wallet.walletname}}</a></td> <td style="padding:2px">{% if wallet.date %}{{wallet.date}}{% else %} {% endif %}</td> - <td style="padding:2px">{% if wallet.name %}{{wallet.name}}{% else %} {% endif %}</td> + <td style="padding:2px">{% if wallet.name %}{{wallet.name}}{% else %}<em>{% if wallet.displaynames %} {% for dn in wallet.displaynames %}{{dn}}{%if not forloop.last %}, {% endif %} {% endfor %}{% else %} {% endif %}</em>{% endif %}</td> <td style="padding:2px">{{wallet.persons}}</td> <td style="padding:2px">{% if wallet.cave %}{{wallet.cave}}{% else %} {% endif %}</td> |