Show the start and end date of commitfests
authorMagnus Hagander <magnus@hagander.net>
Wed, 2 Sep 2015 11:19:48 +0000 (13:19 +0200)
committerMagnus Hagander <magnus@hagander.net>
Wed, 2 Sep 2015 11:19:48 +0000 (13:19 +0200)
Per request

pgcommitfest/commitfest/models.py
pgcommitfest/commitfest/templates/home.html

index 23fe1fb1dcb43adea84192d57613556188943fe1..a987e2aa9f76265e10298e3fc946fde0fe8ca54f 100644 (file)
@@ -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
index 461bc2873892dd29a2c0be84957ae62559e7d668..e23a558978f91555004d384bfea09c9b78ad948d 100644 (file)
@@ -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/>