<h1 tal:replace="structure here/manage_page_header|nothing">Header</h1>
<h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
    tal:replace="structure here/manage_tabs">Tabs</h2>


   <div class="form-title">
     Transformation policy
   </div>

   <div>
     This page allow you to configure which transforms do you want to be applied
     for a give output MIME type.
   </div>
 
   <hr/>

   <form method="POST" action="manage_addPolicy">

     <table>
       <tr>
	 <th align="left">output type</th>
	 <th align="left">use transforms</th>
       </tr>
       <tr>
         <td>
	   <select name="output_mimetype" 
                   tal:define="mimetypes here/mimetypes_registry/list_mimetypes;
                               dummy mimetypes/sort">
	     <option tal:repeat="mimetype mimetypes"
		     tal:attributes="value mimetype;"
		     tal:content="mimetype"/>
	   </select>
	 </td>
         <td>
	   <select name="required_transforms" multiple="multiple">
	     <option tal:repeat="id here/objectIds"
		     tal:attributes="value id;"
		     tal:content="id"/>
	   </select>
         </td>
       </tr>
     </table>

     <input type="submit" value="add"/>

   </form>

   <hr/>

   <form method="POST" action="manage_delPolicies"
         tal:define="policies here/listPolicies" tal:condition="policies">

     <table>
       <tr>
	   <th colspan="2" align="left">output type</th>
	   <th align="left">use transforms</th>
       </tr>
       <tr tal:repeat="policy policies">
	 <td>
	   <input type="checkbox" name="outputs:list"
     	          tal:attributes="value python:policy[0]"/>
         </td>
	 <td tal:content="python:policy[0]">
	 </td>
	 <td tal:content="python:', '.join(policy[1])">
	 </td>
       </tr>
     </table>

     <input type="submit" value="delete selected"/>

   </form>

<tal:footer tal:replace="structure here/manage_page_footer|nothing">footer</tal:footer>
