master
kek7198 2021-12-10 21:08:23 -06:00
parent 0ae5608d39
commit f7f3e0bed6
3 changed files with 28 additions and 6 deletions

View File

@ -0,0 +1,13 @@
{% for c in p.bet_options %}
<span id="span-{{c.id}}" {% if c.poll_voted(v) %}class="bet_voted"{% endif %}>
<input {% if c.poll_voted(v) %}checked{% endif %} class="bet" {% if not (v and v.coins > 200) or p.total_bet_voted(v) %}disabled{% endif %} type="radio" id="{{c.id}}" onchange="bet_vote('{{c.id}}')">
</span>
<label for="{{c.id}}">
{{c.body_html | safe}} -
<a href="/votes?link=t3_{{c.id}}">
<span id="bet-{{c.id}}">{{c.upvotes}}</span> bets
</a>
{% if not p.total_bet_voted(v) %} (cost of entry: 200 coins){% endif %}
</label>
<br>
{% endfor %}

View File

@ -0,0 +1,6 @@
{% for c in p.options %}
<div class="custom-control">
<input type="checkbox" class="custom-control-input" id="{{c.id}}" name="option" {% if c.poll_voted(v) %}checked{% endif %} onchange="poll_vote('{{c.id}}')">
<label class="custom-control-label" for="{{c.id}}">{{c.body_html | safe}} - <a href="/votes?link=t3_{{c.id}}"><span id="poll-{{c.id}}">{{c.upvotes}}</span> votes</a></label>
</div>
{% endfor %}

View File

@ -429,12 +429,15 @@
{{p.realbody(v) | safe}}
{% for c in p.options %}
<div class="custom-control">
<input type="checkbox" class="custom-control-input" id="{{c.id}}" name="option" {% if c.poll_voted(v) %}checked{% endif %} onchange="poll_vote('{{c.id}}')">
<label class="custom-control-label" for="{{c.id}}">{{c.body_html | safe}} - <a href="/votes?link=t3_{{c.id}}"><span id="poll-{{c.id}}">{{c.upvotes}}</span> votes</a></label>
</div>
{% endfor %}
<!-- Polls -->
{% if p.options %}
{% include "Poll.html" %}
{% endif %}
<!-- Bets -->
{% if p.bet_options %}
{% include "Bets.html" %}
{% endif %}
</div>