aboutsummaryrefslogtreecommitdiffhomepage
path: root/apioforum/templates/view_thread.html
diff options
context:
space:
mode:
Diffstat (limited to 'apioforum/templates/view_thread.html')
-rw-r--r--apioforum/templates/view_thread.html33
1 files changed, 23 insertions, 10 deletions
diff --git a/apioforum/templates/view_thread.html b/apioforum/templates/view_thread.html
index 29914e8..132fd44 100644
--- a/apioforum/templates/view_thread.html
+++ b/apioforum/templates/view_thread.html
@@ -1,7 +1,7 @@
{% from 'common.html' import disp_post,tag,thread_breadcrumb,vote_meter %}
{% extends 'base.html' %}
{% block header %}
-<h1>{%block title %}{{thread.title}}{% endblock %}</h1>
+<h1>{%block title %}{{thread.title}}{% endblock %} <span class="thing-id">#{{thread.id}}</span></h1>
{{ thread_breadcrumb(thread) }}
{% endblock %}
@@ -17,9 +17,12 @@
{% endif %}
<div class="thread-top-bar">
<span class="thread-top-bar-a">
- {% if g.user == thread.creator %}
+ {% if g.user == thread.creator or has_permission(thread.forum, g.user, "p_manage_threads") %}
<a class="actionbutton" href="{{url_for('thread.config_thread',thread_id=thread.id)}}">configure thread</a>
{% endif %}
+ {% if has_permission(thread.forum, g.user, "p_delete_posts") %}
+ <a class="actionbutton" href="{{url_for('thread.delete_thread',thread_id=thread.id)}}">delete thread</a>
+ {% endif %}
</span>
&nbsp;
<span class="thread-top-bar-b">
@@ -39,29 +42,37 @@
{# this is bad but it's going to get refactored anyway #}
{% set footer %}
{% if vote.is_retraction %}
- {{post.author}} retracted their vote
+ {% 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 %}
- {{post.author}} voted for {{option_idx}}: {{option.text}}, but later changed their vote
+ {% 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, buttons=True, footer=footer) }}
+ {{ disp_post(post, forum=thread.forum, buttons=True, footer=footer) }}
{% else %}
- {{ disp_post(post, buttons=True) }}
+ {{ disp_post(post, forum=thread.forum, buttons=True) }}
{% endif %}
{% endfor %}
</div>
-{% if g.user %}
+{% if g.user and has_permission(thread.forum, g.user, "p_reply_threads") %}
<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 %}
+ {% if poll and has_permission(thread.forum, g.user, "p_vote") %}
<fieldset>
<legend>poll: {{poll.title}}</legend>
<p>if you want, you can submit a vote along with this post. if you have previously voted
@@ -73,18 +84,20 @@
{% if has_voted %}
<br>
<input type="radio" id="retractvote" name="poll" value="retractvote">
- <label for="retractvote">retract my vote, and go back to having no vote on this poll</label>
+ <label for="retractvote">clear current vote</label>
{% endif %}
{% 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}}">submit a vote for #{{opt.option_idx}} - {{opt.text}}</label>
+ <label for="option_{{opt.option_idx}}">#{{opt.option_idx}} - {{opt.text}}</label>
{% endfor %}
</fieldset>
{% endif %}
<input type="submit" value="yes">
</form>
+{% elif g.user %}
+<p>you do not have permission to reply to this thread</p>
{% else %}
<p>please log in to reply to this thread</p>
{% endif %}