fix: Hide actual votes when voting in order not to reveal too much; visibility can be toggled. Closes #24 #27
|
@ -95,7 +95,20 @@
|
||||||
<a class="btn {% if vote == 2 %} active {% endif %}btn-success" href="{% url 'talk-vote' talk.pk 2 %}">+2</a>
|
<a class="btn {% if vote == 2 %} active {% endif %}btn-success" href="{% url 'talk-vote' talk.pk 2 %}">+2</a>
|
||||||
</div>
|
</div>
|
||||||
</p>
|
</p>
|
||||||
<p>{{ talk.vote_set.count }} {% trans "vote" %}{{ talk.vote_set.count|pluralize }}, {% trans "average:" %} {{ talk.score|floatformat:1 }}</p>
|
|
||||||
|
<p><button class="btn btn-info" onclick="toggle_votes()">{% trans "Toggle actual votes" %}</button> <span id="actual_votes" class="invisible">{{ talk.vote_set.count }} {% trans "vote" %}{{ talk.vote_set.count|pluralize }}, {% trans "average:" %} {{ talk.score|floatformat:1 }}</span></p>
|
||||||
|
<script>
|
||||||
|
function toggle_votes(){
|
||||||
|
let votes = document.getElementById('actual_votes');
|
||||||
|
if (votes != null) {
|
||||||
|
if (votes.className == "invisible") {
|
||||||
|
votes.className = "visible";
|
||||||
|
} else {
|
||||||
|
votes.className = "invisible";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<a href="{% url 'talk-accept' talk.pk %}" class="btn btn-success">{% trans "Accept" %}</a>
|
<a href="{% url 'talk-accept' talk.pk %}" class="btn btn-success">{% trans "Accept" %}</a>
|
||||||
<a href="{% url 'talk-decline' talk.pk %}" class="btn btn-danger">{% trans "Decline" %}</a>
|
<a href="{% url 'talk-decline' talk.pk %}" class="btn btn-danger">{% trans "Decline" %}</a>
|
||||||
|
|
Loading…
Reference in New Issue