{% import "components/user.html" as user with context %} {% import "components/ui/v1.html" as ui_v1 %} {% extends "layout/basic.html" %} {% block content %}
{% call ui_v1.page_header(cpdoc.title, vpdoc.title ~ ' · ' ~ vpdoc.version) %}
{% if cpdoc.hidden %}{{ ui_v1.badge(_('课程包已隐藏'), 'warning') }}{% endif %} {% if vpdoc.hidden %}{{ ui_v1.badge(_('版本已隐藏'), 'warning') }}{% endif %} {{ _('返回课程包') }} {% if canManage %}{{ _('Edit') }}{% endif %}
{% endcall %}
{% if handler.request.query.videoSync == 'done' %} {{ ui_v1.alert(_('课程视频同步完成:扫描 {0} 节,补齐 {1} 个旧复制映射,匹配 {2} 个复制小节,更新 {3} 个绑定,清空 {4} 个绑定。').format(handler.request.query.videoSyncLessons|default('0'), handler.request.query.videoSyncBackfilled|default('0'), handler.request.query.videoSyncTargets|default('0'), handler.request.query.videoSyncSynced|default('0'), handler.request.query.videoSyncCleared|default('0')), none, 'success') }} {% endif %} {% if handler.request.query.problemCleanup == 'done' %} {{ ui_v1.alert(_('已清理 {0} 个已删除的题目引用。').format(handler.request.query.removed|default('0')), none, 'success') }} {% elif handler.request.query.problemCleanup == 'none' %} {{ ui_v1.alert(_('没有发现可以自动清理的已删除题目引用。'), none, 'neutral') }} {% endif %} {% if problemHealth and not problemHealth.ok %} {% endif %}

{{ vpdoc.title }}

{{ ui_v1.badge(vpdoc.version, 'neutral') }}
{{ _('Created By') }}: {{ user.render_inline(udoc, badge=false) }} {{ summary.chapterCount }} {{ _('章') }} {{ summary.lessonCount }} {{ _('节') }} {{ summary.problemCount }} {{ _('题目') }}
{% if vpdoc.content %}
{{ vpdoc.content|markdown|safe }}
{% endif %} {% if not chapters.length %} {% call ui_v1.empty_state(_('这个版本还没有章。')) %} {% if canManage %}{{ _('创建第一章') }}{% endif %} {% endcall %} {% else %}
    {% for chapter in chapters %}
  1. {{ ui_v1.badge(loop.index, 'neutral') }} {{ chapter.title }} {% if chapter.hidden %}{{ ui_v1.badge(_('已隐藏'), 'warning') }}{% endif %}

    {{ chapter.lessons.length }} {{ _('节') }} {% if chapter.lecturePids and chapter.lecturePids.length %}{{ chapter.lecturePids.length }} {{ _('道讲义') }}{% endif %}
    {{ _('预览') }} {% if canManage %} {{ _('编辑章') }} {{ _('创建节') }}
    {% endif %} {% if canCopy %}{{ _('复制本章') }}{% endif %}
    {% if chapter.content %}
    {{ chapter.content|markdown|safe }}
    {% endif %} {% if chapter.lecturePids and chapter.lecturePids.length %}
    {{ _('讲义') }}: {% for pid in chapter.lecturePids %} P{{ pid }}{% if problemHealth.issueByPid[pid] %} · {{ _('已失效') }}{% endif %} {% endfor %}
    {% endif %}
  2. {% endfor %}
{% endif %}
{% endblock %}