def purge_urls(self):
yield '/about/event/%s/' % self.pk
- yield '/about/eventarchive/'
+ yield '/about/events/'
yield '/events.rss'
# FIXME: when to expire the front page?
yield '/$'
from models import Event
from forms import EventForm
-def archive(request, paging=None):
+def main(request):
events = Event.objects.select_related('country').filter(approved=True).filter(training=False, enddate__gt=date.today).order_by('enddate', 'startdate',)
training = Event.objects.select_related('country').filter(approved=True).filter(training=True, enddate__gt=date.today).order_by('enddate', 'startdate',)
return render_to_response('events/archive.html', {
+ 'title': 'Current events',
'eventblocks': (
- { 'name': 'Events', 'events': events, },
- { 'name': 'Training', 'events': training, },
+ { 'name': 'Events', 'events': events, 'link': '',},
+ { 'name': 'Training', 'events': training, 'link': 'training/',},
),
}, NavContext(request, 'about'))
+def _eventarchive(request, training, title):
+ # Hardcode to the latest 100 events. Do we need paging too?
+ events = Event.objects.select_related('country').filter(approved=True).filter(training=training, enddate__lte=date.today).order_by('-enddate', '-startdate',)[:100]
+ return render_to_response('events/archive.html', {
+ 'title': '%s Archive' % title,
+ 'archive': True,
+ 'eventblocks': (
+ {'name': title, 'events': events, },
+ ),
+ }, NavContext(request, 'about'))
+
+def archive(request):
+ return _eventarchive(request, False, 'Event')
+
+def trainingarchive(request):
+ return _eventarchive(request, True, 'Training')
+
def item(request, itemid, throwaway=None):
event = get_object_or_404(Event, pk=itemid)
if not event.approved:
(r'^about/newsarchive/$', 'news.views.archive'),
(r'^about/news/(\d+)(-.*)?/$', 'news.views.item'),
+ (r'^about/events/$', 'events.views.main'),
(r'^about/eventarchive/$', 'events.views.archive'),
+ (r'^about/eventarchive/training/$', 'events.views.trainingarchive'),
(r'^about/event/(\d+)(-.*)?/$', 'events.views.item'),
(r'^about/featurematrix/$', 'featurematrix.views.root'),
(r'^about/featurematrix/detail/(\d+)/$', 'featurematrix.views.detail'),
{'title': 'Servers', 'link': '/about/servers/'},
]},
{'title': 'Latest news', 'link':'/about/newsarchive/'},
- {'title': 'Upcoming events', 'link':'/about/eventarchive/'},
+ {'title': 'Upcoming events', 'link':'/about/events/'},
{'title': 'Press', 'link':'/about/press/'},
{'title': 'Licence', 'link':'/about/licence/'},
],
{%extends "base/page.html"%}
{%load markup%}
-{%block title%}Event archive{%endblock%}
+{%block title%}{{title}}{%endblock%}
{%block contents%}
+<h1>{{title}}</h1>
{%for eventblock in eventblocks%}
-<h1><a name="{{eventblock.name}}">{{eventblock.name}}</a></h1>
+{%if eventblocks|length > 1%}<h2><a name="{{eventblock.name}}">{{eventblock.name}}</a></h2>{%endif%}
<p>
<i><b>Note:</b> The PostgreSQL Global Development Group does not endorse any
events run by third parties. No guarantee of the quality of events is offered
{{event.summary|markdown:"safe"}}
</p>
{%endfor%}
+{%if not archive%}
+<p><a href="/about/eventarchive/{{eventblock.link}}">Older {{eventblock.name}}</a></p>
+{%endif%}
{%endfor%}
+{%if not archive%}
<p><a href="/account/events/new/">Submit event</a></p>
+{%endif%}
{%endblock%}
</div> <!-- pgFrontPlanetWrap -->
</div> <!-- pgFrontPlanet -->
<div id="pgFrontEvents" class="txtNewsEvent">
- <a href="/about/eventarchive">
+ <a href="/about/events/">
<img src="/media/img/hdr/hdr_upcomingevents.png" width="123" height="10" alt="Upcoming Events" />
</a>
<div class="pgNewsEventsWrap">
</p>
{% endfor %}
</div>
- <a href="/about/eventarchive">
+ <a href="/about/events/">
<img src="/media/img/hdr/hdr_upcomingtraining.png" width="140" height="10" alt="Upcoming training" />
</a>
<div class="pgNewsEventsWrap">
{{trainingcompanies|slice:":2"|join:", "}} and others.
{%endif%}
{%endif%}
- <p>Take a look at our <a href="/about/eventarchive/#Training">schedule</a> to find the training that you want.</p>
+ <p>Take a look at our <a href="/about/events/#Training">schedule</a> to find the training that you want.</p>
{%else%}
There are no training events currently scheduled.
{%endif%}
<img class="pgArrowImage" src="/media/img/layout/blt_blu_arrow.png" width="6" height="5" alt="" />
<ul class="pgRSSBottomList">
<li>
- <a href="/about/eventarchive" title="More Events">More</a>
+ <a href="/about/events/" title="More Events">More</a>
</li>
<li>
<a href="/account/events/new/">Submit Event</a>