{% load i18n %}

<div id="notifications">
  <h3>{% trans "Change notification preferences" %}</h3>
  <form id="notifications-form" method="post" action="">
    {% csrf_token %}
    <table id="notifications-table">
      <thead>
        <tr class="notifications-headers">
          <td class="notifications-label notifications-header">{% trans "filetype" %}</td>
          {% for choice in form.choices %}
            <td class="notifications-choice notifications-header notifications-choice-{{ choice.0 }}">
              {{ choice.1 }}
            </td>
          {% endfor %}
        </tr>
      </thead>
      <tbody>
        <tr>
          <td class="notifications-label">{% trans "All" %}</td>
          {% for choice in form.choices %}
            <td class="notifications-choice notifications-all notifications-choice-{{ choice.0 }}">
              <input type="checkbox" class="js-checkall-value" value="{{ choice.0 }}"/>
            </td>
          {% endfor %}
        </tr>
      </tbody>
      <tbody>
        {% for field in form %}
          <tr class="notifications-filetype-row">
            <td class="notifications-label notifications-filetype-name">
              <label class="notifications-filetype-label">{{ field.label }}</label>
            </td>
            {% for checkbox in field %}
              <td class="notifications-choice notifications-filetype-choice notifications-choice-{{ checkbox.choice_value }}">
                {{ checkbox.tag }}
              </td>
            {% endfor %}
          </tr>
        {% endfor %}

      </tbody>
      <tbody>
        <tr>
          <td class="notifications-label">{% trans "All" %}</td>
          {% for choice in form.choices %}
            <td class="notifications-choice notifications-all notifications-choice-{{ choice.0 }}">
              <input type="checkbox" class="js-checkall-value" value="{{ choice.0 }}"/>
            </td>
          {% endfor %}
        </tr>
      </tbody>
    </table>
    <input type="submit" name="{{ form.prefix }}-validate" value="{% trans "Validate" %}"/>
    <button onclick="document.location.href='#'; return false;">{% trans "Cancel" %}</button>
  </form>
</div>
