From d7ccb38d1df586e75fbc63e9f88a520f6eb8ce20 Mon Sep 17 00:00:00 2001
From: Robin Sonnabend <robin@fsmpi.rwth-aachen.de>
Date: Mon, 5 Feb 2018 18:55:06 +0100
Subject: [PATCH] Hide open but past protocols on index page

This adds the new config key MAX_PAST_INDEX_DAYS
ref #158
---
 config.py.example | 2 ++
 server.py         | 1 +
 2 files changed, 3 insertions(+)

diff --git a/config.py.example b/config.py.example
index 85c937b..91efe38 100644
--- a/config.py.example
+++ b/config.py.example
@@ -84,6 +84,8 @@ PAGE_DIFF = 3
 
 # upcoming meetings within this number of days from today are shown on the index page
 MAX_INDEX_DAYS = 14
+MAX_PAST_INDEX_DAYS = 2
+MAX_PAST_INDEX_DAYS_BEFORE_REMINDER = 14
 
 # mail to contact in case of complex errors
 ADMIN_MAIL = "admin@example.com"
diff --git a/server.py b/server.py
index 91da22f..a429ca3 100755
--- a/server.py
+++ b/server.py
@@ -159,6 +159,7 @@ def index():
             protocol for protocol in protocols
             if not protocol.done
             and (protocol.date - current_day).days < config.MAX_INDEX_DAYS
+            and (current_day - protocol.date).days < config.MAX_PAST_INDEX_DAYS
         ],
         key=_protocol_sort_key
     )
-- 
GitLab