<h1 tal:replace="structure context/manage_page_header">PAGE HEADER</h1>
<h2 tal:replace="structure context/manage_tabs">TABS</h2>

<h2>Manage steps registry</h2>

<p class="form-help">
This form allows one to manage the persistent import and export step
registries. Steps registered via ZCML are not shown here.
</p>

<h2>Import steps</h2>

<tal:block define="view nocall:context/@@manage_importsteps;
                   invalid_steps view/invalidSteps;
                   double_steps view/doubleSteps;">

  <tal:block condition="not:invalid_steps">
    <p>
      There are no import steps with an invalid step handler.
    </p>
  </tal:block>

  <tal:block condition="invalid_steps">
    <h3>Steps with invalid step handlers</h3>

    <form action="." method="post"
      tal:attributes="action string:${context/absolute_url}/manage_stepRegistry">
      <input type="hidden" name="registry" value="import"/>
      <table cellspacing="0" cellpadding="4">
        <thead>
          <tr class="list-header">
            <th>Sel.</th>
            <th>Title / Description</th>
            <th>Handler</th>
          </tr>
        </thead>
        <tbody>
          <tr tal:repeat="step invalid_steps">
            <td>
              <input type="checkbox" name="ids:list" tal:attributes="value step/id"/>
            </td>
            <td>
              <span tal:replace="step/title">Step title</span><br/>
              <em tal:content="step/description">Step description</em>
            </td>
            <td tal:content="step/handler">
              Products.StepProduct.setuphandlers.handler
            </td>
          </tr>
          <tr>
            <td/>
            <td colspan="2">
              <input type="submit" class="form-element"
                     name="manage_deleteImportSteps:method"
                     value=" Delete selected steps "/>
            </td>
          </tr>
        </tbody>
      </table>
    </form>
  </tal:block>

  <tal:block condition="not:double_steps">
    <p>
      There are no import steps that are both registered via ZCML
      and listed in the persistent step registry.
    </p>
  </tal:block>

  <tal:block condition="double_steps">
    <h3>Doubly registered steps</h3>
    <p>
      These import steps are both registered via ZCML and listed in the
      persistent step registry.
    </p>

    <form action="." method="post"
      tal:attributes="action string:${context/absolute_url}/manage_stepRegistry">
      <input type="hidden" name="registry" value="import"/>
      <table cellspacing="0" cellpadding="4">
        <thead>
          <tr class="list-header">
            <th>Sel.</th>
            <th>Title / Description</th>
            <th>Handler</th>
          </tr>
        </thead>
        <tbody>
          <tr tal:repeat="step double_steps">
            <td>
              <input type="checkbox" name="ids:list" tal:attributes="value step/id"/>
            </td>
            <td>
              <span tal:replace="step/title">Step title</span><br/>
              <em tal:content="step/description">Step description</em>
            </td>
            <td tal:content="step/handler">
              Products.StepProduct.setuphandlers.handler
            </td>
          </tr>
          <tr>
            <td/>
            <td colspan="2">
              <input type="submit" class="form-element"
                     name="manage_deleteImportSteps:method"
                     value=" Delete selected steps "/>
            </td>
          </tr>
        </tbody>
      </table>
    </form>
  </tal:block>
</tal:block>

<h2>Export steps</h2>

<tal:block define="view nocall:context/@@manage_exportsteps;
                   invalid_steps view/invalidSteps;
                   double_steps view/doubleSteps;">

  <tal:block condition="not:invalid_steps">
    <p>
      There are no export steps with an invalid step handler.
    </p>
  </tal:block>

  <tal:block condition="invalid_steps">
    <h3>Steps with invalid step handlers</h3>

    <form action="." method="post"
      tal:attributes="action string:${context/absolute_url}/manage_stepRegistry">
      <input type="hidden" name="registry" value="export"/>
      <table cellspacing="0" cellpadding="4">
        <thead>
          <tr class="list-header">
            <th>Sel.</th>
            <th>Title / Description</th>
            <th>Handler</th>
          </tr>
        </thead>
        <tbody>
          <tr tal:repeat="step invalid_steps">
            <td>
              <input type="checkbox" name="ids:list" tal:attributes="value step/id"/>
            </td>
            <td>
              <span tal:replace="step/title">Step title</span><br/>
              <em tal:content="step/description">Step description</em>
            </td>
            <td tal:content="step/handler">
              Products.StepProduct.setuphandlers.handler
            </td>
          </tr>
          <tr>
            <td/>
            <td colspan="2">
              <input type="submit" class="form-element"
                     name="manage_deleteExportSteps:method"
                     value=" Delete selected steps "/>
            </td>
          </tr>
        </tbody>
      </table>
    </form>
  </tal:block>

  <tal:block condition="not:double_steps">
    <p>
      There are no export steps that are both registered via ZCML
      and listed in the persistent step registry.
    </p>
  </tal:block>

  <tal:block condition="double_steps">
    <h3>Doubly registered steps</h3>
    <p>
      These export steps are both registered via ZCML and listed in the
      persistent step registry.
    </p>

    <form action="." method="post"
      tal:attributes="action string:${context/absolute_url}/manage_stepRegistry">
      <input type="hidden" name="registry" value="export"/>
      <table cellspacing="0" cellpadding="4">
        <thead>
          <tr class="list-header">
            <th>Sel.</th>
            <th>Title / Description</th>
            <th>Handler</th>
          </tr>
        </thead>
        <tbody>
          <tr tal:repeat="step double_steps">
            <td>
              <input type="checkbox" name="ids:list" tal:attributes="value step/id"/>
            </td>
            <td>
              <span tal:replace="step/title">Step title</span><br/>
              <em tal:content="step/description">Step description</em>
            </td>
            <td tal:content="step/handler">
              Products.StepProduct.setuphandlers.handler
            </td>
          </tr>
          <tr>
            <td/>
            <td colspan="2">
              <input type="submit" class="form-element"
                     name="manage_deleteExportSteps:method"
                     value=" Delete selected steps "/>
            </td>
          </tr>
        </tbody>
      </table>
    </form>
  </tal:block>
</tal:block>

<h1 tal:replace="structure context/manage_page_footer">PAGE FOOTER</h1>
