diff --git a/.hgignore b/.hgignore index ad091eb..cb29426 100644 --- a/.hgignore +++ b/.hgignore @@ -6,3 +6,4 @@ db* localsettings.py *~ parsing_log.txt +troggle diff --git a/core/admin.py b/core/admin.py index 0192807..0c8b605 100644 --- a/core/admin.py +++ b/core/admin.py @@ -120,6 +120,7 @@ admin.site.register(LogbookEntry, LogbookEntryAdmin) admin.site.register(QM, QMAdmin) admin.site.register(Survey, SurveyAdmin) admin.site.register(ScannedImage) +admin.site.register(SurvexStation) admin.site.register(SurvexScansFolder) admin.site.register(SurvexScanSingle) diff --git a/core/imageposcalc.ods b/core/imageposcalc.ods new file mode 100644 index 0000000..0cc2135 Binary files /dev/null and b/core/imageposcalc.ods differ diff --git a/core/models.py b/core/models.py index e064814..a3bd832 100644 --- a/core/models.py +++ b/core/models.py @@ -249,7 +249,7 @@ class LogbookEntry(TroggleModel): filename = models.CharField(max_length=200,null=True) class Meta: - verbose_name_plural = "Logbook Entries" + verbose_name_plural = "Logbook Entries" # several PersonTrips point in to this object ordering = ('-date',) @@ -397,11 +397,14 @@ class Cave(TroggleModel): #href = models.CharField(max_length=100) + + class Meta: + ordering = ('kataster_code', 'unofficial_number') def hassurvey(self): if not self.underground_centre_line: return "No" - if (self.underground_centre_line.find(" -1 or self.underground_centre_line.find(" -1): + if (self.survey.find(" -1 or self.survey.find(" -1 or self.survey.find(" -1 or self.survey.find(" -1): return "Yes" return "Missing" @@ -501,8 +504,17 @@ class Cave(TroggleModel): u8 = u.encode("utf-8") f.write(u8) f.close() - - + + def getArea(self): + areas = self.area.all() + lowestareas = list(areas) + for area in areas: + if area.parent in areas: + try: + lowestareas.remove(area.parent) + except: + pass + return lowestareas[0] def getCaveByReference(reference): areaname, code = reference.split("-", 1) @@ -539,7 +551,7 @@ class Entrance(TroggleModel): ('P?', 'Paint (?)'), ('T', 'Tag'), ('T?', 'Tag (?)'), - ('R', 'Retagged'), + ('R', 'Needs Retag'), ('S', 'Spit'), ('S?', 'Spit (?)'), ('U', 'Unmarked'), @@ -548,7 +560,7 @@ class Entrance(TroggleModel): marking_comment = models.TextField(blank=True,null=True) FINDABLE_CHOICES = ( ('?', 'To be confirmed ...'), - ('S', 'Surveyed'), + ('S', 'Coordinates'), ('L', 'Lost'), ('R', 'Refindable')) findability = models.CharField(max_length=1, choices=FINDABLE_CHOICES, blank=True, null=True) @@ -575,21 +587,46 @@ class Entrance(TroggleModel): def find_location(self): + r = {'': 'To be entered ', + '?': 'To be confirmed:', + 'S': '', + 'L': 'Lost:', + 'R': 'Refindable:'}[self.findability] if self.tag_station: - s = SurvexStation.objects.lookup(self.tag_station) - return "%0.0fE %0.0fN %0.0fAlt" % (s.x, s.y, s.z) + try: + s = SurvexStation.objects.lookup(self.tag_station) + return r + "%0.0fE %0.0fN %0.0fAlt" % (s.x, s.y, s.z) + except: + return r + "%s Tag Station not in dataset" % self.tag_station if self.exact_station: - s = SurvexStation.objects.lookup(self.exact_station) - return "%0.0fE %0.0fN %0.0fAlt" % (s.x, s.y, s.z) + try: + s = SurvexStation.objects.lookup(self.exact_station) + return r + "%0.0fE %0.0fN %0.0fAlt" % (s.x, s.y, s.z) + except: + return r + "%s Exact Station not in dataset" % self.tag_station if self.other_station: - s = SurvexStation.objects.lookup(self.other_station) - return "%0.0fE %0.0fN %0.0fAlt %s" % (s.x, s.y, s.z, self.other_description) - if self.bearings: - return self.bearings + try: + s = SurvexStation.objects.lookup(self.other_station) + return r + "%0.0fE %0.0fN %0.0fAlt %s" % (s.x, s.y, s.z, self.other_description) + except: + return r + "%s Other Station not in dataset" % self.tag_station + if self.FINDABLE_CHOICES == "S": + r += "ERROR, Entrance has been surveyed but has no survex point" + if self.bearings: + return r + self.bearings + return r + + def best_station(self): + if self.tag_station: + return self.tag_station + if self.exact_station: + return self.exact_station + if self.other_station: + return self.other_station def has_photo(self): if self.photo: - if (self.photo.find(" -1 or self.photo.find(" -1): + if (self.photo.find(" -1 or self.photo.find(" -1 or self.photo.find(" -1 or self.photo.find(" -1): return "Yes" else: return "Missing" @@ -607,6 +644,9 @@ class Entrance(TroggleModel): def tag(self): return SurvexStation.objects.lookup(self.tag_station) + + def needs_surface_work(self): + return self.findability != "S" or not self.has_photo or self.marking != "T" def get_absolute_url(self): diff --git a/core/views_caves.py b/core/views_caves.py index 16dbaac..7a266b5 100644 --- a/core/views_caves.py +++ b/core/views_caves.py @@ -1,4 +1,7 @@ -from troggle.core.models import CaveSlug, Cave, CaveAndEntrance, Survey, Expedition, QM, CaveDescription, EntranceSlug, Entrance, Area +#!/usr/bin/python +# -*- coding: utf-8 -*- + +from troggle.core.models import CaveSlug, Cave, CaveAndEntrance, Survey, Expedition, QM, CaveDescription, EntranceSlug, Entrance, Area, SurvexStation from troggle.core.forms import CaveForm, CaveAndEntranceFormSet, VersionControlCommentForm, EntranceForm, EntranceLetterForm import troggle.core.models as models import troggle.settings as settings @@ -8,10 +11,13 @@ from django.forms.models import modelformset_factory from django import forms from django.core.urlresolvers import reverse from utils import render_with_context # see views_logbooks for explanation on this. -from django.http import HttpResponseRedirect +from django.http import HttpResponse, HttpResponseRedirect from django.conf import settings import re, urlparse from django.shortcuts import get_object_or_404 +import settings + +import Image, ImageDraw, ImageFont, string, os, sys def getCave(cave_id): """Returns a cave object when given a cave name or number. It is used by views including cavehref, ent, and qm.""" @@ -249,19 +255,21 @@ def get_qms(request, caveslug): return render_with_context(request,'options.html', {"items": [(e.entrance.slug(), e.entrance.slug()) for e in cave.entrances()]}) areanames = [ - #('', 'Location unclear'), + ('', 'Location unclear'), ('1a', '1a – Plateau: around Top Camp'), ('1b', '1b – Western plateau near 182'), ('1c', '1c – Eastern plateau near 204 walk-in path'), ('1d', '1d – Further plateau around 76'), ('2a', '2a – Southern Schwarzmooskogel near 201 path and the Nipple'), ('2b', '2b – Eishöhle area'), + ('2b or 4 (unclear)', '2b or 4 (unclear)'), ('2c', '2c – Kaninchenhöhle area'), ('2d', '2d – Steinbrückenhöhle area'), ('3', '3 – Bräuning Alm'), ('4', '4 – Kratzer valley'), ('5', '5 – Schwarzmoos-Wildensee'), ('6', '6 – Far plateau'), + ('1626 or 6 (borderline)', '1626 or 6 (borderline)'), ('7', '7 – Egglgrube'), ('8a', '8a – Loser south face'), ('8b', '8b – Loser below Dimmelwand'), @@ -274,8 +282,221 @@ areanames = [ def prospecting(request): + #for key, name in areanames: + # print key, Area.objects.get(short_name = key) + areas = [] for key, name in areanames: - print key, Area.objects.get(short_name = key) - areas = [ (name, Area.objects.get(short_name = key)) for key, name in areanames ] - return render_with_context(request,'prospecting.html', {"areas": areas}) + a = Area.objects.get(short_name = key) + caves = list(a.cave_set.all()) + caves.sort(caveCmp) + areas.append((name, a, caves)) + return render_with_context(request, 'prospecting.html', {"areas": areas}) + +# Parameters for big map and zoomed subarea maps: +# big map first (zoom factor ignored) + +maps = { +# id left top right bottom zoom +# G&K G&K G&K G&K factor +"all": [33810.4, 85436.5, 38192.0, 81048.2, 0.35, + "All"], +"40": [36275.6, 82392.5, 36780.3, 81800.0, 3.0, + "Eishöhle"], +"76": [35440.0, 83220.0, 36090.0, 82670.0, 1.3, + "Eislufthöhle"], +"204": [36354.1, 84154.5, 37047.4, 83300, 3.0, + "Steinbrückenhöhle"], +"tc": [35230.0, 82690.0, 36110.0, 82100.0, 3.0, + "Near Top Camp"], +"grieß": + [36000.0, 86300.0, 38320.0, 84400.0, 4.0, + "Grießkogel Area"], +} + +for n in maps.keys(): + L, T, R, B, S, name = maps[n] + W = (R-L)/2 + H = (T-B)/2 + for i in range(2): + for j in range(2): + maps["%s%i%i" % (n, i, j)] = [L + i * W, T - j * H, L + (i + 1) * W, T - (j + 1) * H, S, name] +# Keys in the order in which we want the maps output +mapcodes = ["all", "grieß","40", "76", "204", "tc"] +# Field codes +L = 0 +T = 1 +R = 2 +B = 3 +ZOOM = 4 +DESC = 5 + +areacolours = { + '1a' : '#00ffff', + '1b' : '#ff00ff', + '1c' : '#ffff00', + '1d' : '#ffffff', + '2a' : '#ff0000', + '2b' : '#00ff00', + '2c' : '#008800', + '2d' : '#ff9900', + '3' : '#880000', + '4' : '#0000ff', + '6' : '#000000', # doubles for surface fixed pts, and anything else + '7' : '#808080' + } + + +for FONT in [ + "/usr/share/fonts/truetype/freefont/FreeSans.ttf", + "/usr/X11R6/lib/X11/fonts/truetype/arial.ttf", + "C:\WINNT\Fonts\ARIAL.TTF" + ]: + if os.path.isfile(FONT): break +TEXTSIZE = 16 +CIRCLESIZE =8 +LINEWIDTH = 2 +myFont = ImageFont.truetype(FONT, TEXTSIZE) + +def mungecoord(x, y, mapcode, img): + # Top of Zinken is 73 1201 = dataset 34542 81967 + # Top of Hinter is 1073 562 = dataset 36670 83317 + # image is 1417 by 2201 + # FACTOR1 = 1000.0 / (36670.0-34542.0) + # FACTOR2 = (1201.0-562.0) / (83317 - 81967) + # FACTOR = (FACTOR1 + FACTOR2)/2 + # The factors aren't the same as the scanned map's at a slight angle. I + # can't be bothered to fix this. Since we zero on the Hinter it makes + # very little difference for caves in the areas round 76 or 204. + # xoffset = (x - 36670)*FACTOR + # yoffset = (y - 83317)*FACTOR + # return (1073 + xoffset, 562 - yoffset) + + m = maps[mapcode] + factorX, factorY = img.size[0] / (m[R] - m[L]), img.size[1] / (m[T] - m[B]) + return ((x - m[L]) * factorX, (m[T] - y) * factorY) + +COL_TYPES = {True: "red", + False: "#dddddd", + "Reference": "#dddddd"} + +def plot(surveypoint, number, point_type, label, mapcode, draw, img): + try: + ss = SurvexStation.objects.lookup(surveypoint) + E, N = ss.x, ss.y + shortnumber = number.replace("—","") + (x,y) = map(int, mungecoord(E, N, mapcode, img)) + #imgmaps[maparea].append( [x-4, y-SIZE/2, x+4+draw.textsize(shortnumber)[0], y+SIZE/2, shortnumber, label] ) + draw.rectangle([(x+CIRCLESIZE, y-TEXTSIZE/2), (x+CIRCLESIZE*2+draw.textsize(shortnumber)[0], y+TEXTSIZE/2)], fill="#ffffff") + draw.text((x+CIRCLESIZE * 1.5,y-TEXTSIZE/2), shortnumber, fill="#000000") + draw.ellipse([(x-CIRCLESIZE,y-CIRCLESIZE),(x+CIRCLESIZE,y+CIRCLESIZE)], fill=COL_TYPES[point_type], outline="#000000") + except: + pass + +def prospecting_image(request, name): + + mainImage = Image.open(os.path.join(settings.SURVEY_SCANS, "location_maps", "pguidemap.jpg")) + if settings.PUBLIC_SITE and not request.user.is_authenticated(): + mainImage = Image.new("RGB", mainImage.size, '#ffffff') + m = maps[name] + #imgmaps = [] + if name == "all": + img = mainImage + else: + M = maps['all'] + W, H = mainImage.size + l = int((m[L] - M[L]) / (M[R] - M[L]) * W) + t = int((m[T] - M[T]) / (M[B] - M[T]) * H) + r = int((m[R] - M[L]) / (M[R] - M[L]) * W) + b = int((m[B] - M[T]) / (M[B] - M[T]) * H) + img = mainImage.crop((l, t, r, b)) + w = int(round(m[ZOOM] * (m[R] - m[L]) / (M[R] - M[L]) * W)) + h = int(round(m[ZOOM] * (m[B] - m[T]) / (M[B] - M[T]) * H)) + img = img.resize((w, h), Image.BICUBIC) + draw = ImageDraw.Draw(img) + draw.setfont(myFont) + if name == "all": + for maparea in maps.keys(): + if maparea == "all": + continue + localm = maps[maparea] + l,t = mungecoord(localm[L], localm[T], "all", img) + r,b = mungecoord(localm[R], localm[B], "all", img) + text = maparea + " map" + textlen = draw.textsize(text)[0] + 3 + draw.rectangle([l, t, l+textlen, t+TEXTSIZE+2], fill='#ffffff') + draw.text((l+2, t+1), text, fill="#000000") + #imgmaps.append( [l, t, l+textlen, t+SIZE+2, "submap" + maparea, maparea + " subarea map"] ) + draw.line([l, t, r, t], fill='#777777', width=LINEWIDTH) + draw.line([l, b, r, b], fill='#777777', width=LINEWIDTH) + draw.line([l, t, l, b], fill='#777777', width=LINEWIDTH) + draw.line([r, t, r, b], fill='#777777', width=LINEWIDTH) + draw.line([l, t, l+textlen, t], fill='#777777', width=LINEWIDTH) + draw.line([l, t+TEXTSIZE+2, l+textlen, t+TEXTSIZE+2], fill='#777777', width=LINEWIDTH) + draw.line([l, t, l, t+TEXTSIZE+2], fill='#777777', width=LINEWIDTH) + draw.line([l+textlen, t, l+textlen, t+TEXTSIZE+2], fill='#777777', width=LINEWIDTH) + #imgmaps[maparea] = [] + # Draw scale bar + m100 = int(100 / (m[R] - m[L]) * img.size[0]) + draw.line([10, TEXTSIZE*3, 10, TEXTSIZE*2], fill='#000000', width=LINEWIDTH) + draw.line([10, TEXTSIZE*2, 10+m100, TEXTSIZE*2], fill='#000000', width=LINEWIDTH) + draw.line([10+m100, TEXTSIZE * 3, 10+m100, TEXTSIZE*2], fill='#000000', width=LINEWIDTH) + label = "100m" + draw.text([10 + (m100 - draw.textsize(label)[0]) / 2, TEXTSIZE/2], label, fill='#000000') + plot("laser.0_7", "BNase", "Reference", "Bräuning Nase laser point", name, draw, img) + plot("226-96", "BZkn", "Reference", "Bräuning Zinken trig point", name, draw, img) + plot("vd1","VD1","Reference", "VD1 survey point", name, draw, img) + plot("laser.kt114_96","HSK","Reference", "Hinterer Schwarzmooskogel trig point", name, draw, img) + plot("2000","Nipple","Reference", "Nipple (Weiße Warze)", name, draw, img) + plot("3000","VSK","Reference", "Vorderer Schwarzmooskogel summit", name, draw, img) + plot("topcamp", "TC", "Reference", "Top Camp", name, draw, img) + plot("laser.0", "LSR0", "Reference", "Laser Point 0", name, draw, img) + plot("laser.0_1", "LSR1", "Reference", "Laser Point 0/1", name, draw, img) + plot("laser.0_3", "LSR3", "Reference", "Laser Point 0/3", name, draw, img) + plot("laser.0_5", "LSR5", "Reference", "Laser Point 0/5", name, draw, img) + plot("225-96", "BAlm", "Reference", "Bräuning Alm trig point", name, draw, img) + for entrance in Entrance.objects.all(): + station = entrance.best_station() + if station: + #try: + areaName = entrance.caveandentrance_set.all()[0].cave.getArea().short_name + plot(station, "%s-%s" % (areaName, str(entrance)[5:]), entrance.needs_surface_work(), str(entrance), name, draw, img) + #except: + # pass + + for (N, E, D, num) in [(35975.37, 83018.21, 100,"177"), # Calculated from bearings + (35350.00, 81630.00, 50, "71"), # From Auer map + (36025.00, 82475.00, 50, "146"), # From mystery map + (35600.00, 82050.00, 50, "35"), # From Auer map + (35650.00, 82025.00, 50, "44"), # From Auer map + (36200.00, 82925.00, 50, "178"), # Calculated from bearings + (35232.64, 82910.37, 25, "181"), # Calculated from bearings + (35323.60, 81357.83, 50, "74") # From Auer map + ]: + (N,E,D) = map(float, (N, E, D)) + maparea = Cave.objects.get(kataster_number = num).getArea().short_name + lo = mungecoord(N-D, E+D, name, img) + hi = mungecoord(N+D, E-D, name, img) + lpos = mungecoord(N-D, E, name, img) + draw.ellipse([lo,hi], outline="#000000") + draw.ellipse([lo[0]+1, lo[1]+1, hi[0]-1, hi[1]-1], outline=areacolours[maparea]) + draw.ellipse([lo[0]+2, lo[1]+2, hi[0]-2, hi[1]-2], outline=areacolours[maparea]) + draw.rectangle([lpos[0],lpos[1]-TEXTSIZE/2, lpos[0] + draw.textsize(name)[0], lpos[1]+TEXTSIZE/2], fill="#ffffff") + draw.text((lpos[0], lpos[1]-TEXTSIZE/2), num, fill="#000000") + response = HttpResponse(content_type = "image/png") + del draw + img.save(response, "PNG") + return response + +STATIONS = {} +poslineregex = re.compile("^\(\s*([+-]?\d*\.\d*),\s*([+-]?\d*\.\d*),\s*([+-]?\d*\.\d*)\s*\)\s*([^\s]+)$") +def LoadPos(): + call([settings.CAVERN, "--output=%s/all.3d" % settings.SURVEX_DATA, "%s/all.svx" % settings.SURVEX_DATA]) + call([settings.THREEDTOPOS, '%sall.3d' % settings.SURVEX_DATA], cwd = settings.SURVEX_DATA) + posfile = open("%sall.pos" % settings.SURVEX_DATA) + posfile.readline()#Drop header + for line in posfile.readlines(): + r = poslineregex.match(line) + if r: + x, y, z, name = r.groups() + STATIONS[name] = (x, y, z) diff --git a/core/views_survex.py b/core/views_survex.py index cf3b556..3c53625 100644 --- a/core/views_survex.py +++ b/core/views_survex.py @@ -243,7 +243,8 @@ def identifycavedircontents(gcavedir): else: subsvx.append(nf) else: - assert re.match(".*?(?:.3d|.log|.err|.txt|.tmp|.diff|.e?spec|~)$", f), (gcavedir, f) + pass + #assert re.match(".*?(?:.3d|.log|.err|.txt|.tmp|.diff|.e?spec|~)$", f), (gcavedir, f) subsvx.sort() #assert primesvx, (gcavedir, subsvx) if primesvx: @@ -317,4 +318,4 @@ def survexcavesingle(request, survex_cave): - \ No newline at end of file + diff --git a/localsettingsubuntu.py b/localsettingsubuntu.py index 5a1f944..fcc8a73 100644 --- a/localsettingsubuntu.py +++ b/localsettingsubuntu.py @@ -2,13 +2,13 @@ import sys # link localsettings to this file for use on expo computer in austria DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.mysql', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. - 'NAME': 'troggle', # Or path to database file if using sqlite3. - 'USER': 'expo', # Not used with sqlite3. - 'PASSWORD': 'gosser', # Not used with sqlite3. - 'HOST': '', # Set to empty string for localhost. Not used with sqlite3. - 'PORT': '', # Set to empty string for default. Not used with sqlite3. + 'default': { + 'ENGINE': 'django.db.backends.mysql', # 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'. + 'NAME' : 'troggle', # Or path to database file if using sqlite3. + 'USER' : 'expo', # Not used with sqlite3. + 'PASSWORD' : 'gosser', # Not used with sqlite3. + 'HOST' : '', # Set to empty string for localhost. Not used with sqlite3. + 'PORT' : '', # Set to empty string for default. Not used with sqlite3. } } @@ -30,7 +30,7 @@ SURVEY_SCANS = REPOS_ROOT_PATH + 'expoimages/' FILES = REPOS_ROOT_PATH + 'expoimages' -PYTHON_PATH = REPOS_ROOT_PATH + 'hg/troggle/' +PYTHON_PATH = REPOS_ROOT_PATH + 'troggle/' #URL_ROOT = 'http://127.0.0.1:8000' URL_ROOT = "http://expoweb/" diff --git a/settings.py b/settings.py index 47d48ae..0032c2a 100644 --- a/settings.py +++ b/settings.py @@ -52,8 +52,8 @@ SECRET_KEY = 'a#vaeozn0)uz_9t_%v5n#tj)m+%ace6b_0(^fj!355qki*v)j2' # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = ( - 'django.template.loaders.filesystem.load_template_source', - 'django.template.loaders.app_directories.load_template_source', + 'django.template.loaders.filesystem.Loader', + 'django.template.loaders.app_directories.Loader', # 'django.template.loaders.eggs.load_template_source', ) diff --git a/templates/cave_entrances.html b/templates/cave_entrances.html index 3a75a02..5b70196 100644 --- a/templates/cave_entrances.html +++ b/templates/cave_entrances.html @@ -46,13 +46,13 @@
Location
{{ ent.entrance.northing|safe }}, {{ ent.entrance.easting|safe }}, {{ ent.entrance.alt|safe }}m
{% endif %} {% if ent.entrance.tag_station %} -
Tag Location
{{ ent.entrance.tag_station }}{{ ent.entrance.tag.y|safe }}, {{ ent.entrance.tag.x|safe }}, {{ ent.entrance.tag.z|safe }}m
+
Tag Location
{{ ent.entrance.tag_station }} {{ ent.entrance.tag.y|safe }}, {{ ent.entrance.tag.x|safe }}, {{ ent.entrance.tag.z|safe }}m
{% endif %} {% if ent.entrance.bearings %}
Bearings
{{ ent.entrance.bearings|safe }}
{% endif %} {% if ent.entrance.exact_station %} -
Exact Station
{{ ent.entrance.exact_station|safe }} {{ ent.exact_location.tag.y|safe }}, {{ ent.entrance.exact_location.x|safe }}, {{ ent.entrance.exact_location.z|safe }}m
+
Exact Station
{{ ent.entrance.exact_station|safe }} {{ ent.entrance.exact_location.y|safe }}, {{ ent.entrance.exact_location.x|safe }}, {{ ent.entrance.exact_location.z|safe }}m
{% endif %} {% if ent.entrance.other_station %}
Other Station
{{ ent.entrance.other_station|safe }} diff --git a/templates/prospecting.html b/templates/prospecting.html index 0d7a0d6..a2ab512 100644 --- a/templates/prospecting.html +++ b/templates/prospecting.html @@ -11,18 +11,18 @@
  • For more info on each cave, see the links to detailed description pages.
  • -{% for name, area in areas %} +{% for name, area, caves in areas %}

    {{name|safe}}

    - - +
    + - + - {% for cave in area.cave_set.all %} + {% for cave in caves %} {% if cave.singleentrance %} - + @@ -30,13 +30,32 @@ - + {% if cave.caveandentrance_set.all.0.entrance.location_description %} + + {% endif %} + {% if cave.caveandentrance_set.all.0.entrance.map_description %} + + {% endif %} + {% if cave.caveandentrance_set.all.0.entrance.approach %} + + {% endif %} + {% if cave.caveandentrance_set.all.0.entrance.findability_description %} + + {% endif %} + {% if cave.caveandentrance_set.all.0.entrance.marking_comment %} + + {% endif %} + {% if cave.caveandentrance_set.all.0.entrance.entrance_description %} + + {% endif %} + {% if cave.underground_description %} + + {% endif %} + {% else %} - + @@ -46,20 +65,39 @@ + {% if cave.underground_description %} + + {% endif %} {% for caveandentrance in cave.caveandentrance_set.all %} - + - - + + + {% if caveandentrance.entrance.location_description %} + + {% endif %} + {% if caveandentrance.entrance.map_description %} + + {% endif %} + {% if caveandentrance.entrance.approach %} + + {% endif %} + {% if caveandentrance.entrance.findability_description %} + + {% endif %} + {% if caveandentrance.entrance.marking_comment %} + + {% endif %} + {% if cave.caveandentrance_set.all.0.entrance.entrance_description %} + + {% endif %} {% endfor %} {% endif %} {% endfor %} diff --git a/urls.py b/urls.py index 106195d..fb2f698 100644 --- a/urls.py +++ b/urls.py @@ -139,6 +139,8 @@ actualurlpatterns = patterns('', (r'^photos/(?P.*)$', 'django.views.static.serve', {'document_root': settings.PHOTOS_ROOT, 'show_indexes':True}), + + url(r'^prospecting/(?P[^.]+).png$', prospecting_image, name="prospecting_image"), # (r'^gallery/(?P.*)$', 'django.views.static.serve', # {'document_root': settings.PHOTOS_ROOT, 'show_indexes':True}),
    Cave NumberNameFinishedSurvey
    Data
    Survey
    Drawn
    MarkedPhotoPositionLocation
    Cave NumberNameFinishedSurvey
    Data
    Survey
    Drawn
    MarkedPhotoPosition
    {{ cave }}{{ cave }} {{ cave.official_name|safe }} {{ cave.kataster_code }} {{ cave.hassurveydata }}{{ cave.caveandentrance_set.all.0.entrance.marking_val }} {{ cave.caveandentrance_set.all.0.entrance.has_photo }} {{ cave.caveandentrance_set.all.0.entrance.find_location }}{% if cave.caveandentrance_set.all.0.entrance.location_description %}Location: {{ cave.caveandentrance_set.all.0.entrance.location_description|safe }}{% endif %} - {% if cave.caveandentrance_set.all.0.entrance.map_description %}Map: {{ cave.caveandentrance_set.all.0.entrance.map_description|safe }}{% endif %} - {% if cave.caveandentrance_set.all.0.entrance.approach %}Approach: {{ cave.caveandentrance_set.all.0.entrance.approach|safe }}{% endif %}
    Location{{ cave.caveandentrance_set.all.0.entrance.location_description|safe }}
    Map{{ cave.caveandentrance_set.all.0.entrance.map_description|safe }}
    Approach{{ cave.caveandentrance_set.all.0.entrance.approach|safe }}
    Findability{{ cave.caveandentrance_set.all.0.entrance.findability_description|safe }}
    Marking{{ cave.caveandentrance_set.all.0.entrance.marking_comment|safe }}
    Ent Desc{{ cave.caveandentrance_set.all.0.entrance.entrance_description|safe }}
    Under Desc{{ cave.underground_description|truncatewords_html:80 }}
    {{ cave }}{{ cave }} {{ cave.official_name|safe }} {{ cave.kataster_code }} {{ cave.hassurveydata }}
    Under Desc{{ cave.underground_description|truncatewords_html:80 }}
    {{ caveandentrance.entrance_letter}}{{ caveandentrance.entrance_letter}} {{ caveandentrance.entrance.name|safe }} {{ caveandentrance.entrance.marking_val }} {{ caveandentrance.entrance.has_photo }} {{ caveandentrance.entrance.find_location|safe }}{% if cave.caveandentrance_set.all.0.entrance.location_description %}Location: {{ cave.caveandentrance_set.all.0.entrance.location_description|safe }}{% endif %} - {% if cave.caveandentrance_set.all.0.entrance.map_description %}Map: {{ cave.caveandentrance_set.all.0.entrance.map_description|safe }}{% endif %} - {% if cave.caveandentrance_set.all.0.entrance.approach %}Approach: {{ cave.caveandentrance_set.all.0.entrance.approach|safe }}{% endif %}{{ caveandentrance.entrance.find_location|safe }}
    Location{{ caveandentrance.entrance.location_description|safe }}
    Map{{ caveandentrance.entrance.map_description|safe }}
    Approach{{ caveandentrance.entrance.approach|safe }}
    Findability{{ caveandentrance.entrance.findability_description|safe }}
    Marking{{ caveandentrance.entrance.marking_comment|safe }}
    Ent Desc{{ caveandentrance.entrance.entrance_description|safe }}