Skip to content

Commit 62739ac

Browse files
committed
Improve homepage table
1 parent a0ae045 commit 62739ac

File tree

2 files changed

+27
-4
lines changed

2 files changed

+27
-4
lines changed

pgcommitfest/commitfest/models.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,10 @@ def statusstring(self):
6565
def periodstring(self):
6666
return "{0} - {1}".format(self.startdate, self.enddate)
6767

68+
@property
69+
def last_open_date(self):
70+
return self.startdate - timedelta(days=1)
71+
6872
@property
6973
def dev_cycle(self) -> int:
7074
if self.startdate.month in [1, 3]:

pgcommitfest/commitfest/templates/home.html

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
<tr>
1515
<th></th>
1616
<th>Details</th>
17-
<th>In Progress</th>
17+
<th>When Open</th>
18+
<th>When In Progress</th>
1819
</tr>
1920
</thead>
2021
<tbody>
2122
<tr>
2223
<td><strong>Open:</strong></td>
2324
<td><a href="/{{cfs.open.id}}/">{{cfs.open}}</a></td>
25+
<td>Now - {{cfs.open.last_open_date}}</td>
2426
<td>{{cfs.open.periodstring}}</td>
2527
</tr>
2628
<tr>
@@ -34,23 +36,31 @@
3436
</td>
3537
<td>
3638
{%if cfs.in_progress %}
37-
{{cfs.in_progress.periodstring}}
39+
<span class="text-muted">Not open anymore</span>
40+
{%endif%}
41+
</td>
42+
<td>
43+
{%if cfs.in_progress %}
44+
Now - {{cfs.in_progress.enddate}}
3845
{%endif%}
3946
</td>
4047
</tr>
4148
<tr>
4249
<td><strong>Previous:</strong></td>
4350
<td><a href="/{{cfs.previous.id}}/">{{cfs.previous}}</a></td>
44-
<td>{{cfs.previous.periodstring}}</td>
51+
<td><span class="text-muted">Not open anymore</span></td>
52+
<td><span class="text-muted">{{cfs.previous.periodstring}}</span></td>
4553
</tr>
4654
<tr>
4755
<td><strong>Draft:</strong></td>
4856
<td><a href="/{{cfs.draft.id}}/">{{cfs.draft}}</a></td>
49-
<td>{{cfs.draft.periodstring}}</td>
57+
<td>Now - {{cfs.draft.enddate}}</td>
58+
<td><span class="text-muted">N/A</span></td>
5059
</tr>
5160
<tr>
5261
<td><strong>Next open:</strong></td>
5362
<td>{{cfs.next_open}}</td>
63+
<td>{{cfs.open.startdate}}- {{cfs.next_open.last_open_date}}</td>
5464
<td>{{cfs.next_open.periodstring}}</td>
5565
</tr>
5666
<tr>
@@ -62,6 +72,15 @@
6272
{{cfs.final}}
6373
{%endif%}
6474
</td>
75+
<td>
76+
{%if cfs.final.status == 2 %}
77+
Now - {{cfs.final.last_open_date}}
78+
{%elif cfs.final.status == 3 %}
79+
<span class="text-muted">Not open anymore</span>
80+
{%else%}
81+
{{cfs.final.startdate.year}}-01-01 - {{cfs.final.last_open_date}}
82+
{%endif%}
83+
</td>
6584
<td>
6685
{{cfs.final.periodstring}}
6786
</td>

0 commit comments

Comments
 (0)