Finish Question/poll support
This commit is contained in:
@@ -13,6 +13,18 @@
|
||||
{% endif %}
|
||||
|
||||
<div class="box">
|
||||
<nav class="flexbox">
|
||||
<ul>
|
||||
{% for ap_type in ["Note", "Question"] %}
|
||||
<li><a href="?type={{ ap_type }}" {% if request.query_params.get("type", "Note") == ap_type %}class="active"{% endif %}>
|
||||
{{ ap_type }}
|
||||
</a>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
|
||||
<form class="form" action="{{ request.url_for("admin_actions_new") }}" enctype="multipart/form-data" method="POST">
|
||||
{{ utils.embed_csrf_token() }}
|
||||
{{ utils.embed_redirect_url() }}
|
||||
@@ -31,6 +43,30 @@
|
||||
{% endfor %}
|
||||
|
||||
<textarea name="content" rows="10" cols="50" autofocus="autofocus" designMode="on" placeholder="Hey!" style="font-size:1.2em;width:95%;">{{ content }}</textarea>
|
||||
|
||||
{% if request.query_params.type == "Question" %}
|
||||
<p>
|
||||
<select name="poll_type">
|
||||
<option value="oneOf">single choice</option>
|
||||
<option value="anyOf">multiple choices</option>
|
||||
</select>
|
||||
</p>
|
||||
<p>
|
||||
<select name="poll_duration">
|
||||
<option value="5">ends in 5 minutes</option>
|
||||
<option value="30">ends in 30 minutes</option>
|
||||
<option value="60">ends in 1 hour</option>
|
||||
<option value="360">ends in 6 hours</option>
|
||||
<option value="1440">ends in 1 day</option>
|
||||
</select>
|
||||
</p>
|
||||
{% for i in ["1", "2", "3", "4"] %}
|
||||
<p>
|
||||
<input type="text" name="poll_answer_{{ i }}" style="width:95%;" placeholder="Option {{ i }}, leave empty to disable">
|
||||
</p>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<p>
|
||||
<input type="text" name="content_warning" placeholder="content warning (will mark the post as sensitive)" style="width:95%;">
|
||||
</p>
|
||||
|
@@ -291,7 +291,7 @@
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if object.ap_type == "Question" %}
|
||||
{% if object.ap_type == "Question" and (not object.sensitive or (object.sensitive and object.permalink_id in request.query_params.getlist("show_more"))) %}
|
||||
{% set can_vote = is_admin and object.is_from_inbox and not object.is_poll_ended and not object.voted_for_answers %}
|
||||
{% if can_vote %}
|
||||
<form action="{{ request.url_for("admin_actions_vote") }}" method="POST">
|
||||
|
Reference in New Issue
Block a user