diff --git a/pyvocz/static/style.css b/pyvocz/static/style.css
index 1705c45..9f77bae 100644
--- a/pyvocz/static/style.css
+++ b/pyvocz/static/style.css
@@ -10,6 +10,12 @@ h1, h2, h3, h4, h5, h6 {
margin-top: 0;
}
+h2, h3, h4, h5, h6 {
+ font-family: "Bree Serif", serif;
+ margin-top: .5em;
+ margin-bottom: .5em;
+}
+
.container {
background-color: #fdfeff;
padding-top: 1em;
diff --git a/pyvocz/templates/series.html b/pyvocz/templates/series.html
index 2aa1dc3..a7d929d 100644
--- a/pyvocz/templates/series.html
+++ b/pyvocz/templates/series.html
@@ -51,7 +51,7 @@
{{ self.title() }}
přidat informace o dalším srazu.
-
+
{% if year==None %}
@@ -139,9 +139,17 @@ {{ tr('Historie srazů', 'Meetup History') }}
<
-
- {{ tr("Nové", "New") }}
-
+ {% if new_history %}
+
+
+ {% if new_history %}
+ {{ tr("Nové", "New") }}
+ {% else %}
+ {{ tr("Předchozí", "Previous") }}
+ {% endif %}
+
+
+ {% endif %}
{% for page in all_years|reverse %}
{{ page }}
diff --git a/pyvocz/views.py b/pyvocz/views.py
index 353c96c..09e47f9 100644
--- a/pyvocz/views.py
+++ b/pyvocz/views.py
@@ -178,14 +178,28 @@ def series(series_slug, year=None, all=None):
# Otherwise, if there are no events in requested year, return 404.
abort(404)
- events = list(reversed(series.events))
+ all_events = list(reversed(series.events))
- if not all:
+ if all:
+ events = all_events
+ else:
if year is None:
# The 'New' page displays the current year as well as the last one
- events = [e for e in events if e.date.year >= today.year - 1]
+ events = [e for e in all_events if e.date.year >= today.year - 1]
else:
- events = [e for e in events if e.date.year == year]
+ events = [e for e in all_events if e.date.year == year]
+
+ # Split events between future and past
+ # (today's event, if any, is considered future)
+ past_events = [e for e in events if e.date < today]
+ future_events = [e for e in events if e.date >= today]
+
+ new_history = True
+ if not all and year is None:
+ # On the home page of the series, if there are no recent enough
+ # past events, show up to 5 last ones.
+ new_history = False
+ past_events = [e for e in all_events if e.date < today][:5]
if all is not None:
paginate_prev = {'year': first_year}
@@ -208,11 +222,6 @@ def series(series_slug, year=None, all=None):
has_events = bool(events)
- # Split events between future and past
- # (today's event, if any, is considered future)
- past_events = [e for e in events if e.date < today]
- future_events = [e for e in events if e.date >= today]
-
# Events are ordered closest first;
# for future ones this means ascending order
future_events.reverse()
@@ -235,6 +244,7 @@ def series(series_slug, year=None, all=None):
all_years=all_years, paginate_prev=paginate_prev,
paginate_next=paginate_next, has_events=has_events,
event_add_link=event_add_link,
+ new_history=new_history,
)