From 5c0835e07630e7100dbbe07999a2afe0b27f1a0e Mon Sep 17 00:00:00 2001 From: Philip Sargent Date: Thu, 22 Sep 2022 00:25:02 +0300 Subject: create links from cave ids --- templates/manywallets.html | 4 ++-- templates/personwallets.html | 12 ++++++++++-- templates/wallet_table.html | 10 +++++++++- templates/walletform.html | 2 +- templates/yearwallets.html | 12 ++++++++++-- 5 files changed, 32 insertions(+), 8 deletions(-) diff --git a/templates/manywallets.html b/templates/manywallets.html index 04fd42a..3303c9d 100644 --- a/templates/manywallets.html +++ b/templates/manywallets.html @@ -12,7 +12,7 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c

See also wallets

@@ -33,7 +33,7 @@ see https://docs.djangoproject.com/en/3.2/ref/models/querysets/#prefetch-related {% for survexblock in scanswallet.survexblock_set.all %} {% ifchanged survexblock.survexfile.cave %} - /{{survexblock.survexfile.cave.slug}} + {{survexblock.survexfile.cave.slug}} {% endifchanged %} {% endfor %} diff --git a/templates/personwallets.html b/templates/personwallets.html index 675c3ac..147f047 100644 --- a/templates/personwallets.html +++ b/templates/personwallets.html @@ -14,7 +14,7 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c

See also wallets

{% include 'wallet_table.html' %} @@ -28,7 +28,15 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c {% if wallet.date %}{{wallet.date}}{% else %} {% endif %} {% if wallet.name %}{{wallet.name}}{% else %}{% if wallet.displaynames %} {% for dn in wallet.displaynames %}{{dn}}{%if not forloop.last %}, {% endif %} {% endfor %}{% else %} {% endif %}{% endif %} {{wallet.persons}} - {% if wallet.cave %}{{wallet.cave}}{% else %} {% endif %} + + {% if wallet.cave %} + {% if wallet.cave.slug %} + {{wallet.cave}} + {% else %} + {{wallet.cave}} + {% endif %} + {% else %} + {% endif %} {{wallet.singlescan_set.all|length}} diff --git a/templates/wallet_table.html b/templates/wallet_table.html index f35d28a..b83bb16 100644 --- a/templates/wallet_table.html +++ b/templates/wallet_table.html @@ -22,7 +22,15 @@ {{wallet.walletname}} {% if wallet.date %}{{wallet.date}}{% else %} {% endif %} - {% if wallet.cave %}{{wallet.cave}}{% else %} {% endif %} + + {% if wallet.cave %} + {% if wallet.cave.slug %} + {{wallet.cave}} + {% else %} + {{wallet.cave}} + {% endif %} + {% else %} + {% endif %} {% if wallet.name %}{{wallet.name}}{% else %}{% if wallet.displaynames %} {% for dn in wallet.displaynames %}{{dn}}{%if not forloop.last %}, {% endif %} {% endfor %}{% else %} {% endif %}{% endif %} {% for survexblock in wallet.survexblock_set.all %} diff --git a/templates/walletform.html b/templates/walletform.html index 41df051..e1520fe 100644 --- a/templates/walletform.html +++ b/templates/walletform.html @@ -138,7 +138,7 @@
diff --git a/templates/yearwallets.html b/templates/yearwallets.html index 51a56c0..a6391e3 100644 --- a/templates/yearwallets.html +++ b/templates/yearwallets.html @@ -15,7 +15,7 @@ traced to produce Tunnel or Therion drawings and eventually the final complete c

See also wallets