{% from 'common.html' import disp_post,tag,thread_breadcrumb,vote_meter,pagination_nav %} {% extends 'base.html' %} {% block header %}

{%block title %}{{thread.title}}{% endblock %} #{{thread.id}}

{{ thread_breadcrumb(thread) }} {% endblock %} {%block content%} {% if poll %}

{{poll.title}}

    {%for opt in poll.options%}
  1. {{opt.text}}: {{opt.num or 0}} votes
  2. {%endfor%}
{{ vote_meter(poll) }} {% endif %}
{% if g.user == thread.creator or has_permission(thread.forum, g.user, "p_manage_threads") %} configure thread {% endif %} {% if has_permission(thread.forum, g.user, "p_delete_posts") %} delete thread {% endif %}   {% for the_tag in tags %} {{ tag(the_tag) }} {% endfor %}
{{ pagination_nav(page,max_pageno,'thread.view_thread',thread_id=thread.id) }}
{% for post in posts %} {% if votes[post.id] %} {% set vote = votes[post.id] %} {% set option_idx = vote.option_idx %} {# this is bad but it's going to get refactored anyway #} {% set footer %} {% if vote.is_retraction %} {% if not post.deleted %} {{post.author}} retracted their vote {% else %} this post retracted a vote {% endif %} {% else %} {% set option = poll.options[option_idx-1] %} {% if vote.current %} {{post.author}} votes for {{option_idx}}: {{option.text}} {% else %} {% if not post.deleted %} {{post.author}} voted for {{option_idx}}: {{option.text}}, but later changed their vote {% else %} this post presented a vote that was later changed {% endif %} {% endif %} {% endif %} {% endset %} {{ disp_post(post, forum=thread.forum, buttons=True, footer=footer) }} {% else %} {{ disp_post(post, forum=thread.forum, buttons=True) }} {% endif %} {% endfor %}
{% if g.user and has_permission(thread.forum, g.user, "p_reply_threads") %}
{% if poll and has_permission(thread.forum, g.user, "p_vote") %}
poll: {{poll.title}}

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

{% if has_voted %}
{% endif %} {% for opt in poll.options %}
{% endfor %}
{% endif %}
{% elif g.user %}

you do not have permission to reply to this thread

{% else %}

please log in to reply to this thread

{% endif %} {% endblock %}