2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-21 23:01:52 +00:00

remove Survey & virtual survey wallet - never used

This commit is contained in:
Philip Sargent 2020-06-16 16:17:35 +01:00
parent 1b693da5ed
commit 9f5e779b5e
5 changed files with 1 additions and 270 deletions

View File

@ -58,18 +58,6 @@ class TroggleModel(models.Model):
class Meta:
abstract = True
class TroggleImageModel(models.Model):
new_since_parsing = models.BooleanField(default=False, editable=False)
def object_name(self):
return self._meta.object_name
def get_admin_url(self):
return urllib.parse.urljoin(settings.URL_ROOT, "/admin/core/" + self.object_name().lower() + "/" + str(self.pk))
class Meta:
abstract = True
class DataIssue(TroggleModel):
date = models.DateTimeField(auto_now_add=True, blank=True)
parser = models.CharField(max_length=50, blank=True, null=True)

View File

@ -18,7 +18,7 @@ from django.conf import settings
from django.core.urlresolvers import reverse
from django.template import Context, loader
from troggle.core.models import TroggleModel, TroggleImageModel, Person, Expedition
from troggle.core.models import TroggleModel, Person, Expedition
from troggle.core.models_survex import SurvexStation
class Area(TroggleModel):
@ -537,58 +537,6 @@ def get_scan_path(instance, filename):
if str(instance.survey.wallet_letter) != "None":
number=str(instance.survey.wallet_letter) + number #two strings formatting because convention is 2009#01 or 2009#X01
return os.path.join('./',year,year+r'#'+number,str(instance.contents)+str(instance.number_in_wallet)+r'.jpg')
# class ScannedImage(TroggleImageModel):
# file = models.ImageField(storage=scansFileStorage, upload_to=get_scan_path)
# scanned_by = models.ForeignKey(Person,blank=True, null=True)
# scanned_on = models.DateField(null=True)
# survey = models.ForeignKey('Survey')
# contents = models.CharField(max_length=20,choices=(('notes','notes'),('plan','plan_sketch'),('elevation','elevation_sketch')))
# number_in_wallet = models.IntegerField(null=True)
# lon_utm = models.FloatField(blank=True,null=True)
# lat_utm = models.FloatField(blank=True,null=True)
# #content_type = models.ForeignKey(ContentType)
# #object_id = models.PositiveIntegerField()
# #location = generic.GenericForeignKey('content_type', 'object_id')
# #This is an ugly hack to deal with the #s in our survey scan paths. The correct thing is to write a custom file storage backend which calls urlencode on the name for making file.url but not file.path.
# def correctURL(self):
# return string.replace(self.file.url,r'#',r'%23')
# def __str__(self):
# return get_scan_path(self,'')
# class Survey(TroggleModel):
# expedition = models.ForeignKey('Expedition') #REDUNDANT (logbook_entry)
# wallet_number = models.IntegerField(blank=True,null=True)
# wallet_letter = models.CharField(max_length=1,blank=True,null=True)
# comments = models.TextField(blank=True,null=True)
# location = models.CharField(max_length=400,blank=True,null=True) #REDUNDANT
# subcave = models.ForeignKey('NewSubCave', blank=True, null=True)
# #notes_scan = models.ForeignKey('ScannedImage',related_name='notes_scan',blank=True, null=True) #Replaced by contents field of ScannedImage model
# survex_block = models.OneToOneField('SurvexBlock',blank=True, null=True)
# logbook_entry = models.ForeignKey('LogbookEntry')
# centreline_printed_on = models.DateField(blank=True, null=True)
# centreline_printed_by = models.ForeignKey('Person',related_name='centreline_printed_by',blank=True,null=True)
# #sketch_scan = models.ForeignKey(ScannedImage,blank=True, null=True) #Replaced by contents field of ScannedImage model
# tunnel_file = models.FileField(upload_to='surveyXMLfiles',blank=True, null=True)
# tunnel_main_sketch = models.ForeignKey('Survey',blank=True,null=True)
# integrated_into_main_sketch_on = models.DateField(blank=True,null=True)
# integrated_into_main_sketch_by = models.ForeignKey('Person' ,related_name='integrated_into_main_sketch_by', blank=True,null=True)
# rendered_image = models.ImageField(upload_to='renderedSurveys',blank=True,null=True)
# def __str__(self):
# return self.expedition.year+"#"+"%02d" % int(self.wallet_number)
# def notes(self):
# return self.scannedimage_set.filter(contents='notes')
# def plans(self):
# return self.scannedimage_set.filter(contents='plan')
# def elevations(self):
# return self.scannedimage_set.filter(contents='elevation')
#
# Single Person going on a trip, which may or may not be written up (accounts for different T/U for people in same logbook entry)
#

