<div class="page-header">
  <div class="page-header-title"><h1><%- @T( 'Notifications' ) %></h1></div>
</div>

<form>

  <h3><%- @T( 'Matrix' ) %></h3>

  <div class="settings-entry">
    <table class="table">
      <tr>
        <td><%- @T('On') %></td><td colspan="3"><%- @T('Criteria') %></td><td colspan="2"><%- @T('Channel') %></td>
      </tr>
      <tr>
        <td></td><td><%- @T('Owned by me') %></td><td><%- @T('Owned by nobody') %></td><td><%- @T('no criteria') %></td><td><%- @T('Email & Online') %></td><td><%- @T('Online') %></td>
      </tr>
      <% if @config.matrix: %>
        <% for key, value of @config.matrix: %>
        <tr>
          <td><%= value.name %></td>
          <td><input type="checkbox" name="matrix.<%= key %>.criteria.owned_by_me" value="true" <% if value.criteria.owned_by_me: %>checked<% end %>/></td>
          <td><input type="checkbox" name="matrix.<%= key %>.criteria.owned_by_nobody" value="true"  <% if value.criteria.owned_by_nobody: %>checked<% end %>/></td>
          <td><input type="checkbox" name="matrix.<%= key %>.criteria.no" value="true"  <% if value.criteria.no: %>checked<% end %>/></td>
          <td><input type="radio" name="matrix.<%= key %>.channel" value="email" <% if value.channel.email: %>checked<% end %>/></td>
          <td><input type="radio" name="matrix.<%= key %>.channel" value="online" <% if value.channel.online: %>checked<% end %>/></td>
        </tr>
        <% end %>
      <% end %>
    </table>
  </div>


  <h3><%- @T( 'Groups' ) %></h3>

  <div class="settings-entry">
    <table class="table">
    <% if @groups: %>
      <% for group in @groups: %>
      <tr>
        <td><%= group.displayName() %></td><td><input type="checkbox" name="group_ids" value="<%= group.id %>" checked/></td>
      </tr>
      <% end %>
    <% end %>
    </table>
  </div>

  <button type="submit" class="btn btn--primary"><%- @T( 'Submit' ) %></button>
</form>