admin-edit-topic.html 1.34 KB
Newer Older
Martin Mareš's avatar
Martin Mareš committed
1
2
{% extends "base.html" %}
{% block body %}
Martin Mareš's avatar
Martin Mareš committed
3
	<h2>Edit{% if copy_tid != None %} copy of{% endif %} topic</h2>
Martin Mareš's avatar
Martin Mareš committed
4

5
	{% macro field(name, help=None) %}
Martin Mareš's avatar
Martin Mareš committed
6
		<tr>
7
8
9
		    <td{% if form.errors[name] %} class=error{% endif %}>{{ form[name].label }}
		    <td>{{ form[name]() }}
		    <td class=explain>{{ help or "" }}
Martin Mareš's avatar
Martin Mareš committed
10
		        {% if form.errors[name] %}
11
				<br><span class=error>{{ form.errors[name][0] }}</span>
Martin Mareš's avatar
Martin Mareš committed
12
13
14
15
16
17
			{% endif %}
	{% endmacro %}

	<form method="POST" action="">
		{{ form.csrf_token }}
		<table>
18
19
		{{ field('rank', 'numeric sorting key') }}
		{{ field('ident', 'identifier in URL, unique within course') }}
Martin Mareš's avatar
Martin Mareš committed
20
21
		{{ field('title') }}
		{{ field('type') }}
22
		{{ field('deadline', 'in local time zone (if your browser does not support datetime widgets, enter yyyy-mm-ddThh:mm)') }}
Martin Mareš's avatar
Martin Mareš committed
23
		{{ field('max_points') }}
24
25
		{{ field('public', 'topic is visible to students') }}
		{{ field('notify', 'send notifications on all posts now') }}
Martin Mareš's avatar
Martin Mareš committed
26
		</table>
Martin Mareš's avatar
Martin Mareš committed
27
28
29
30
		{% if form.copy_to %}
			<h3>Copy to course</h3>
			{{ form.copy_to }}
		{% endif %}
Martin Mareš's avatar
Martin Mareš committed
31
		<p class=buttons>{{ form.submit(class='ok', accesskey='s') }}
Martin Mareš's avatar
Martin Mareš committed
32
	{% if tid != None %}
Martin Mareš's avatar
Martin Mareš committed
33
		<a class=button accesskey='c' href='{{ url_for('admin_edit_topic', sident=g.course.sident, cident=g.course.ident, copy_tid=tid) }}'>Copy</a>
Martin Mareš's avatar
Martin Mareš committed
34
		<p>{{ form.delete(class='danger') }}&nbsp;&nbsp;(including {{ post_count }} posts)
Martin Mareš's avatar
Martin Mareš committed
35
	{% endif %}
Martin Mareš's avatar
Martin Mareš committed
36
37
	</form>
{% endblock %}