Merge calculated and manual duration
This commit is contained in:
parent
a1df8720f5
commit
c1b3493c80
|
@ -266,19 +266,14 @@ def view_game(request: HttpRequest, game_id: int) -> HttpResponse:
|
||||||
sessions = session_page_obj.object_list
|
sessions = session_page_obj.object_list
|
||||||
|
|
||||||
session_data: dict[str, Any] = {
|
session_data: dict[str, Any] = {
|
||||||
"columns": ["Date", "Duration", "Duration (manual)", "Actions"],
|
"columns": ["Date", "Duration", "Actions"],
|
||||||
"rows": [
|
"rows": [
|
||||||
[
|
[
|
||||||
f"{local_strftime(session.timestamp_start)}{f" — {session.timestamp_end.strftime(timeformat)}" if session.timestamp_end else ""}",
|
f"{local_strftime(session.timestamp_start)}{f" — {session.timestamp_end.strftime(timeformat)}" if session.timestamp_end else ""}",
|
||||||
(
|
(
|
||||||
format_duration(session.duration_calculated, durationformat)
|
format_duration(session.duration_calculated, durationformat)
|
||||||
if session.duration_calculated
|
if session.duration_calculated
|
||||||
else "-"
|
else f"{format_duration(session.duration_manual, durationformat_manual)}*"
|
||||||
),
|
|
||||||
(
|
|
||||||
format_duration(session.duration_manual, durationformat_manual)
|
|
||||||
if session.duration_manual
|
|
||||||
else "-"
|
|
||||||
),
|
),
|
||||||
render_to_string(
|
render_to_string(
|
||||||
"cotton/button_group_sm.html",
|
"cotton/button_group_sm.html",
|
||||||
|
|
|
@ -50,7 +50,6 @@ def list_sessions(request: HttpRequest) -> HttpResponse:
|
||||||
"Name",
|
"Name",
|
||||||
"Date",
|
"Date",
|
||||||
"Duration",
|
"Duration",
|
||||||
"Duration (manual)",
|
|
||||||
"Device",
|
"Device",
|
||||||
"Created",
|
"Created",
|
||||||
"Actions",
|
"Actions",
|
||||||
|
@ -68,12 +67,7 @@ def list_sessions(request: HttpRequest) -> HttpResponse:
|
||||||
(
|
(
|
||||||
format_duration(session.duration_calculated, durationformat)
|
format_duration(session.duration_calculated, durationformat)
|
||||||
if session.duration_calculated
|
if session.duration_calculated
|
||||||
else "-"
|
else f"{format_duration(session.duration_manual, durationformat_manual)}*"
|
||||||
),
|
|
||||||
(
|
|
||||||
format_duration(session.duration_manual, durationformat_manual)
|
|
||||||
if session.duration_manual
|
|
||||||
else "-"
|
|
||||||
),
|
),
|
||||||
session.device,
|
session.device,
|
||||||
session.created_at.strftime(dateformat),
|
session.created_at.strftime(dateformat),
|
||||||
|
|
Loading…
Reference in New Issue