diff options
author | Matthew Lemon <y@yulqen.org> | 2024-10-07 15:40:13 +0100 |
---|---|---|
committer | Matthew Lemon <y@yulqen.org> | 2024-10-14 14:35:17 +0100 |
commit | 46e5ae3428a15980f4721074aef8a499e64c0dcf (patch) | |
tree | eddb5ecc6723c541eae6348e0ce1380670d7f566 /engagements/views.py | |
parent | f7fd378a421a18026f55f566d2119ba05e41becb (diff) |
Nice engagement duration text for summary box on detail page
Diffstat (limited to 'engagements/views.py')
-rw-r--r-- | engagements/views.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/engagements/views.py b/engagements/views.py index 60bec47..86f886d 100644 --- a/engagements/views.py +++ b/engagements/views.py @@ -18,6 +18,7 @@ from .forms import ( EngagementStrategyCreateForm, ) from .models import Engagement, EngagementEffort, EngagementStrategy, EngagementType, Organisation +from .utils import duration_formatter def effort_detail(request, effort_id): @@ -66,6 +67,7 @@ def engagement_detail(request, pk): effort_total = sum(e.effort_total_hours() for e in effort) effort_planned = sum(e.effort_total_planned_hours() for e in effort) effort_actual = sum(e.effort_actual() for e in effort) + day_duration_str = duration_formatter(engagement.proposed_start_date, engagement.proposed_end_date) context = { "engagement": engagement, "subinstruments": subinstruments, @@ -73,6 +75,7 @@ def engagement_detail(request, pk): "effort_total": effort_total, "effort_planned": effort_planned, "effort_actual": effort_actual, + "day_duration": day_duration_str, "dscs": dscs, } return render(request, "engagements/engagement_detail.html", context) |