<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      metal:use-macro="context/main_template/macros/master"
      i18n:domain="plone">

  <body>
    <metal:main fill-slot="main" tal:define="plone_view context/@@plone">

      <h1 class="documentFirstHeading"
          i18n:translate="title_manage_contextual_portlets">
        Manage portlets for
        <q i18n:name="context_title" tal:content="context/Title">title</q>
      </h1>

      <div id="content-core">
        <a href=""
           class="link-parent btn btn-outline-secondary"
           tal:attributes="href string:${context/absolute_url}">
          <i class="fas fa-chevron-left"></i>
          <span i18n:translate="return_to_view">Return</span>
        </a>

        <tal:block tal:define="is_portal_root context/@@plone_context_state/is_portal_root;"
                   tal:condition="not:is_portal_root">
          -
          <a class="link-parent" tal:condition="plone_view/getParentObject|nothing"
             tal:attributes="href python:plone_view.getParentObject().absolute_url()+'/@@manage-portlets'"
             i18n:translate="">
            Go to parent folder
          </a>
        </tal:block>

        <div class="portalMessage info alert alert-info"
             role="status"
             tal:condition="plone_view/isDefaultPageInFolder|nothing">
          <strong i18n:translate="">
            Info
          </strong>
          <span tal:omit-tag=""
                i18n:translate="label_manage_portlets_default_view_container">
            You are managing the portlets of the default view of a container. If
            you wanted to manage the portlets of the container itself,
            <a href=""
               i18n:name="go_here"
               i18n:translate="label_manage_portlets_default_view_container_go_here"
               tal:attributes="href string:${context/aq_inner/aq_parent/absolute_url}/@@manage-portlets">go here</a>.
          </span>
        </div>

        <p class="form-text text-muted" i18n:translate="description_manage_contextual_portlets">
          The portlet columns will first display portlets
          explicitly assigned in this context. Use the buttons on each portlet
          to move them up or down, delete or edit them. To add a new portlet,
          use the drop-down list at the top of the column.
        </p>

        <p class="form-text text-muted" i18n:translate="description_portlets_block_unblock">
          If you wish to block or unblock certain categories of portlets, you can
          do so using the drop-down boxes. Portlets that are included by these categories
          are shown below the selection box.
        </p>

        <div tal:condition="view/has_legacy_portlets">

          <h2 i18n:translate="title_legacy_portlets">Legacy portlets</h2>

          <p i18n:translate="action_convert_legacy_portlets">
            There are legacy portlets defined here. Click the button to
            convert them to new-style portlets.
          </p>

          <form method="post"
                tal:attributes="action string:${context/absolute_url}/@@convert-legacy-portlets">

            <input type="submit"
                   class="context btn btn-outline-secondary"
                   value="Convert portlets"
                   i18n:attributes="value label_convert_portlets"
                   name="convert" />

          </form>

        </div>
      </div>

    </metal:main>
  </body>
</html>
