{% import "components/ui/v1.html" as ui_v1 %} {% import "components/user.html" as user with context %} {% extends "layout/basic.html" %} {% block content %}
{{ ui_v1.page_header(_('课程包排序'), _('调整课程包在当前域中的展示顺序。')) }}

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

{{ _('拖动手柄或使用移动按钮调整顺序;聚焦手柄后可使用方向键、Home 或 End。') }} {{ _('使用移动按钮逐项调整顺序。') }}

{% if cpdocs.length %}{% endif %} {{ _('返回') }}
{% if not cpdocs.length %} {{ ui_v1.empty_state(_('暂无课程包')) }} {% else %}
    {% for cpdoc in cpdocs %}
  1. {{ ui_v1.sortable_handle(_('拖动以排序') ~ ': ' ~ cpdoc.title, 'course-package-sort-help', cpdocs.length > 1, 'nojs--hide') }} {{ ui_v1.sortable_index(loop.index) }}

    {{ cpdoc.title }}

    {% if cpdoc.hidden %}{{ ui_v1.badge(_('已隐藏'), tone='warning') }}{% endif %}
    {{ cpdoc.nVersion|default(0) }} {{ _('版本') }} {% if udict[cpdoc.owner] %}{{ user.render_inline(udict[cpdoc.owner], badge=false) }}{% endif %}
    {{ ui_v1.sortable_action(_('置顶'), _('置顶') ~ ': ' ~ cpdoc.title, action='top', disabled=loop.first, button_type='submit', name='move', value=cpdoc.docId ~ ':top') }} {{ ui_v1.sortable_action(_('上移'), _('上移') ~ ': ' ~ cpdoc.title, action='up', disabled=loop.first, button_type='submit', name='move', value=cpdoc.docId ~ ':up') }} {{ ui_v1.sortable_action(_('下移'), _('下移') ~ ': ' ~ cpdoc.title, action='down', disabled=loop.last, button_type='submit', name='move', value=cpdoc.docId ~ ':down') }} {{ ui_v1.sortable_action(_('置底'), _('置底') ~ ': ' ~ cpdoc.title, action='bottom', disabled=loop.last, button_type='submit', name='move', value=cpdoc.docId ~ ':bottom') }}
  2. {% endfor %}
{% endif %}

{% endblock %}