{% extends "layout/basic.html" %} {% block content %}

{{ _('All Training Plans') }}

{% if not tdocs.length %} {{ nothing.render('Sorry, there are no training plans.') }} {% else %}
    {%- for tdoc in tdocs -%}
  1. {{ tdoc.attend|default(0) }}
    {{ _('Enrolled') }}

    {{ tdoc.title }}

    {{ tdoc['content'] }}

    • {{ _('{0} sections').format(tdoc['dag']|length) }}, {{ _('{0} problems').format(model.training.getPids(tdoc.dag)|length) }}
    • {% if tsdict[tdoc.docId]['enroll'] %} {% if not tsdict[tdoc.docId]['done'] %} {{ _('Completed') }} {{ (100 * tsdict[tdoc.docId]['donePids']|length / model.training.getPids(tdoc.dag)|length)|round|int }}% {% else %} {{ _('Completed') }} 100% {% endif %} {% elif handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %} {{ _('Not Enrolled') }} {% endif %}
  2. {%- endfor -%}
{{ paginator.render(page, tpcount, add_qs=qs) }} {% endif %}
{% if handler.user.hasPerm(perm.PERM_CREATE_TRAINING) %}

{{ _('Create Training Plan') }}

{{ _('You can create your own training plans and share them with others.') }}

{% endif %} {% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}

{{ _('Enrolled') }}

    {%- for tid, tsdoc in tsdict -%} {% if tsdoc['enroll'] %} {% set progress = (100 * (tsdoc['donePids']|length) / (model.training.getPids(tdict[tsdoc['docId']].dag)|length))|round|int %}
  1. {{ tdict[tsdoc['docId']]['title'] }}

    {{ _('Complete') }} {{ progress }}%
  2. {% endif %} {%- endfor -%}
{% endif %}
{% endblock %}