make nav cope with missing wallets

This commit is contained in:
2023-02-01 21:31:07 +00:00
parent 5ae37eef82
commit 5798e8dcd5
5 changed files with 72 additions and 24 deletions

View File

@@ -5,7 +5,13 @@
{% block content %}
{% if user.username %}
<h2>Wallet {{wallet}} - edit settings or upload a file</h2>
{% if not create %}
<h2>Wallet {{wallet}} - edit settings or upload a file</h2>
{% else %}
<h2>Wallet {{wallet}} - Create a new Wallet</h2>
{% endif %}
</button>
{% else %}
<h2>Wallet {{wallet}}</h2>
{% endif %}
@@ -63,24 +69,27 @@
</p>
{% endif %}
<p>
{% for f in files %}
<a href="/expofiles/surveyscans/{{year}}/{{wallet|urlencode}}/{{f}}">{{ f}}</a><br />
{% empty %}
<p>&lt;No files in this wallet. &gt;
{% endfor %}
<ul>
{% for d in dirs %}
<a href="/expofiles/surveyscans/{{year}}/{{wallet|urlencode}}/{{d}}"><em>{{d}}</em></a><br />
{% endfor %}
</ul>
{% if not create %}
<p>
{% for f in files %}
<a href="/expofiles/surveyscans/{{year}}/{{wallet|urlencode}}/{{f}}">{{ f}}</a><br />
{% empty %}
<p>&lt;No files in this wallet. &gt;
{% endfor %}
<ul>
{% for d in dirs %}
<a href="/expofiles/surveyscans/{{year}}/{{wallet|urlencode}}/{{d}}"><em>{{d}}</em></a><br />
{% endfor %}
</ul>
{% endif %}
</div>
</p>
{% if create %}
This online wallet does not yet exist.
{% if user.username %}
<br><br>It will be created when you click the Create button, <em>and then edit the date in the form below and save it</em>.
<br><br>It will be created when you click the Create button, <em>and then edit the date in the form and save it</em>.
{% else %}
<br><br>To create a wallet, you need to <a href=/accounts/login/>Log In </a> first and then return to this page.
{% endif %}