<h1 tal:replace="structure here/manage_page_header" />
<h1 tal:replace="structure here/manage_tabs" />

<h3>Kupu Library Tool</h3>

<h4>Map resource types</h4>

<p>While libraries provide abstract locations for objects of any type,
Kupu distinguishes objects by resource type. For example, a user might
request a library showing objects to link to or a library showing
objects to be inserted into a document. The abstract location
(library) might be the same, but the former library would contain
documents, the latter images.</p>

<p>This management screen allows you to define resource types using a
list of portal types. A special resource type, <code>collection</code>,
identifies portal types that are to be treated as collections.</p>

<form action="" method="post" tal:attributes="action here/absolute_url">

<table>

  <tr>
    <td></td>
    <th>Resource type</th>
    <th>Portal types</th>
  </tr>

  <tr tal:repeat="type_tuple here/zmi_get_type_mapping">
    <tal:with define="resource_type python:type_tuple[0];
                      portal_types  python:type_tuple[1]">
    <td valign="top">
      <input type="checkbox" name="resource_types:list"
             tal:attributes="value resource_type" />
      <input type="hidden" name="type_info.old_type:records"
             tal:attributes="value resource_type" />
    </td>

    <td valign="top">
      <input type="text" name="type_info.resource_type:records"
             tal:attributes="value resource_type" />
    </td>

    <td valign="top">
      <textarea name="type_info.portal_types:lines:records"
                rows="5" cols="30"
                tal:content="python:'\n'.join(portal_types)">
      </textarea>
    </td>
    </tal:with>
  </tr>

</table>

<p>
  <input type="submit" name="zmi_add_resource_type:method" value="Add" />
  <input type="submit" name="zmi_update_resource_types:method" value="Save" />
  <input type="submit" name="zmi_delete_resource_types:method" value="Delete" />
</p>

<table>
  <tr>
    <td></td>
    <td valign="top"><input type="text" name="resource_type" /></td>
    <td valign="top">
      <textarea name="portal_types:lines" rows="5" cols="30"></textarea>
    </td>
  </tr>
</table>
</form>

<h1 tal:replace="structure here/manage_page_footer" />
