From b557b45047b0f0f0d64a66d91030801929f39ea5 Mon Sep 17 00:00:00 2001
From: Magnus Hagander
Date: Wed, 2 Sep 2015 13:19:48 +0200
Subject: [PATCH] Show the start and end date of commitfests
Per request
---
pgcommitfest/commitfest/models.py | 6 ++++++
pgcommitfest/commitfest/templates/home.html | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/pgcommitfest/commitfest/models.py b/pgcommitfest/commitfest/models.py
index 23fe1fb..a987e2a 100644
--- a/pgcommitfest/commitfest/models.py
+++ b/pgcommitfest/commitfest/models.py
@@ -42,6 +42,12 @@ class CommitFest(models.Model):
def statusstring(self):
return [v for k,v in self._STATUS_CHOICES if k==self.status][0]
+ @property
+ def periodstring(self):
+ if self.startdate and self.enddate:
+ return "{0} - {1}".format(self.startdate, self.enddate)
+ return ""
+
@property
def title(self):
return "Commitfest %s" % self.name
diff --git a/pgcommitfest/commitfest/templates/home.html b/pgcommitfest/commitfest/templates/home.html
index 461bc28..e23a558 100644
--- a/pgcommitfest/commitfest/templates/home.html
+++ b/pgcommitfest/commitfest/templates/home.html
@@ -7,7 +7,7 @@ The following commitfests exist in the system.
{%for c in commitfests%}
- - {{c}} ({{c.statusstring}})
+ - {{c}} ({{c.statusstring}}{%if c.startdate%} - {{c.periodstring}}{%endif%})
{%endfor%}
--
2.39.5