{% extends "base.html" %} {% set active_page = 'report' %} {% macro human_duration(elapsed) -%} {%- set seconds = elapsed | round(0, 'ceil') | int -%} {%- if seconds >= 3600 -%} {%- set minutes = (seconds / 60) | round(0, 'ceil') | int -%} {%- set parts = [(minutes // 60, text.DURATION_HOUR, text.DURATION_HOURS), (minutes % 60, text.DURATION_MINUTE, text.DURATION_MINUTES)] -%} {%- else -%} {%- set parts = [(seconds // 60, text.DURATION_MINUTE, text.DURATION_MINUTES), (seconds % 60, text.DURATION_SECOND, text.DURATION_SECONDS)] -%} {%- endif -%} {%- for count, singular, plural in parts if count -%} {{- ' ' if not loop.first else '' -}}{{- t(singular if count == 1 else plural, count=count) -}} {%- else -%} {{- t(text.DURATION_SECONDS, count=0) -}} {%- endfor -%} {%- endmacro %} {% block page_title %}{{ t(text.DAILY_TASKS) }}{% endblock %} {% block head %} {% endblock %} {% block content %}

{{ t(text.REPORTING) }}

{% if languages | length > 1 %}
{% else %}{% endif %}

{{ t(text.CURRENT_TASK) }}

{% if report.current_task.task_id is none %}{{ t(text.NO_RUNNING_TASK) }}{% else %}{{ t(text.CURRENT_TASK_RUNNING, task_id=report.current_task.task_id, repository=report.current_task.repository.rsplit('/', 1)[-1], duration=human_duration(report.current_task.active_seconds)) }}{% endif %}

{{ t(text.DAILY_TASKS) }}

{% set total_minutes = (report.total_hours | elapsed_seconds) // 60 %}

{{ t(text.TIMEZONE, timezone=report.timezone) }}

{{ t(text.TOTAL) }}{{ '%02d:%02d' | format(total_minutes // 60, total_minutes % 60) }}
{% if report.total_hours == 0 %}

{{ t(text.EMPTY) }}

{% endif %}
{% endblock %} {% block scripts %} {% endblock %}