fix: Hide actual votes when voting in order not to reveal too much; visibility can be toggled. Closes #24

This commit is contained in:
Mindiell 2023-04-23 19:02:45 +02:00
parent 787bc67794
commit d3dd49f3c4
1 changed files with 14 additions and 1 deletions

View File

@ -95,7 +95,20 @@
<a class="btn {% if vote == 2 %} active {% endif %}btn-success" href="{% url 'talk-vote' talk.pk 2 %}">+2</a>
</div>
</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-decline' talk.pk %}" class="btn btn-danger">{% trans "Decline" %}</a>