<tal:block metal:use-macro="python:here.getFormsTool().getForm('site_admin_template').macros['page']">

<h1 metal:fill-slot="title" i18n:translate="">Manage portlets - List of links</h1>

<tal:block metal:fill-slot="section"
  tal:define="site_url here/getSitePath;
        ob_id python:request.get('id', '')">
<div class="tabbedmenu">
<ul>
  <li><a tal:attributes="href string:${site_url}/admin_remotechportlets_html" i18n:translate="">Remote channels</a></li>
  <li><a tal:attributes="href string:${site_url}/admin_localchportlets_html" i18n:translate="">Local channels</a></li>
  <li><a tal:attributes="href string:${site_url}/admin_folderportlets_html" i18n:translate="">For folders</a></li>
  <li class="currenttab"><a tal:attributes="href string:${site_url}/admin_linksportlets_html" i18n:translate="">List of links</a></li>
  <li><a tal:attributes="href string:${site_url}/admin_htmlportlets_html" i18n:translate="">Static HTML</a></li>
  <li><a tal:attributes="href string:${site_url}/admin_specialportlets_html" i18n:translate="">Special</a></li>
</ul>
</div>

<p i18n:translate="" class="cleaner">
  This form allows you to create new portlets from a
  <em i18n:name="list-of-links" i18n:translate="">list of links</em>, which
  will display a certain number of items from that list.
</p>

<fieldset>
  <legend i18n:translate="">Choose the list of links you wish to generate a portlet from</legend>
  <p i18n:translate="">The list below presents the list of links previously defined in this portal for which a portlet was not yet defined</p>
  <form method="post" tal:attributes="action string:${site_url}/admin_addlinksportlet">
    <div class="field-inline">
      <label for="id" i18n:translate="">List of links</label>
      <select name="id">
        <option value="">&nbsp;</option>
        <option tal:repeat="item here/get_linkslists_noportlet"
            tal:attributes="value item/id"
            tal:content="item/title_or_id" />
      </select>
      <input type="submit" value="Create" i18n:attributes="value" />
    </div>
  </form>
</fieldset>
<br />
<form method="post" tal:attributes="action string:${site_url}/admin_deletelinksportlet">
  <table class="datatable" tal:define="portlets python:here.getPortletsTool().get_linkslists_portlets()">
  <thead>
    <tr>
      <th class="scope-col" scope="col">&nbsp;</th>
      <th class="scope-col" scope="col" i18n:translate="">Title</th>
    </tr>
  </thead>
  <tbody>
    <tr tal:repeat="portlet portlets" tal:attributes="class python:test(path('repeat/portlet/odd'), 'zebraodd', 'zebraeven')">
      <td><input type="checkbox" name="ids" tal:attributes="value portlet/id" /></td>
      <td tal:content="portlet/title_or_id" />
    </tr>
  </tbody>
  </table>
  <input type="submit" value="Delete" i18n:attributes="value" />
</form>
</tal:block>

</tal:block>
