<metal:block use-macro="here/standard_template_macro">
<metal:block fill-slot="body">

<h1 tal:define="site_object_index python:here.getFormsTool()['site_object_index']">
    <metal:block use-macro="site_object_index/macros/icon" />
    <tal:block tal:replace="here/title_or_id" /> -
    <span i18n:translate="">Rename items</span>
</h1>

<div class="floated-buttons"><span class="buttons"><a tal:attributes="href here/absolute_url" i18n:translate="">Back to index</a></span></div>

<p i18n:translate="">All the items in the portal have pregenerated ids, as you can see them in the URLs. This page allows changing the ids of the selected items. Remember that ids must not contain any special characters or spaces.</p>

<form method="post" name="renameObjects" tal:attributes="action string:${here/absolute_url}/renameObjectsIds">

<tal:block define="selected_items python:here.utConvertToList(request.get('id'))">
<table>
    <tr>
        <th class="type" i18n:translate="Type (translate as a noun)">Type</th>
        <th class="title-column" i18n:translate="">Title</th>
        <th class="title-column" i18n:translate="">Old ID</th>
        <th class="edit" i18n:translate="">New ID</th>
    </tr>
    <tr tal:repeat="selected_item selected_items">
        <tal:block define="item python:here.getObjectById(selected_item)">
        <td class="type">
            <img tal:define="icon python:here.rstk['get_object_view_info'](item)['icon']"
                 tal:attributes="src icon/url; title icon/title; alt icon/title" />
        </td>
        <td class="title-column">
            <a tal:attributes="href item/absolute_url" tal:content="item/title_or_id"/>
        </td>
        <td><span tal:content="item/id" />
        <input type="hidden" name="old_ids:list" tal:attributes="value item/id" /></td>
        <td class="edit"><input type="text" size="40" name="new_ids:list" tal:attributes="value item/id" /></td>
        </tal:block>
    </tr>
</table>
</tal:block>
<input type="submit" name="renameBtn" value="Rename" i18n:attributes="value" />
<a tal:attributes="href here/absolute_url" i18n:translate="">Cancel</a>
</form>

</metal:block>
</metal:block>
