Task list for {{ username }}
{% for status_title, status_code in [ ("Waiting",ST_WAIT), ("In progress",ST_PROGRESS), ("Completed",ST_COMPLETE) ] %}
{{ status_title }}
{% if (status_code != ST_COMPLETE) or (status_code == ST_COMPLETE and show_completed) %}
{% for task in this_user_tasks[status_code] %}
{{ task["description"] }}
#{{ task["taskid"] }} - {{ task["shared_str"] }}, last updated {{ task["updated_delta_str"] }} ({{ task["updated_str"]}}).
{# Wait button #}
{% if status_code == ST_WAIT %}
- Wait
{% else %}
- Wait
{% endif %}
{# Start/Resume button #}
{% if status_code == ST_PROGRESS %}
- Start
{% elif status_code == ST_COMPLETE %}
- Resume
{% else %}
- Start
{% endif %}
{# Done button #}
{% if status_code == ST_COMPLETE %}
- Done
{% else %}
- Done
{% endif %}
{# Share button #}
{% if task["shared_code"] %}
- Make private
{% else %}
- Share
{% endif %}
{% else %}
{# The else on a for loop in jinja runs if the list is EMPTY #}
- No {{ status_title.lower() }} tasks
{% endfor %}
{% else %}
{# This is the completed task section, but display of completed tasks is off #}
{% if this_user_tasks[status_code] %}
{% else %}
- No {{ status_title.lower() }} tasks
{% endif %}
{% endif %}
{% endfor %}