List all events in one block on events archive page
authorMagnus Hagander <magnus@hagander.net>
Tue, 28 May 2019 22:02:14 +0000 (18:02 -0400)
committerMagnus Hagander <magnus@hagander.net>
Tue, 28 May 2019 22:03:36 +0000 (18:03 -0400)
Instead of splitting them up in community events and non community
events, list them all in one block (still indicating badged events using
the badge icon). This makes it more similar to the frontpage, and avoids
"punishing" non-community events by pushing them to to far below the
fold.

pgweb/events/views.py
templates/events/archive.html

index 735785d60e720df27bdc5cc281bc6439666ee8d3..fe331e904a79e55f1c0f2408110554f74c6f855f 100644 (file)
@@ -12,14 +12,9 @@ from .forms import EventForm
 
 
 def main(request):
-    community_events = Event.objects.select_related('country').filter(approved=True, badged=True).filter(enddate__gt=date.today()).order_by('enddate', 'startdate',)
-    other_events = Event.objects.select_related('country').filter(approved=True, badged=False).filter(enddate__gt=date.today()).order_by('enddate', 'startdate',)
     return render_pgweb(request, 'about', 'events/archive.html', {
         'title': 'Upcoming Events',
-        'eventblocks': (
-            {'name': 'Community Events', 'events': community_events, 'link': '', },
-            {'name': 'Other Events', 'events': other_events, 'link': '', },
-        ),
+        'events': Event.objects.select_related('country').filter(approved=True, enddate__gt=date.today()).order_by('enddate', 'startdate'),
     })
 
 
@@ -29,9 +24,7 @@ def _eventarchive(request, title):
     return render_pgweb(request, 'about', 'events/archive.html', {
         'title': '%s Archive' % title,
         'archive': True,
-        'eventblocks': (
-            {'name': title, 'events': events, },
-        ),
+        'events': events,
     })
 
 
index 69999c3114884e98f5ec9f7e63ae75169fb88c3f..6cd046b76d85b79eefbd6d59d8890f79948464ba 100644 (file)
@@ -4,20 +4,16 @@
 {%block contents%}
 
 <h1>{{title}} <i class="fas fa-calendar-alt"></i></h1>
-{%for eventblock in eventblocks%}
-{%if eventblocks|length > 1%}<h2><a name="{{eventblock.anchor|slugify}}">{{eventblock.name}}</a></h2>{%endif%}
 <p>
 <em><strong>Note:</strong> The PostgreSQL Global Development Group does not endorse any
 events run by third parties. No guarantee of the quality of events is offered
 whatsoever.</em>
 </p>
-{% if eventblock.name == 'Community Events' %}
 <p>
   <img src="/media/img/PostgreSQL_Badge1.svg" class="community" alt="PostgreSQL Community Event">
   indicates that an event is recognised under the <a href="/community/recognition/#conferences">community event guidelines</a> and is directly helping the PostgreSQL community.
 </p>
-{% endif %}
-{%for event in eventblock.events %}
+{%for event in events %}
 <hr class="eventseparator">
 <div>
   {% if event.badged %}
@@ -35,7 +31,6 @@ whatsoever.</em>
 {%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>