<h1 tal:replace="structure context/manage_page_header">PAGE HEADER</h1>
<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
    tal:replace="structure context/manage_tabs">TABS</h2>

<h2> Site Configuration Import Steps </h2>

<p class="form-help">
This tool allows one to re-run individual steps of the site setup
procedure, in order to pick up changes since the site was created.
</p>

<h3>Available Import Steps</h3>

<form action="." method="POST"
      tal:attributes="action context/absolute_url" >
<input type="hidden" name="ids:default:tokens" value="" />

<table cellspacing="0" cellpadding="4">

 <thead>
  <tr class="list-header">
   <td class="list-item">Sel.</td>
   <td class="list-item">#</td>
   <td class="list-item">Title / Description</td>
   <td class="list-item">Handler</td>
  </tr>
 </thead>

 <tbody tal:define="registry context/getImportStepRegistry;
                    step_ids registry/sortSteps;
                   ">
  <tal:loop tal:repeat="step_id step_ids">
  <tr valign="top"
      tal:define="info python: registry.getStepMetadata( step_id );"
      tal:attributes="class python:
                     repeat[ 'step_id' ].odd and 'row-normal' or 'row-hilite'" >
   <td class="list-item" width="16">
    <input type="checkbox" name="ids:list" value="STEP_ID"
           tal:attributes="value step_id" />
   </td>
   <td align="right" class="list-item"
       tal:content="repeat/step_id/number">1</td>
   <td class="list-item">
    <span tal:content="info/title">STEP TITLE</span><br />
    <em tal:content="info/description">STEP DESCRIPTION</em>
   </td>
   <td class="list-item"
       tal:content="info/handler">DOTTED.NAME</td>
  </tr>
  </tal:loop>

  <tr valign="top" class="list-header">
   <td colspan="4">&nbsp;</td>
  </tr>

  <tr valign="top">
   <td />
   <td colspan="3">

    <input type="hidden" name="run_dependencies:int:default" value="0" />
    <input class="form-element" type="checkbox" id="run_dependencies"
           name="run_dependencies:boolean" value="1" checked="checked" />
    <label for="run_dependencies">Include dependencies?</label>
    &nbsp; &nbsp;

    <input class="form-element" type="submit"
           name="manage_importSelectedSteps:method"
           value=" Import selected steps " />
      
    <input class="form-element" type="submit"
           name="manage_importAllSteps:method"
           value=" Import all steps " />
   </td>
  </tr>
 </tbody>

 <tbody tal:condition="options/messages | nothing">
  <tr class="list-header">
   <td colspan="4">Message Log</td>
  </tr>
  <tr valign="top"
      tal:repeat="item options/messages/items">
   <td tal:content="python: item[0]">STEP</td>
   <td colspan="3"
       tal:content="structure python: item[1].replace('\n', '<br />')"
       >MESSAGE</td>
  </tr>
 </tbody>

</table>
</form>

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