Skip to content

Commit 04c5fc7

Browse files
authored
Add strikethrough for completed cycle projects (#72)
* Hide countdown for completed cycle projects * Group completed cycle projects and improve completed display * Remove unused is_completed variable * Filter completed cycle projects * Extract project date range macro * Expand completed section and remove date range
1 parent cd60f96 commit 04c5fc7

File tree

3 files changed

+48
-9
lines changed

3 files changed

+48
-9
lines changed

app.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ def format_name(key):
298298
projects_by_initiative = dict(
299299
sorted(projects_by_initiative.items(), key=lambda x: x[0])
300300
)
301+
301302
# filter to only the cycle initiative (from config.yml)
302303
current_init = config.get("cycle_initiative")
303304
if current_init:
@@ -307,6 +308,20 @@ def format_name(key):
307308
if name == current_init
308309
}
309310

311+
# Separate completed projects from the cycle initiatives
312+
completed_projects = []
313+
for name, projects in list(projects_by_initiative.items()):
314+
remaining = []
315+
for project in projects:
316+
if project.get("status", {}).get("name") == "Completed":
317+
completed_projects.append(project)
318+
else:
319+
remaining.append(project)
320+
if remaining:
321+
projects_by_initiative[name] = remaining
322+
else:
323+
del projects_by_initiative[name]
324+
310325
# Determine which team members are participating in cycle projects
311326
cycle_projects_filtered = [p for projs in projects_by_initiative.values() for p in projs]
312327

@@ -389,6 +404,7 @@ def normalize(name: str) -> str:
389404
developers=developers,
390405
developer_projects=member_projects,
391406
cycle_projects_by_initiative=projects_by_initiative,
407+
completed_cycle_projects=completed_projects,
392408
on_call_support=on_call_support,
393409
support_issues=support_issues,
394410
)

linear.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,9 @@ def get_projects():
553553
name
554554
url
555555
health
556+
status {
557+
name
558+
}
556559
startDate
557560
targetDate
558561
lead {

templates/team.html

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@
55
{% block extra_head %}
66
<style>
77
.health-icon { font-size: 0.9em; margin-right: 0.3em; }
8+
.completed-project {
9+
text-decoration: line-through;
10+
text-decoration-thickness: 2px;
11+
color: #555;
12+
}
813
</style>
914
{% endblock %}
1015

@@ -41,8 +46,9 @@ <h3>Cycle Projects</h3>
4146
<ul>
4247
{% for initiative, projects in cycle_projects_by_initiative.items() %}
4348
{% for project in projects %}
49+
{% set is_completed = project.status and project.status.name == 'Completed' %}
4450
<li>
45-
{% if project.health %}
51+
{% if project.health and not is_completed %}
4652
{% if project.health == 'onTrack' %}
4753
{% set icon = '🟢' %}
4854
{% elif project.health == 'atRisk' %}
@@ -52,17 +58,19 @@ <h3>Cycle Projects</h3>
5258
{% endif %}
5359
<span class="health-icon" title="{{ project.health }}">{{ icon }}</span>
5460
{% endif %}
55-
<a href="{{ project.url }}">{{ project.name }}</a>
61+
<a href="{{ project.url }}" class="{% if is_completed %}completed-project{% endif %}">{{ project.name }}</a>
5662
{% if project.startDate or project.targetDate %}
5763
<small>
5864
{% if project.startDate %}{{ project.startDate|mmdd }}{% endif %}{% if project.targetDate %} → {{ project.targetDate|mmdd }}{% endif %}
59-
{% if project.starts_in is not none and project.starts_in > 0 %}
60-
(starts in {{ project.starts_in }}d)
61-
{% elif project.days_left is not none %}
62-
{% if project.days_left < 0 %}
63-
({{ project.days_left | abs }}d overdue)
64-
{% else %}
65-
({{ project.days_left }}d left)
65+
{% if not is_completed %}
66+
{% if project.starts_in is not none and project.starts_in > 0 %}
67+
(starts in {{ project.starts_in }}d)
68+
{% elif project.days_left is not none %}
69+
{% if project.days_left < 0 %}
70+
({{ project.days_left | abs }}d overdue)
71+
{% else %}
72+
({{ project.days_left }}d left)
73+
{% endif %}
6674
{% endif %}
6775
{% endif %}
6876
</small>
@@ -81,6 +89,18 @@ <h3>Cycle Projects</h3>
8189
{% endfor %}
8290
{% endfor %}
8391
</ul>
92+
{% if completed_cycle_projects %}
93+
<details open>
94+
<summary>Completed Projects</summary>
95+
<ul>
96+
{% for project in completed_cycle_projects %}
97+
<li>
98+
<a href="{{ project.url }}" class="completed-project">{{ project.name }}</a>
99+
</li>
100+
{% endfor %}
101+
</ul>
102+
</details>
103+
{% endif %}
84104
<h3>Platforms</h3>
85105
<ul>
86106
{% for platform, members in platform_teams|dictsort %}

0 commit comments

Comments
 (0)