View File

@ -48,14 +48,6 @@ def import_survexpos():
print("Importing Survex x/y/z Positions")
troggle.parsers.survex.LoadPos()
def import_surveyimgs():
"""This appears to store data in unused objects. The code is kept
for future re-working to manage progress against notes, plans and elevs.
"""
#import troggle.parsers.surveys
print("NOT Importing survey images")
#troggle.parsers.surveys.parseSurveys(logfile=settings.LOGFILE)
def import_tunnelfiles():
print("Importing Tunnel files")
troggle.parsers.surveys.LoadTunnelFiles()

View File

@ -1,193 +0,0 @@
{% extends "base.html" %}
{% load wiki_markup %}
{% block title %}CUCC Virtual Survey Binder: {{ current_expedition }}{{ current_survey }}{%endblock%}
{% block head %}
<link rel="stylesheet" type="text/css" href="{{ settings.MEDIA_URL }}css/nav.css" />
<script language="javascript">
blankColor = "rgb(153, 153, 153)"
highlightedColor = "rgb(125, 125, 125)"
chosenColor = "rgb(255, 255, 255)"
$(document).ready(function() {
$(".menuBarItem").click(function() {
$("#"+this.id+"Content").toggle();
if ($(this).hasClass('on')){
$(this).removeClass('on');}
else {
$(this).addClass('on');
}
});
});
function redirectSurvey(){
window.location = "{% url "survey" %}" + '/' + document.getElementById("expeditionChooser").value + "%23" + document.getElementById("surveyChooser").value;
}
function redirectYear(){
window.location = "{% url "survey" %}" + '/' + document.getElementById("expeditionChooser").value + "%23";
}
</script>
{% endblock %}
<div id="currentLocation">
CUCC Expo virtual survey binder:
{% if current_survey %}
{{current_survey}}
{% else %}
{{current_expedition}}
{% endif %}
</div>
{% block nav %}
<br />
<h3>Choose a year</h3>
<center>
<select id="expeditionChooser" class="centre" onChange="redirectYear()">
<option value=""/>
{% for expedition in expeditions %}
<option label="{{ expedition }}" value="{{ expedition }}" {% ifequal expedition current_expedition %}selected{% endifequal %}>
{{ expedition }}
</option>
{% endfor %}
</select>
</center>
<div>
<!-- <h4>Click to toggle:</h4>-->
<div id="progressTable" class="menuBarItem"> {% if current_expedition.survey_set.all %}&#10003;{% endif %}
survey progress table </div>
</div>
{% if current_expedition %}
<h3>Choose a wallet number </h3>
<center>
<select id="surveyChooser" class="centre" onChange="redirectSurvey()">
<option label="show all" value="">
</option>
{% for survey in current_expedition.survey_set.all %}
<option label="{{ survey }}" value="{{ survey.wallet_number }}"
{% ifequal survey current_survey %}
selected
{% endifequal %}>
{{ survey }}
</option>
{% endfor %}
<option label="add" value="add">
</select>
</center>
<h4>Click to toggle:</h4>
<div id="surveyWalletNav">
<div id="notes" class="menuBarItem"> {% if notes %}&#10003;{% endif %}
scanned notes </div>
<div id="survexFile" class="menuBarItem"> {% if current_survey.survex_file %}&#10003;{% endif %}
survex file </div>
<div id="printedCentreline" class="menuBarItem"> {% if current_survey.centreline_printed_on %}&#10003;{% endif %}
printed centreline </div>
<div id="scannedPassageSketch" class="menuBarItem"> {% if planSketches %}&#10003;{% endif %}
scanned passage sketch </div>
<div id="tunnelXMLfile" class="menuBarItem">tunnel xml file</div>
<div id="mainSketchIntegration" class="menuBarItem">add to main sketch</div>
</div>
</div>
{% endif %}
{% endblock %}
{% block content %}
<div id="mainContent" style="background:white">
<div id="progressTableContent" class="behind">
<h3>Survey progress table for {{ current_expedition }}</h3>
{% if current_expedition.survey_set.all %} <!-- if there are any surveys in the expedition, make the table -->
<table class="centre">
<tr>
<th> </th>
{% for survey in current_expedition.survey_set.all %}
<th> {{ survey.wallet_number }} </th>
{% endfor %} </tr>
<tr>
<td> Notes </td>
{% for survey in current_expedition.survey_set.all %}
<td> {% if survey.notes %}
&#10003;
{% endif %} </td>
{% endfor %} </tr>
<tr>
<td> Survex file </td>
{% for survey in current_expedition.survey_set.all %}
<td> {% if survey.survex_file %}
&#10003;
{% endif %} </td>
{% endfor %} </tr>
<tr>
<td> Plans </td>
{% for survey in current_expedition.survey_set.all %}
<td> {% if survey.plans %}
&#10003;
{% endif %} </td>
{% endfor %} </tr>
<tr>
<td> Elevations </td>
{% for survey in current_expedition.survey_set.all %}
<td> {% if survey.elevations %}
&#10003;
{% endif %} </td>
{% endfor %} </tr>
</table>
{% else %}
<center>[ There are no surveys in the database for this year. Put link in to add one. ]</center>
{% endif %}
</div>
<div id="notesContent" class="behind" >
<h3>Scanned notes for {{ current_survey }}.</h3>
{% for noteItem in notes %}
<div class="figure">
<p> <img src="{{ noteItem.thumbnail_image.url }}" class="thumbnail">
<p> File at: <a href="{{ noteItem.correctURL }}"> {{ noteItem.file.name }} </a> <br />
Scanned by: {{ noteItem.scanned_by }} <br />
On: {{ noteItem.scanned_on }} <br />
</p>
</p>
</div>
{% endfor %}
<div class="figure"> <a href="{{ settings.URL_ROOT }}/admin/expo/scannedimage/add/"> <img src="{{ settings.URL_ROOT }}{{ settings.ADMIN_MEDIA_PREFIX }}img/admin/icon_addlink.gif" /> Add a new scanned notes page. </a> </div>
</div>
<br class="clearfloat" />
<div id="survexFileContent" class="behind"> survex file editor, keeping file in original structure <br />
who entered by </div>
<div id="printedCentrelineContent" class="behind"> centreline </div>
<div id="scannedPassageSketchContent" class="behind">
<h3>Scanned plan sketch files for {{ current_survey }}.</h3>
{% for sketchItem in planSketches %}
<div class="figure">
<p> <img src="{{ sketchItem.thumbnail_image.url }}" class="thumbnail" />
<p> File at: <a href="{{ sketchItem.correctURL }}"> {{ sketchItem.file.name }} </a> <br />
Scanned by: {{ sketchItem.scanned_by }} <br />
On: {{ sketchItem.scanned_on }} <br />
</p>
</p>
</div>
{% endfor %}
<div class="figure"> <a href="{{ settings.URL_ROOT }}/admin/expo/scannedimage/add/"> <img src="{{ settings.URL_ROOT }}{{ settings.ADMIN_MEDIA_PREFIX }}img/admin/icon_addlink.gif" /> Add a new scanned sketch. </a> </div>
</div>
<div id="tunnelXMLfileContent" class="behind"> link to tunnel xml file. potentially instance of tunnel applet... </div>
<div id="mainSketchIntegrationContent" class="behind"> link to main sketch file </div>
<!-- end #mainContent -->
</div>
<br class="clearfloat" />
{% endblock %}

View File

@ -78,10 +78,6 @@ actualurlpatterns = patterns('',
url(r'^statistics/?$', views_statistics.stats, name="stats"),
url(r'^pathsreport.*$', views_statistics.pathsreport, name="pathsreport"),
# url(r'^survey/?$', surveyindex, name="survey"), #url referred to troggle menu..
# url(r'^survey/(?P<year>\d\d\d\d)\#(?P<wallet_number>\d*)$', survey, name="survey"), #Survey object
# Is all this lot out of date ? Maybe the logbooks work?
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"),