diff options
author | ubq323 <ubq323> | 2021-06-25 23:24:21 +0000 |
---|---|---|
committer | ubq323 <ubq323> | 2021-06-25 23:24:21 +0000 |
commit | fb3c1f07d6488cfe91f3a5232224ff82e53ec339 (patch) | |
tree | 22c2f034e54d049df051946768df20dd0ccb8109 /apioforum/templates | |
parent | 3c2a773095e23a75d2fcb1ca92699228313f6715 (diff) |
db things, display poll on thread page, start of voting interface
Diffstat (limited to 'apioforum/templates')
-rw-r--r-- | apioforum/templates/view_thread.html | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/apioforum/templates/view_thread.html b/apioforum/templates/view_thread.html index fb62880..855f792 100644 --- a/apioforum/templates/view_thread.html +++ b/apioforum/templates/view_thread.html @@ -5,6 +5,14 @@ {% endblock %} {%block content%} +{% if poll %} +<p>{{poll.title}}</p> +<ul> + {%for opt in poll.options%} + <li>#{{opt.option_idx}} - {{opt.text}}</li> + {%endfor%} +</ul> +{% endif %} <div class="thread-top-bar"> <span class="thread-top-bar-a"> {% if g.user == thread.creator %} @@ -27,6 +35,20 @@ {% if g.user %} <form class="new-post" action="{{url_for('thread.create_post',thread_id=thread.id)}}" method="POST"> <textarea class="new-post-box" placeholder="your post here..." name="content"></textarea> + {% if poll %} + <fieldset> + <legend>poll: {{poll.title}}</legend> + <p>if you want, you can submit a vote along with this post. if you have previously voted + on this poll, your previous vote will be changed</p> + <input type="radio" id="dontvote" name="poll" value="dontvote" checked> + <label for="dontvote">do not submit any vote at the moment</label> + {% for opt in poll.options %} + <br> + <input type="radio" id="option_{{opt.option_idx}}" name="poll" value="{{opt.option_idx}}"> + <label for="option_{{opt.option_idx}}">#{{opt.option_idx}} - {{opt.text}}</label> + {% endfor %} + </fieldset> + {% endif %} <input type="submit" value="yes"> </form> {% else %} |