まず、要素を識別できるように、テンプレートに ID を追加します。
<table id="choices">
{% for choice in choices %}
<td><input type="checkbox" name="choice" id="choice{{ forloop.counter }}" value="{{ choice.id }}" /></td>
<td><label for="choice{{ forloop.counter }}">{{ choice.file_name }}</label></td>
{% endfor %}
</table>
次に、ボタンに id とインライン スタイルを指定します -
<button id="unshare_button" style="display: none;">Unshare</button>
次に、次の JavaScript を使用します (これにより、チェックボックスのいずれかがクリックされるとすぐにボタンが表示されます。チェックされていない場合、ボタンは非表示になりません)。
var choices_table = document.getElementByID('choices');
var checkboxes = choices_table.getElementsByTagName('input');
var unshare_button = document.getElementByID('unshare_button');
for (var i = checkboxes.length; i > 0; i--) {
checkboxes[i].addEventListener('click', function() {
unshare_button.style.display = 'inline';
}
}
申し訳ありませんが、このコードをチェックしていませんが、アイデアが得られるはずです。