{% set need_js = True %} {% set title = g.topic.title + ' – ' + g.course.name %} {% if show_for_user %} {% set title = show_for_user.full_name() + ' – ' + title %} {% endif %} {% extends "base.html" %} {% block body %} {% if g.is_admin %} {% endif %}

{{ g.course.name }}

Back to the course {% if g.is_teacher %} Topics Teacher's summary Edit topic {% elif g.is_grader %} Grade {% endif %}

{{ g.topic.title }} {% if not g.topic.public %} [private]{% endif %} {% if show_for_user %} ({{ show_for_user.full_name() }}){% endif %}

{% if student_uid == -1 %}

(posts visible to all students) {% endif %} {% if g.topic.deadline != None %}

Deadline: {{ g.topic.deadline|reltimeformat }} {% endif %} {% for p in posts %} {% set cls = ['post'] %} {% if seen == None or p.last_change_time() > seen %} {% do cls.append('pnew') %} {% endif %} {% if p.target_uid == -1 %} {% do cls.append('pall') %} {% elif p.author_uid != p.target_uid %} {% do cls.append('pteacher') %} {% endif %}

{%- if g.course.anon_grading and not g.is_teacher and p.author_uid != g.uid and p.author_uid == student_uid -%} Student {{student_uid}} — {% else -%} {{ p.author.full_name() }} — {% endif -%} {% if p.modified != None %} {% set when=p.modified %} modified {% else %} {% set when=p.created %} {% endif %} {{ when|reltimeformat }} {% if g.is_grader and p.author_uid == student_uid and g.topic.deadline != None and when > g.topic.deadline %} (after deadline) {% endif %} {% if g.is_teacher or p.author_uid == g.uid %} — edit {% endif %} — reply {% if p.comment != None %}

{{ p.comment }}
{% endif %} {% if p.attachment != None %}

Attachment ({{ p.attachment.split('.')[-1] }}) {% if g.inline_att and p.attachment.endswith('.pdf') %}

{% endif %} {% endif %} {% if p.points != None %}

Points: {{ p.points }} {% endif %}

{% endfor %}
{{ form.csrf_token }} {% if form.ack_time.data %} {{ form.ack_time() }} {% else %} {% endif %}

New post (You can use Markdown with KaTeX math here)

{{ form.csrf_token }} {% if form.errors['comment'] %}

{{ form.errors['comment'][0] }} {% endif %}

{{ form.comment(rows=16, cols=80) }} {% if form.errors['attachment'] %}

{{ form.errors['attachment'][0] }} {% endif %}

{{ form.attachment.label }} {{ form.attachment() }} {% if g.is_grader and student_uid != -1 %}

{{ form.points.label }} {{ form.points(size=6, accesskey='t') }} {% if g.topic.max_points %} / {% endif %} {% if form.errors['points'] %}

{{ form.errors['points'][0] }} {% endif %} {% endif %}

Preview:

{{ form.submit(class='ok', accesskey='s') }}

{% endblock %}