From 68060d6118b47c54c34004b97ef13d5200cdd401 Mon Sep 17 00:00:00 2001
From: goatchurch <devnull@localhost>
Date: Mon, 27 Jul 2009 13:42:54 +0100
Subject: [PATCH] [svn] some file reading things

---
 templates/base.html                |  7 -----
 templates/calendar.html            | 19 +++++---------
 templates/logbookentry.html        |  9 ++++---
 templates/person.html              |  5 +++-
 templates/personexpedition.html    | 41 ++++++++++--------------------
 templates/survexblock.html         |  2 ++
 templates/survey.html              | 20 +++++++--------
 templates/svxfile.html             |  6 ++---
 templates/svxfilecavelist.html     | 35 +++++++++++++++++++++++++
 templates/svxfiledifflistonly.html |  2 +-
 10 files changed, 80 insertions(+), 66 deletions(-)
 create mode 100644 templates/svxfilecavelist.html

diff --git a/templates/base.html b/templates/base.html
index 7f5a278..b0c986c 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -59,13 +59,6 @@
     {% endblock %}
 
   </div>
-<div id="eyeCandyFooterPopUps" class = "eyeCandy">
-
-</div>
-{% block margins %}
-<img class="leftMargin eyeCandy" src="{{ settings.MEDIA_URL }}eieshole.jpg">
-<img class="rightMargin eyeCandy" src="{{ settings.MEDIA_URL }}goesser.jpg">
-{% endblock margins %}
 
 
 	<ul class="dropdown" id="footerLinks">
diff --git a/templates/calendar.html b/templates/calendar.html
index 0bc7dfd..4e22e78 100644
--- a/templates/calendar.html
+++ b/templates/calendar.html
@@ -37,7 +37,7 @@
 	{% if expedition %}
     	<table>
         	<tr><td />
-            	{% for date in expedition.ListDays %}               	
+                    {% for date in listdays %}               	
         	        {% ifchanged date.month %}
     	                <td class="date">{{ date|date:"F" }}</td>
                     {% else %}
@@ -46,31 +46,26 @@
                 {% endfor %}                    
         	</tr>
             <tr><td />
-            	{% for date in expedition.ListDays %}               	
+            	{% for date in listdays %}               	
 					<td class="date">{{ date|date:"D" }}</td>
                 {% endfor %}
             </tr>
         	<tr><td />
-            	{% for date in expedition.ListDays %}               	
+            	{% for date in listdays %}               	
 					<td class="date">{{ date|date:"d" }}</td>
                 {% endfor %}
             </tr>
 
-    		{% for personexpedition in expedition.personexpedition_set.all %}
+    		{% for personexpedition, pelistdays in personexpeditiondays %}
             	<tr>
                       <td class="name">
                           <a href="{{ personexpedition.person.get_absolute_url }}">{{ personexpedition.person }}</a>
-                          
                       </td>
-                      {% if personexpedition.ListDaysTF %}
-                      {% for dateTF in personexpedition.ListDaysTF %}
-                      		<td {{ dateTF|yesno:"class='yes',class='no'"|safe }}></td>
+                      {% for peday in pelistdays %}
+                      		<td {{ peday|yesno:"class='yes',class='no'"|safe }}></td>
                       {% endfor %}
-                      {% else %}
-                      		<td colspan="{{ expedition.ListDays|length }}"><center>No data.</center></td>
-                      {% endif %}
                  </tr>
             {% endfor %}
 	    </table>
     {% endif %}
-{% endblock %}
\ No newline at end of file
+{% endblock %}
diff --git a/templates/logbookentry.html b/templates/logbookentry.html
index 9e632a4..578786f 100644
--- a/templates/logbookentry.html
+++ b/templates/logbookentry.html
@@ -44,15 +44,16 @@
   </td>
 
   <td>
-  {% if persontrip.get_previous_by_date %}
-    <a href="{{ persontrip.get_persons_previous_trip.logbook_entry.get_absolute_url }}">{{persontrip.get_persons_previous_trip.date}}</a>
+  {% if persontrip.persontrip_prev %}
+    <a href="{{ persontrip.persontrip_prev.logbook_entry.get_absolute_url }}">{{persontrip.persontrip_prev.date}}</a>
   {% endif %}
   </td>
   <td>
