diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2020-07-28 01:22:06 +0100 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2020-07-28 01:22:06 +0100 |
commit | 0094cf7054c839d5ff62e970c85e2de3f4c6334d (patch) | |
tree | 0ca5a1c39a41b338b07259a619c22040a4678cb3 | |
parent | d4c79ab66ba6ad817e45bed20a6159370ba2305a (diff) | |
download | troggle-0094cf7054c839d5ff62e970c85e2de3f4c6334d.tar.gz troggle-0094cf7054c839d5ff62e970c85e2de3f4c6334d.tar.bz2 troggle-0094cf7054c839d5ff62e970c85e2de3f4c6334d.zip |
clean troggle menu and drawingfiles layout
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | core/view_surveys.py | 3 | ||||
-rw-r--r-- | core/views_caves.py | 5 | ||||
-rw-r--r-- | templates/base.html | 16 | ||||
-rw-r--r-- | templates/manyscansfolders.html | 8 | ||||
-rw-r--r-- | templates/tunnelfiles.html | 18 | ||||
-rw-r--r-- | urls.py | 6 |
7 files changed, 28 insertions, 29 deletions
@@ -42,3 +42,4 @@ _1623.3d _1623.pos _1623.err diffsettings.txt +_16230.svx diff --git a/core/view_surveys.py b/core/view_surveys.py index c1fec57..dae6f31 100644 --- a/core/view_surveys.py +++ b/core/view_surveys.py @@ -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: diff --git a/core/views_caves.py b/core/views_caves.py index c4d06a1..5820857 100644 --- a/core/views_caves.py +++ b/core/views_caves.py @@ -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}) diff --git a/templates/base.html b/templates/base.html index c38710d..282ec3e 100644 --- a/templates/base.html +++ b/templates/base.html @@ -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"> diff --git a/templates/manyscansfolders.html b/templates/manyscansfolders.html index 00f5bdc..c392af9 100644 --- a/templates/manyscansfolders.html +++ b/templates/manyscansfolders.html @@ -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 %} diff --git a/templates/tunnelfiles.html b/templates/tunnelfiles.html index 472bd59..9c527b9 100644 --- a/templates/tunnelfiles.html +++ b/templates/tunnelfiles.html @@ -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> @@ -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, ), @@ -86,7 +88,7 @@ actualurlpatterns = [ url(r'^controlpanel/?$', views_other.controlPanel, name="controlpanel"), url(r'^logbook(?P<year>\d\d\d\d)\.(?P<extension>.*)/?$',views_other.downloadLogbook), url(r'^logbook/?$',views_other.downloadLogbook, name="downloadlogbook"), - url(r'^cave/(?P<cave_id>[^/]+)/qm\.csv/?$', views_other.downloadQMs, name="downloadqms"), + url(r'^cave/(?P<cave_id>[^/]+)/qm\.csv/?$', views_other.downloadQMs, name="downloadqms"), url(r'^downloadqms$', views_other.downloadQMs), url(r'^admin/doc/', include('django.contrib.admindocs.urls')), # needs docutils Python module (http://docutils.sf.net/). |