{% import "components/user.html" as user with context %} {% import "components/paginator.html" as paginator with context %} {% import "components/ui/v1.html" as ui_v1 %} {% extends "layout/basic.html" %} {% block content %}
{% if canManage %} {% call ui_v1.page_header(_('课程包'), _('浏览和管理可复用、可版本化的课程内容。')) %}
{{ _('创建课程包') }}
{% endcall %} {% else %} {{ ui_v1.page_header(_('课程包'), _('浏览和管理可复用、可版本化的课程内容。')) }} {% endif %}

{{ _('课程包列表') }}

{% if not cpdocs.length %} {{ ui_v1.empty_state(_('暂无课程包')) }} {% else %}
    {% for cpdoc in cpdocs %}
  1. {{ cpdoc.title }} {% if cpdoc.hidden %}{{ ui_v1.badge(_('已隐藏'), 'warning') }}{% endif %}

    {% set packageSummary = cpdoc.content|default('')|markdown|striptags|trim %} {% if packageSummary %}
    {{ packageSummary|truncate(100, true)|safe }}
    {% endif %}
    {% if udict[cpdoc.owner] %}{{ user.render_inline(udict[cpdoc.owner], badge=false) }}{% endif %} {% if cpdoc.updateAt %}{{ _('Last Update At') }}: {{ datetimeSpan(cpdoc.updateAt)|safe }}{% endif %}
    {% if cpdoc.tags and cpdoc.tags.length %}
    {% for tag in cpdoc.tags %}{{ ui_v1.badge(tag, 'neutral') }}{% endfor %}
    {% endif %}
    {{ ui_v1.badge((cpdoc.nVersion|default(0)) ~ ' ' ~ _('版本'), 'neutral') }} {% if canManage %}
    {% endif %}
  2. {% endfor %}
{% if page and cpcount %}
{{ paginator.render(page, cpcount) }}
{% endif %} {% endif %}
{% if canManage %} {% endif %}
{% endblock %}