Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions templates/tabular/tabular-by-candidate.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{% load static %}

{% for candidateTabulation in tabularByCandidate.tabulation %}
<table class="shadow-wrapper table fixed-width-table">
<div class="candidate-container" data-candidate-name="{{ candidateTabulation.name }}" data-is-winner="{{ candidateTabulation.isWinner|yesno:'true,false' }}">
<h4 class="text-center"> {{ candidateTabulation.name }} </h4>
<table class="shadow-wrapper table fixed-width-table">
<thead class="thead-light">
<tr>
<th scope="col">Round</th>
Expand All @@ -21,5 +22,23 @@ <h4 class="text-center"> {{ candidateTabulation.name }} </h4>
</tr>
{% endfor %}
</tbody>
</table>
</table>
</div>
{% endfor %}

<script>
document.addEventListener('DOMContentLoaded', function() {
console.log(config.onlyShowWinnersTabular);
if (!config.onlyShowWinnersTabular) {
return;
}

const candidateContainers = document.querySelectorAll('.candidate-container');
candidateContainers.forEach(function(container) {
console.log(container.getAttribute('data-is-winner'));
if (container.getAttribute('data-is-winner') !== 'true') {
container.style.display = 'none';
}
});
});
</script>
Loading