avalon-django/avalon/avalon_game/templates/pick_wait.html
Daniel Perelman b69b21d518 Add private voting (show vote totals only) mode. Closes #14. (#23)
* Add flag for private voting.
* Always show numbers after a vote.
* Add vote totals to history table and respect private voting flag.
* Make votes no longer private once game is over.
2017-09-08 22:53:08 -07:00

54 lines
1.9 KiB
HTML

{% extends "in_game.html" %}
{% block game_content %}
<div class="pick-phase">
<h2>Pick Phase</h2>
{% if vote_rejected %}
<p class="red">
The previous vote has been rejected (<b class="approve">{{ previous_vote.accepts }}</b>-<b class="reject">{{previous_vote.rejects }}</b>).
A new leader has been chosen.
</p>
{% endif %}
This will be vote #{{ vote_num }} of 5 for this mission.
<p>Your leader, <b class="role">{{ leader.name }}</b>, is choosing {{ team_size }} players for mission {{ round_num }}: </p>
<ul id="chosen-for-mission">
{% for chosen_player in chosen %}
<li>{{ chosen_player.name }}</li>
{% endfor %}
</ul>
<p id="you-chosen">
{% if player in chosen %}
You have been chosen!
{% endif %}
</p>
</div>
{% endblock %}
{% block game_handle_new_status %}
if(oldStatus.game_phase == newStatus.game_phase
&& oldStatus.round_num == newStatus.round_num
&& oldStatus.vote_num == newStatus.vote_num) {
if(JSON.stringify(oldStatus.chosen)
!= JSON.stringify(newStatus.chosen)) {
chosen_list = document.getElementById('chosen-for-mission');
$(chosen_list).empty();
newStatus.chosen.forEach(function(name) {
var el = document.createElement('li');
el.innerText = name;
chosen_list.appendChild(el);
});
statusObj.chosen = newStatus.chosen;
}
if(statusObj.you_chosen != newStatus.you_chosen) {
$('#you-chosen').text(newStatus.you_chosen
? "You have been chosen!"
: "");
statusObj.you_chosen = newStatus.you_chosen;
}
return true;
} else {
return false;
}
{% endblock %}