diff options
author | ubq323 <ubq323> | 2021-06-26 01:05:28 +0000 |
---|---|---|
committer | ubq323 <ubq323> | 2021-06-26 01:05:28 +0000 |
commit | a1660cad33f03828e2c74d8f083ad6490ea0da7f (patch) | |
tree | 3237418f6317d0c9bbe765c172d47ef76304e9e6 /apioforum/templates/view_thread.html | |
parent | ccb0394a52050f21701c856239f999ede529f71b (diff) |
displaying of votes on posts
Diffstat (limited to 'apioforum/templates/view_thread.html')
-rw-r--r-- | apioforum/templates/view_thread.html | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/apioforum/templates/view_thread.html b/apioforum/templates/view_thread.html index d45b36b..513ee59 100644 --- a/apioforum/templates/view_thread.html +++ b/apioforum/templates/view_thread.html @@ -29,7 +29,25 @@ <div class="posts"> {% for post in posts %} - {{ disp_post(post, True) }} + {% if votes[post.id] %} + + {% set vote = votes[post.id] %} + {% set option_idx = vote.option_idx %} + {% set option = poll.options[option_idx-1] %} + + {% set footer %} + {% if vote.current %} + {{post.author}} votes for {{option_idx}}: {{option.text}} + {% else %} + {{post.author}} voted for {{option_idx}}: {{option.text}}, but later changed their vote + {% endif %} + {% endset %} + + {{ disp_post(post, buttons=True, footer=footer) }} + + {% else %} + {{ disp_post(post, buttons=True) }} + {% endif %} {% endfor %} </div> {% if g.user %} |