diff options
author | Magnus Hagander | 2015-09-02 11:19:48 +0000 |
---|---|---|
committer | Magnus Hagander | 2015-09-02 11:19:48 +0000 |
commit | b557b45047b0f0f0d64a66d91030801929f39ea5 (patch) | |
tree | cc6c570e4f1a12c095ebad25a5896060bf9d6603 | |
parent | 6aeb763fb1b7b234e05cd3a7988703ebad423e7f (diff) |
Show the start and end date of commitfests
Per request
-rw-r--r-- | pgcommitfest/commitfest/models.py | 6 | ||||
-rw-r--r-- | pgcommitfest/commitfest/templates/home.html | 2 |
2 files changed, 7 insertions, 1 deletions
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 @@ -43,6 +43,12 @@ class CommitFest(models.Model): 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. </p> <ul> {%for c in commitfests%} - <li><a href="/{{c.id}}/">{{c}}</a> ({{c.statusstring}})</li> + <li><a href="/{{c.id}}/">{{c}}</a> ({{c.statusstring}}{%if c.startdate%} - {{c.periodstring}}{%endif%})</li> {%endfor%} </ul> <br/> |