<form class="plain" method="POST" tal:attributes="action request/URL"
      i18n:domain="schooltool">

  <div class="status"  tal:condition="view/error">
    <div class="summary ui-state-error ui-corner-all">
      <span class="ui-icon ui-icon-alert">icon</span>
      <tal:block content="view/error">
        [error message]
      </tal:block>
    </div>
  </div>

  <fieldset>
    <legend><span tal:content="view/label">[title]</span></legend>
    <div class="row">
      <p tal:condition="view/description"
         tal:content="view/description">[informative text]</p>
    </div>

  <div class="timetable-table">
  <table class="timetable">
    <thead>
    <tr>
      <th tal:repeat="day view/days" tal:content="day" />
    </tr>
    </thead>
    <tbody>
    <tr>
      <td tal:repeat="periods view/periodsInOrder">
        <tal:for define="daynr repeat/periods/index"
                 repeat="period periods">
          <tal:defs define="name string:homeroom_${daynr}_${period}">
            <input type="checkbox"
                   tal:attributes="name name;
                                   id name;
                                   checked python:request.get(name)" />
            <label tal:content="period"
                   tal:attributes="for name" />
          </tal:defs>
          <br />
        </tal:for>

      </td>
    </tr>
    </tbody>
  </table>
  </div>
  </fieldset>
  <div class="buttons">
    <input type="submit" class="button-cancel" name="STEP_BACK" value="Back"
           i18n:attributes="value" />
    <input type="submit" class="button-ok" name="NEXT" value="Next"
           i18n:attributes="value" />
    <input type="hidden" name="viewstate"
           tal:attributes="value json: view/view/json_state" />
  </div>

</form>
