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

<p class="form-help">
	Pluggable Naaya content types.
</p>

<style>
    table.content_types { border: 1px solid #333; border-collapse: collapse; }
    table.content_types tbody tr { border-top: 1px solid #aaa; }
    table.content_types td { padding: .5em 2em; margin: 0; vertical-align: middle; }
    table.content_types td form { margin: 0; }
</style>

<table class='content_types'>

<thead>
    <tr>
        <th>Meta type</th>
        <th>Module name</th>
        <th>Permission</th>
        <th>Installed</th>
        <th></th>
    </tr>
</thead>

<tbody tal:repeat="content_type python:here.getSite().get_pluggable_content().values()">
    <tr tal:define="
            meta_type content_type/meta_type;
            schema python:here.portal_schemas.getSchemaForMetatype(meta_type);
            installed python:here.is_pluggable_item_installed(meta_type);
            ">
        <td>
            <a tal:condition="schema" tal:content="meta_type" tal:attributes="href string:${schema/absolute_url}/admin_html" />
            <tal:block condition="not:schema" tal:content="meta_type" />
        </td>
        <td tal:content="content_type/module|nothing" />
        <td tal:content="content_type/permission|nothing" />
        <td style="text-align: center" tal:content="structure python:test(installed, u'\u2713', '')" />
        <td>
            <form method="post" tal:attributes="action string:${here/absolute_url}/">
                <input type="hidden" name="meta_type" tal:attributes="value meta_type" />
                <input type="submit" name="manage_uninstall_pluggableitem:method" value="Remove" tal:condition="installed" />
                <input type="submit" name="manage_install_pluggableitem:method" value="Install" tal:condition="not:installed" />
            </form>
        </td>
    </tr>
</tbody>

</table>

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