{% import "components/nothing.html" as nothing with context %} {% import "components/paginator.html" as paginator with context %} {% import "components/user.html" as user with context %} {% extends "layout/basic.html" %} {% macro action(tooltip, operation, type, data, icon) %} {% endmacro %} {% block content %}
{{ ddoc.content|markdown|safe }}
{% if canScore %}

{{ _('Score') }}

{% endif %} {% if ddoc.score is not null and ddoc.score is not undefined %} {% set articleScore = ddoc.score|int %}{% set scoreColor = 'red' if articleScore < 20 else ('green' if articleScore >= 60 else 'orange') %}

本篇文章评分

{{ articleScore }}
{% endif %} {% if courseRef %}

文章关联信息

  • 课程:{{ cdoc }}
  • 章节:{{ csdoc }}
  • 小节:{{ ssdoc }}
  • 所在域:{{ courseDomain }}
{% endif %}
{% if not ddoc.lock %}

{{ _('{0} comments').format(drcount) }}

    {% if handler.user.hasPriv(PRIV.PRIV_USER_PROFILE) %}
  • {% endif %} {% for doc in drdocs %} {% set replyUser = udict[doc.owner] %}
  • {{ user.render_inline(replyUser, avatar=false) }} @ {{ datetimeSpan(doc._id)|safe }}
    {{ action(_('Reply'), 'reply_comment', 'comment', {}, 'reply') }} {% if doc.source != 'embedded' and (handler.user.hasPriv(PRIV.PRIV_EDIT_SYSTEM) or handler.user.own(doc)) %}{{ action(_('Edit'), 'edit', 'comment', {operation:'edit_reply', drid:doc._id}, 'edit') }}{% endif %} {% if doc.source != 'embedded' and (handler.user.hasPriv(PRIV.PRIV_EDIT_SYSTEM) or handler.user.own(doc) or handler.user.own(ddoc)) %}{{ action(_('Delete'), 'delete', 'comment', {operation:'delete_reply', drid:doc._id}, 'delete') }}{% endif %}
    {{ doc.content|markdown|safe }}
  • {% endfor %}
{% if page and pcount %}{{ paginator.render(page, pcount) }}{% endif %} {% if drcount == 0 %}{{ nothing.render('No comments so far...') }}{% endif %}
{% else %}
{{ nothing.render('blog reply banned') }}
{% endif %}
{% endblock %}