[svn r8038] add personindex templates

This commit is contained in:
julian 2008-10-27 01:36:06 +01:00
parent 1577624c28
commit 7dc74cf94c
6 changed files with 59 additions and 11 deletions

View File

@ -1,2 +1,3 @@
from views_caves import *
from views_survex import *
from views_survex import *
from views_logbooks import *

View File

@ -7,14 +7,6 @@ import re
import os
import datetime
# Dave Johnson (Stonker) is hacked -- are there two of this DJ name
# Dave Collins (Scout) is hacked
# Letty ten Harkel has middle , tu = timeug or ""name removed
# the <span lang=""sv""> have been removed
# Dave Milne (Lummat)
# Ben van Millingen
# Rebecca Lawson (Becka)
persontab = open(os.path.join(settings.EXPOWEB, "noinfo", "folk.csv"))
personreader = csv.reader(persontab)
headers = personreader.next()
@ -186,7 +178,7 @@ def Parseloghtmltxt(year, expedition, txt):
def LoadLogbooks():
models.LogbookEntry.objects.all().delete()
expowebbase = os.path.join(settings.EXPOWEB, "years") # this could be a url
expowebbase = os.path.join(settings.EXPOWEB, "years")
yearlinks = [
# ("2008", "2008/logbook/2008logbook.txt"),
# ("2007", "2007/logbook/2007logbook.txt"),

View File

@ -67,7 +67,7 @@ MIDDLEWARE_CLASSES = (
ROOT_URLCONF = 'troggle.urls'
TEMPLATE_DIRS = (
"templates"
"/home/mjg/expoweb/troggle/templates"
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.

View File

@ -0,0 +1,24 @@
{% extends "base.html" %}
{% load wiki_markup %}
{% block title %}Person {{person.id}}{% endblock %}
{% block content %}
<div class="personblock"><a href="/person/{{person.id}}">{{person}}</a>
<ul>
{% for personexpedition in person.personexpedition_set.all %}
<li>
<table><tr><td>
{{personexpedition.expedition}}
</td><td>
<div>
{% for persontrip in personexpedition.persontrip_set.all %}
<a href="/logbook/{{persontrip.logbookentry.id}}">{{persontrip.date}}</a>
{% endfor %}
</div>
</td></tr></table>
</li>
{% endfor %}
</ul>
</div>
{% endblock %}

View File

@ -0,0 +1,26 @@
{% extends "base.html" %}
{% load wiki_markup %}
{% block title %}Person Index{% endblock %}
{% block content %}
{% for person in persons %}
<div class="personblock"><a href="/person/{{person.id}}">{{person}}</a>
<ul>
{% for personexpedition in person.personexpedition_set.all %}
<li>
<table><tr><td>
{{personexpedition.expedition}}
</td><td>
<div>
{% for persontrip in personexpedition.persontrip_set.all %}
<a href="/logbook/{{persontrip.logbookentry.id}}">{{persontrip.date}}</a>
{% endfor %}
</div>
</td></tr></table>
</li>
{% endfor %}
</ul>
</div>
{% endfor %}
{% endblock %}

View File

@ -9,11 +9,16 @@ urlpatterns = patterns('',
(r'^troggle/cave/$', caveindex),
(r'^troggle/cave/(?P<cave_id>[^/]+)/$', cave),
(r'^troggle/cave/(?P<cave_id>[^/]+)/(?P<ent_letter>[^/]?)$', ent),
(r'^troggle/survex/(?P<survex_file>.*)\.index$', index),
(r'^troggle/survex/(?P<survex_file>.*)\.svx$', svx),
(r'^troggle/survex/(?P<survex_file>.*)\.3d$', threed),
(r'^troggle/survex/(?P<survex_file>.*)\.log$', log),
(r'^troggle/survex/(?P<survex_file>.*)\.err$', err),
(r'^person/$', personindex),
(r'^person/(.*)$', person),
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
(r'^admin/(.*)', admin.site.root),