<script>
  function select_all_responsible() {
    $('input.person_list').each(function (index) {
      this.checked = !this.checked;
    });
  }
</script>
<table i18n:domain="schooltool.intervention" id="person_list">
  <tr>
    <td>
      <span i18n:translate="">Staff</span>
      <a href="javascript:select_all_responsible()"
        tal:condition="view/enabled" i18n:translate="">
        Select All
      </a>
    </td>
    <td i18n:translate="">Student/Parents</td>
  </tr>
  <tr>
    <td style="vertical-align: top; horizontal-align: left; width: 20em">
      <tal:block repeat="person view/responsible">
        <input type="checkbox" class="person_list"
               tal:attributes="name person/name; checked person/checked" />
        <span tal:condition="python: view.canEmail(person)">
          <b tal:content="person/value" />
        </span>
        <span tal:content="person/value"
              tal:condition="python: not view.canEmail(person)" />
        <br />
      </tal:block>
    </td>
    <td style="vertical-align: top; horizontal-align: left; width: 20em">
      <tal:block repeat="person view/notified">
        <input type="checkbox" class="notified_list"
               tal:attributes="name person/name; checked person/checked" />
        <span tal:condition="python: view.canEmail(person)">
          <b tal:content="person/value" />
        </span>
        <span tal:content="person/value"
              tal:condition="python: not view.canEmail(person)" />
        <br />
      </tal:block>
      <tal:block condition="view/changed">
        <div style="height: 1em"></div>
        <span i18n:translate="">Changed Status</span>
        <div style="height: .5em"></div>
        <tal:block repeat="person view/changed">
          <input type="checkbox" class="changed_list"
                 tal:attributes="name person/name; checked person/checked" />
          <span tal:condition="python: view.canEmail(person)">
            <b tal:content="person/value" />
          </span>
          <span tal:content="person/value"
                tal:condition="python: not view.canEmail(person)" />
          <br />
        </tal:block>
      </tal:block>
    </td>
  </tr>
</table>
