{% extends "base.html" %} {% set daily = daily | default(false) %} {% set projects = projects | default(false) %} {% set active_page = 'projects' if projects else 'daily' if daily else 'tasks' %} {% if projects %} {% set history_title = t(text.ALL_TIME_PROJECT_TASKS_TITLE, project=report.repository.rsplit('/', 1)[-1]) if report.repository else t(text.PROJECTS) %} {% elif report %} {% set first_date = report.start | history_date %} {% set date_label = first_date if report.start == report.end else t(text.TASK_DATE_RANGE, start=first_date, end=report.end | history_date) %} {% if report.repository and not daily %} {% set history_title = t(text.PROJECT_TASKS_TITLE, project=report.repository.rsplit('/', 1)[-1], date=date_label) %} {% else %} {% set history_title = t(text.DAILY_TASKS_TITLE if daily else text.DATED_TASKS_TITLE, date=date_label) %} {% endif %} {% endif %} {% macro total_duration(hours) -%} {%- set seconds = hours | elapsed_seconds -%} {{- '%02d:%02d' | format(seconds // 3600, seconds // 60 % 60) -}} {%- endmacro %} {% block page_title %}{{ history_title if report else t(text.TASKS) }}{% endblock %} {% block head %} {% if task and task.editor %} {% endif %} {% endblock %} {% block content %} {% if saved %}

{{ t(text.TIMING_SAVED if saved == 'timing' else text.PAUSE_SAVED) }}

{% endif %} {% if form_error is defined %}{% endif %}
{% if task %}

{{ t(text.TASK, task_id=task.task_id) }}

{{ task.repository }}

{{ t(text.TOTAL) }}{{ total_duration(task.total_hours) }}
{{ t(text.STATUS) }}
{{ t(text['STATUS_' ~ task.status.upper()]) }}
{{ t(text.ORIGINAL_STARTED_AT if task.status == 'completed' else text.STARTED_AT) }}
{% if task.completed_at %}
{{ t(text.COMMIT_RECORDED_AT) }}
{% endif %} {% if task.commit_sha %}
{{ t(text.COMMIT) }}
{{ task.commit_sha }}

{{ task.commit_message }}

{% endif %}

{{ t(text.TIMELINE) }}

{% if task.editor is defined and task.editor %}

{{ t(text.TIMING_NO_SCRIPT) }}

{{ t(text.TIMING_RECORDS) }} {% else %}

{{ t(text.TIME_FORMAT, timezone=task.timezone) }}

{% endif %}
    {% for interval in task.timeline %}
  1. {{ t(text.ACTIVE_TIME if interval.interval_id else text.PAUSE_TIME) }}

    →

    {{ t(text.ELAPSED_TIME, elapsed=interval.elapsed_time) }}

    {% if interval.interval_id and interval.ended_at and task.status != 'completed' %} {% set editing = form_values is defined and form_values.get('interval_id') == interval.interval_id | string %}
    {{ t(text.INSERT_PAUSE) }}

    {{ t(text.HISTORY_PAUSE_HELP) }}

    {% elif interval.interval_id and not interval.ended_at %}

    {{ t(text.OPEN_INTERVAL) }}

    {% endif %}
  2. {% endfor %}
{% if task.editor is defined and task.editor %}
{% endif %} {% else %} {% if projects %}
{% endif %}

{{ history_title }}

{{ t(text.TOTAL_TIME) }}{{ total_duration(report.total_hours) }}
{% if daily %}
{% endif %} {% if not report.entries %}

{{ t(text.NO_PROJECT_TASKS if projects else text.NO_TASKS) }}

{% endif %}
{% if daily %}{% endif %} {% for item in report.entries %} {% if item.entry_type == 'release' %} {% if daily %}{% endif %} {% else %} {% set minutes = (item.hours | elapsed_seconds) // 60 %} {% if daily %}{% endif %} {% endif %} {% endfor %}
{{ t(text.TASK_NUMBER) }}{{ t(text.TASK_PROJECT) }}{{ t(text.TASK_START_TIME) }}{{ t(text.TASK_DESCRIPTION) }}{{ t(text.TASK_DURATION) }}
{{ item.repository.rsplit('/', 1)[-1] }} {{ t(text.RELEASE_NAMED, tag=item.tag_name, codename=item.codename) if item.codename else t(text.RELEASE, tag=item.tag_name) }}
{{ item.task_id }}{{ item.repository.rsplit('/', 1)[-1] }} {{ item.commit_message or t(text['STATUS_' ~ item.status.upper()]) }} {{ '%02d:%02d' | format(minutes // 60, minutes % 60) }}
{% endif %}
{% endblock %} {% block scripts %} {% if task and task.editor is defined and task.editor %} {% set labels = { 'idle': t(text.TIMING_IDLE), 'pause': t(text.PAUSE_TIME), 'task': t(text.TASK, task_id='{task_id}'), 'part': t(text.TIMING_PART, part='{part}'), 'active': t(text.ACTIVE_TIME), 'elapsed': t(text.ELAPSED_TIME, elapsed='{elapsed}'), 'clean': t(text.TIMING_CLEAN), 'invalidLocalTime': t(text.TIMING_LOCAL_INVALID), 'lastUpdated': t(text.LAST_UPDATED, timestamp='{timestamp}'), 'commitRecorded': t(text.COMMIT_RECORDED_AT), 'saved': t(text.TIMING_SAVED), 'dirty': t(text.TIMING_DIRTY), 'saving': t(text.TIMING_SAVING), 'unconfirmed': t(text.TIMING_UNCONFIRMED), 'loadError': t(text.TIMING_LOAD_ERROR), 'badTiming': t(text.BAD_TIMING), 'refreshed': t(text.TIMING_REFRESHED), 'reloadRequired': t(text.TIMING_RELOAD_REQUIRED) } %} {% endif %} {% endblock %}