aboutsummaryrefslogtreecommitdiffhomepage
path: root/apioforum/templates/config_thread.html
blob: 2c9804e14d809d2a75336cdf270c13ea016f999b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{% extends 'base.html' %}
{% from 'common.html' import tag %}
{% block header %}<h1>{% block title %}configure thread '{{thread.title}}'{% endblock %}</h1>{% endblock %}
{% block content %}
<h2>thread options</h2>
<form method="post">
<fieldset>
<legend>title</legend>
<label for="title">thread title</label>
<input type="text" id="title" name="title" value="{{thread.title}}">
</fieldset>
<fieldset>
<legend>tags</legend>
{% if avail_tags %}
	<ul>
		{% for the_tag in avail_tags %}
		<li>
			<input  type="checkbox" id="tag_{{the_tag.id}}" name="tag_{{the_tag.id}}" {%- if the_tag.id in thread_tags %} checked{% endif %}>
			<label for="tag_{{the_tag.id}}">#{{the_tag.id}} {{tag(the_tag)}}</label>
		</li>
		{% endfor %}
	</ul>
{% else %}
	<p>there are no available tags.</p>
{% endif %}
</fieldset>
<p>confirm changes?</p>
<input type="submit" value="confirm">
<a href="{{url_for('thread.view_thread',thread_id=thread.id)}}">cancel</a>
</form>

{% if thread.poll is none %}
<h2>create poll</h2>
<form method="post" action="{{url_for('thread.create_poll',thread_id=thread.id)}}">
    <fieldset>
        <legend>create poll</legend>
        <label for="polltitle">question title</label>
        <input type="title" id="polltitle" name="polltitle">
        <br>
        <label for="polloptions">potential options (one per line)</label>
        <textarea name="polloptions" id="polloptions"></textarea>
    </fieldset>
    <p>important: once a poll is created, you will not be able to modify it except to delete it entirely</p>
    <input type="submit" value="create">
</form>
{% else %}
<h2>delete poll</h2>
<p>there is already a poll attached to this thread. you can delete it, which will allow you to create a new one, but this will erase all existing votes and data for the current poll.</p>
<form action="{{url_for('thread.delete_poll',thread_id=thread.id)}}" method="post">
    <input type="submit" value="confirm: delete poll">
</form>

{% endif %}

{% endblock %}