-  {% if persontrip.get_persons_next_trip %}
-     <a href="{{ persontrip.get_persons_next_trip.logbook_entry.get_absolute_url }}">{{persontrip.get_persons_next_trip.date}}</a>
+  {% if persontrip.persontrip_next %}
+    <a href="{{ persontrip.persontrip_next.logbook_entry.get_absolute_url }}">{{persontrip.persontrip_next.date}}</a>
   {% endif %}
   </td>
+
 </tr>
 {% endfor %}
 </table>
diff --git a/templates/person.html b/templates/person.html
index 2bd4ed3..bfc9c5c 100644
--- a/templates/person.html
+++ b/templates/person.html
@@ -31,7 +31,10 @@
 <p>
 <ul>
 {% for personexpedition in person.personexpedition_set.all %}
-  <li> <a href="{{ personexpedition.get_absolute_url }}">{{personexpedition.expedition.year}}</a></li>
+  <li> <a href="{{ personexpedition.get_absolute_url }}">{{personexpedition.expedition.year}}</a>
+  <span style="padding-left:{{personexpedition.persontrip_set.all|length}}0px; background-color:red"></span> 
+      {{personexpedition.persontrip_set.all|length}} trips
+</li>
 {% endfor %}
 </ul>
 </p>
diff --git a/templates/personexpedition.html b/templates/personexpedition.html
index a0245aa..cd9cd97 100644
--- a/templates/personexpedition.html
+++ b/templates/personexpedition.html
@@ -27,37 +27,24 @@
 <h3>Table of all trips and surveys aligned by date</h3>
 <div>
 <table class="survexcontibutions">
-<tr><th>Date</th><th>Trips</th><th>Surveys</th></tr>
-{% for persondate in personexpedition.GetPersonChronology %}
+<tr><th>Date</th><th colspan="2">Trips</th><th colspan="2">Surveys</th></tr>
+{% for persondate in personchronology %}
 <tr>
   <td class="date">{{persondate.0}}</td>
 
-  <td> 
-    <table>
-    {% for persontrip in persondate.1.persontrips %}
-      <tr>
-        <td class="trip"><a href="{{ persontrip.logbook_entry.get_absolute_url }}">{{persontrip.logbook_entry.title|safe}}</a></td>
+  {% if persondate.1 %}
+     <td class="trip"><a href="{{ persondate.1.logbook_entry.get_absolute_url }}">{{persondate.1.logbook_entry.title|safe}}</a></td>
+     <td><a href="{{ persondate.1.logbook_entry.cave.get_absolute_url }}">{{persondate.1.place|safe}}</a></td>
+  {% else %}
+     <td colspan="2"> </td>
+  {% endif %}
 
-        {% if persontrip.logbook_entry.cave %}
-          <td><a href="{{ persontrip.logbook_entry.cave.get_absolute_url }}">{{persontrip.place}}</a></td>
-        {% else %}
-          <td>{{persontrip.place}}</td>
-        {% endif %}
-      </tr>
-    {% endfor %}
-    </table>
-  </td>
-  
-  <td>
-    <table>
-    {% for personsurvexroles in persondate.1.personroles.items %}
-      <tr>
-        <td class="survexblock"><a href="{% url survexblock personsurvexroles.0 %}">{{personsurvexroles.0}}</a></td>
-        <td class="roles">{{personsurvexroles.1}}</td>
-      </tr>
-    {% endfor %}
-    </table>
-  </td>
+  {% if persondate.2 %}
+    <td class="survexblock"><a href="{% url survexblock persondate.2.0 %}">{{persondate.2.0}}</a></td>
+    <td class="roles">{{persondate.2.1}}</td>
+  {% else %}
+     <td colspan="2"> </td>
+  {% endif %}
 
 </tr>
 {% endfor %}
diff --git a/templates/survexblock.html b/templates/survexblock.html
index eaf06e5..6757437 100644
--- a/templates/survexblock.html
+++ b/templates/survexblock.html
@@ -8,6 +8,8 @@
 {% block content %}
 <h2>Survex Block {{survexblock.survexpath}}</h2>
 
+<p>Link to <a href="{% url svx survexblock.filewithoutsvx %}">{{survexblock.begin_file}}</a></p>
+
 <p>Needs duplicates removed from right hand column</p>
 <p>Needs links to survex file presentation</p>
 <p>Needs to start dealing with misspellings of names (prob by editing the originals)</p>
diff --git a/templates/survey.html b/templates/survey.html
index b3214a0..37b2dfe 100644
--- a/templates/survey.html
+++ b/templates/survey.html
@@ -89,18 +89,18 @@
   </select>
 
   </center>
