forked from expo/troggle
d25fd97864
Got rid of the url tags in template, replaced them with get_absolute_url method calls where possible. Adding get_absolute_url in models enables direct link to the public model views in admin. The use of get_absolute_url, which is the correct Django way of doing things, eliminates any need for the redundant "href" fields we were using. Those fields now need to be deleted from the models and from the parsers. Made the context processor to pass settings to all templates actually work, although this was a little uglier than expected. I had to put in a new render_response to replace render_to_response. This is because Django uses Context, not RequestContext by default. I wish they would change this, it's annoying. Anyway, I deleted all the manual settings passing in the views. I also eliminated a couple of unnecessary methods and stuff like that. Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8244 by aaron @ 2/16/2009 8:31 AM
67 lines
2.1 KiB
HTML
67 lines
2.1 KiB
HTML
{% extends "base.html" %}
|
|
{% load wiki_markup %}
|
|
|
|
{% block title %}Person {{personexpedition.person|wiki_to_html_short}} for {{personexpedition.expedition}}{% endblock %}
|
|
|
|
|
|
{% block content %}
|
|
<h2>{{personexpedition.person}}: {{personexpedition.expedition}} ({{personexpedition.date_from}} - {{personexpedition.date_to}})</h2>
|
|
|
|
<h3>{{message}}</h3>
|
|
|
|
<p><b><a href="{{ personexpedition.expedition.get_absolute_url }}">Main page for expedition: {{personexpedition.expedition}}</a></b></p>
|
|
<p><b><a href="{{ personexpedition.person.get_absolute_url }}">Main page for person: {{personexpedition.person}}</a></b></p>
|
|
|
|
<p>List of other expos by this person</p>
|
|
<p>
|
|
{% for otherpersonexpedition in personexpedition.person.personexpedition_set.all %}
|
|
{% ifequal otherpersonexpedition personexpedition %}
|
|
| <b>{{otherpersonexpedition.expedition.year}}</b>
|
|
{% else %}
|
|
| <a href="{{ personexpedition.get_absolute_url }}">{{otherpersonexpedition.expedition.year}}</a>
|
|
{% endifequal %}
|
|
{% endfor %}
|
|
</p>
|
|
|
|
<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>
|
|
<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 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>
|
|
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
</div>
|
|
|
|
{% endblock %}
|