mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2024-11-24 00:01:58 +00:00
6776111c6e
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.
76 lines
2.5 KiB
HTML
76 lines
2.5 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}
|
|
CUCC expedition calendar:
|
|
{% if expedition %}
|
|
{{ expedition.year }}
|
|
{% else %}
|
|
choose a year
|
|
{% endif %}
|
|
{% endblock %}
|
|
|
|
{% block head %}
|
|
<style type="text/css">
|
|
<!--
|
|
.no { background: #7f96e8; width: 80pt; font-size: 10pt }
|
|
.yes { background: #ff6666; width: 80pt; font-size: 10pt }
|
|
.name { background: #999; width: 80pt; text-align:right; font-size: 10pt }
|
|
.date { background: #999; width: 80pt; text-align:right; font-size: 10pt }
|
|
-->
|
|
</style>
|
|
|
|
{% endblock %}
|
|
|
|
{% block contentheader %}
|
|
<h2>Expedition members present calendar for {{ expedition.year }}</h2>
|
|
<table style="margin:0 auto">
|
|
<tr>
|
|
<td class='yes' width="10"></td><td>Expedition member present in Austria</td>
|
|
</tr>
|
|
<tr>
|
|
<td class='no' width="10"></td><td>Expedition member absent in Austria</td>
|
|
</tr></table>
|
|
<br />
|
|
{% endblock%}
|
|
|
|
{% block content %}
|
|
{% if expedition %}
|
|
<table>
|
|
<tr><td />
|
|
{% for date in expedition.ListDays %}
|
|
{% ifchanged date.month %}
|
|
<td class="date">{{ date|date:"F" }}</td>
|
|
{% else %}
|
|
<td class="date"></td>
|
|
{% endifchanged %}
|
|
{% endfor %}
|
|
</tr>
|
|
<tr><td />
|
|
{% for date in expedition.ListDays %}
|
|
<td class="date">{{ date|date:"D" }}</td>
|
|
{% endfor %}
|
|
</tr>
|
|
<tr><td />
|
|
{% for date in expedition.ListDays %}
|
|
<td class="date">{{ date|date:"d" }}</td>
|
|
{% endfor %}
|
|
</tr>
|
|
|
|
{% for personexpedition in expedition.personexpedition_set.all %}
|
|
<tr>
|
|
<td class="name">
|
|
<a href="">{{ personexpedition.person }}</a>
|
|
|
|
</td>
|
|
{% if personexpedition.ListDaysTF %}
|
|
{% for dateTF in personexpedition.ListDaysTF %}
|
|
<td {{ dateTF|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 %} |