-<!--      	<h4>Click to toggle:</h4>-->
+      	<h4>Click to toggle:</h4>
   <div id="surveyWalletNav">
-    <div id="notes" class="menuBarItem" "> {% if notes %}&#10003;{% endif %}
+    <div id="notes" class="menuBarItem"> {% if notes %}&#10003;{% endif %}
       scanned notes </div>
-    <div id="survexFile" class="menuBarItem" "> {% if current_survey.survex_file %}&#10003;{% endif %}
+    <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 %}
+    <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 %}
+    <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 id="tunnelXMLfile" class="menuBarItem">tunnel xml file</div>
+    <div id="mainSketchIntegration" class="menuBarItem">add to main sketch</div>
   </div>
  </div>
 {% endif %}
@@ -108,9 +108,9 @@
 
 
 {% block content %}
-<div id="mainContent">
+<div id="mainContent" style="background:white">
 
-  <div id="progressTableContent" class="behind" style="overflow:auto">
+  <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">
@@ -152,7 +152,7 @@
 		<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" style="overflow: auto">
+  <div id="notesContent" class="behind" >
     <h3>Scanned notes for {{ current_survey }}.</h3>
     {% for noteItem in notes %}
     <div class="figure">
diff --git a/templates/svxfile.html b/templates/svxfile.html
index 335b2fd..d8413e3 100644
--- a/templates/svxfile.html
+++ b/templates/svxfile.html
@@ -39,16 +39,14 @@ $(document).ready(function()
 <h1>Survex File: {{ title }} .svx</h1>
 
 <form id="codewikiform" action="" method="POST">
+    <div class="codeframebit">{{form.code}}</div>
     <div style="display:none">{{form.filename}} {{form.dirname}} {{form.datetime}} {{form.outputtype}}</div>
     <input type="submit" name="diff" value="Diffy" />
     <input type="submit" name="save" value="Save"/>
     <input type="submit" name="process" value="Process" title="executes cavern"/>
     (Not implemented: <input type="submit" name="svncheckin" value="svn check-in"/>)
-    <div class="codeframebit">{{form.code}}</div>
 </form>
 
-<h4>Output</h4>
-
 <div id="difflistajax">
 <pre>
 {% for diffline in difflist %}{{diffline}}
@@ -57,7 +55,7 @@ $(document).ready(function()
 
 {% if logmessage %}
 {% if has_3d %}
-<p><a href="{{ settings.SVX_URL }}{{ title }}.3d">3d file</a></p>
+<p><a href="{% url threed title %}">3d file</a></p>
 {% else %}
 <p><b>No 3d file</b></p>
 {% endif %}
diff --git a/templates/svxfilecavelist.html b/templates/svxfilecavelist.html
new file mode 100644
index 0000000..b8ef5b6
--- /dev/null
+++ b/templates/svxfilecavelist.html
@@ -0,0 +1,35 @@
+{% extends "base.html" %}
+{% load wiki_markup %}
+{% load link %}
+
+{% block title %}List of survex files{% endblock %}
+
+{% block content %}
+<h1>List of survex directories</h1>
+
+<p>{{message}}</p>
+
+<h2>Caves of multiple files</h2>
+
+<table>
+<tr><th>Primary file</th><th>Survex files</th></tr>
+{% for primarycavefile, subcavefiles in multifilecaves %}
+  <tr>
+  <td><a href="{% url svx primarycavefile.0 %}">{{primarycavefile.1}}</a></td>
+  <td>
+    {% for cavepath, cavename in subcavefiles %}
+       <a href="{% url svx cavepath %}">{{cavename}}</a>
+    {% endfor %}
+  </td>
+  </tr>
+{% endfor %}
+</table>
+
+<h2>Caves of one file</h2>
+<p>
+{% for cavepath, cavename in onefilecaves %}
+   <a href="{% url svx cavepath %}">{{cavename}}</a>
+{% endfor %}
+</p>
+
+{% endblock %}
diff --git a/templates/svxfiledifflistonly.html b/templates/svxfiledifflistonly.html
index 09158ee..f51744e 100644
--- a/templates/svxfiledifflistonly.html
+++ b/templates/svxfiledifflistonly.html
@@ -6,7 +6,7 @@
 
 {% if logmessage %}
 {% if has_3d %}
-<p><a href="{{ settings.SVX_URL }}{{ title }}.3d">3d file</a></p>
+<p><a href="{% url threed title %}">3d file</a></p>
 {% else %}
 <p><b>No 3d file</b></p>
 {% endif %}