2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-25 08:41:51 +00:00

clean troggle menu and drawingfiles layout

This commit is contained in:
Philip Sargent 2020-07-28 01:22:06 +01:00
parent d4c79ab66b
commit 0094cf7054
7 changed files with 28 additions and 29 deletions

1
.gitignore vendored
View File

@ -42,3 +42,4 @@ _1623.3d
_1623.pos
_1623.err
diffsettings.txt
_16230.svx

View File

@ -9,7 +9,8 @@ from django.http import HttpResponse, Http404
from troggle.core.models_survex import ScansFolder, SingleScan, SurvexBlock, TunnelFile
from troggle.flatpages import views as flatviews
import parsers.surveys
#from . import fileAbstraction
def fa_readFile(*path):
try:

View File

@ -74,7 +74,7 @@ def numericalcmp(x, y):
return cmp(padnumber(x), padnumber(y))
def caveKey(x):
"""python3 function for sort.
"""python3 function for sort. Done in a hurry.
Note that cave kataster numbers are not generally integers.
This needs to be fixed make a decent sort order.
"""
@ -89,7 +89,7 @@ def getnotablecaves():
cave = Cave.objects.get(kataster_number=kataster_number)
notablecaves.append(cave)
except:
print(" ! FAILED to get only one cave per kataster_number for: "+kataster_number)
print(" ! FAILED to get only one cave per kataster_number OR invalid number for: "+kataster_number)
caves = Cave.objects.all().filter(kataster_number=kataster_number)
for c in caves:
print(c.kataster_number, c.slug())
@ -102,7 +102,6 @@ def caveindex(request):
caves = Cave.objects.all()
caves1623 = list(Cave.objects.filter(area__short_name = "1623"))
caves1626 = list(Cave.objects.filter(area__short_name = "1626"))
#python2 to python3 issue https://realpython.com/python-sort/
caves1623.sort(key=caveKey)
caves1626.sort(key=caveKey)
return render(request,'caveindex.html', {'caves1623': caves1623, 'caves1626': caves1626, 'notablecaves':getnotablecaves(), 'cavepage': True})

View File

@ -34,16 +34,14 @@
<a href="{% url "survexcaveslist" %}">All Survex</a> |
<a href="{% url "surveyscansfolders" %}">Scans</a> |
<a href="{% url "tunneldata" %}">Drawing files</a> |
<a href="{% url "survexcavessingle" "caves-1623/290/290.svx" %}">290</a> |
<a href="{% url "survexcavessingle" "caves-1623/291/291.svx" %}">291</a> |
<a href="{% url "survexcavessingle" "caves-1626/359/359.svx" %}">359</a> |
<a href="{% url "survexcavessingle" "caves-1623/258/258.svx" %}">258</a> |
<a href="{% url "survexcavessingle" "caves-1623/264/264.svx" %}">264</a> |
<a href="{% url "survexcavessingle" "264" %}">Surveys-264</a> |
<a href="/1623/290/290.html">290 (FGH)</a> |
<a href="/1623/291/291.html">291 (GSH)</a> |
<a href="/1626/359/359.html">359 (Homecoming)</a> |
<a href="{% url "survexcavessingle" "204" %}">Surveys-204</a> |
<a href="{% url "expedition" 2018 %}">Expo2018</a> |
<a href="{% url "expedition" 2019 %}">Expo2019</a> |
<a href="/admin/">Django admin</a>
<br>
@ -56,8 +54,8 @@
<a id="caversLink" href="{% url "personindex" %}">people</a> |
<a id="expeditionsLink" href="{% url "expeditions" %}">all expeditions</a> |
<a href="{% url "stats" %}">statistics</a> |
<a id="cuccLink" href="{% url "controlpanel" %}">import/export data</a>
<a href="{% url "controlpanel" %}">import/export data</a>
<a href="/admin/">Django admin</a>
</div>
<div id="nav">

View File

@ -11,13 +11,13 @@
plans and elevations. It also contains scans of centre-line survex output on which
hand-drawn passage sections are drawn. These hand-drawn passages will eventually be
traced to produce Tunnel or Therion drawings and eventually the final complete cave survey.
<table>
<table width=95%>
<tr><th>Scans folder</th><th>Files</th><th>Survex blocks</th></tr>
{% for scansfolder in manyscansfolders %}
<tr>
<td><a href="{{scansfolder.get_absolute_url}}">{{scansfolder.walletname}}</a></td>
<td>{{scansfolder.singlescan_set.all|length}}</td>
<td>
<td style="padding:2px"><a href="{{scansfolder.get_absolute_url}}">{{scansfolder.walletname}}</a></td>
<td align="right" style="padding:2px">{{scansfolder.singlescan_set.all|length}}</td>
<td style="padding:2px">
{% for survexblock in scansfolder.survexblock_set.all %}
<a href="{% url "svx" survexblock.survexfile.path %}">{{survexblock}}</a>
{% endfor %}

View File

@ -7,34 +7,32 @@
{% block content %}
<h3>All Tunnel files - references to wallets and survey scans</h3>
<table>
<tr><th>File</th><th>Font</th><th>Size</th><th>Paths</th><th>Scans folder</th><th>Scan files</th><th>Frames</th></tr>
<table style="font-size: 85%" width=95%>
<tr><th>File</th><th>Size</th><th>Paths</th><th>Scans folder</th><th>Scan files</th><th>Frames</th></tr>
{% for tunnelfile in tunnelfiles %}
<tr>
<td><a href="{% url "tunnelfile" tunnelfile.tunnelpath %}">{{tunnelfile.tunnelpath}}</a></td>
<td>{{tunnelfile.bfontcolours}}</td>
<td>{{tunnelfile.filesize}}</td>
<td>{{tunnelfile.npaths}}</td>
<td align="right" style="padding:2px">{{tunnelfile.filesize}}</td>
<td align="right" style="padding:2px">{{tunnelfile.npaths}}</td>
<td>
<td style="padding:2px">
{% for scansfolder in tunnelfile.manyscansfolders.all %}
<a href="{{scansfolder.get_absolute_url}}">{{scansfolder.walletname}}</a>
{% endfor %}
</td>
<td>
<td style="padding:2px">
{% for singlescan in tunnelfile.scans.all %}
<a href="{{singlescan.get_absolute_url}}">{{singlescan.name}}</a>
{% endfor %}
</td>
<td>
<td style="padding:2px">
{% for rtunnelfile in tunnelfile.tunnelcontains.all %}
<a href="{% url "tunnelfile" rtunnelfile.tunnelpath %}">{{rtunnelfile.tunnelpath}}</a>
{% endfor %}
</td>
</tr>
{% endfor %}
</table>

View File

@ -23,6 +23,8 @@ url( <regular expression that matches the thing in the web browser>,
Django also provides the reverse function: given an an object, provide the URL
which is vital to writing code for the webapp. So the URL dispatch is declarative.
The API urls return TSV or JSON and are new in July 2020.
"""
admin.autodiscover()
@ -33,7 +35,7 @@ admin.autodiscover()
actualurlpatterns = [
url(r'^troggle$', views_other.frontpage, name="frontpage"),
url(r'^caves$', views_caves.caveindex, name="caveindex"),
url(r'^indxal.htm$', views_caves.caveindex, name="caveindex"), # ~420 hrefs to this in expoweb files
url(r'^indxal.htm$', views_caves.caveindex, name="caveindex"), # ~420 hrefs to this url in expoweb files
url(r'^people/?$', views_logbooks.personindex, name="personindex"),
url(r'^newqmnumber/?$', views_other.ajax_QM_number, ),