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

<metal:block fill-slot="top_slot"
             tal:define="dummy python:request.set('disable_border', 1)" />

<body>

<metal:main fill-slot="main"
     tal:define="path context/@@plone_portal_state/navigation_root_path;
                 results python:container.portal_catalog(sort_on='modified',sort_order='reverse',path=path);
                 Batch python:modules['Products.CMFPlone'].Batch;
                 DateTime python:modules['DateTime'].DateTime;
                 b_start python:request.get('b_start',0);
                 normalizeString nocall:context/@@plone/normalizeString;
                 toLocalizedTime nocall:context/@@plone/toLocalizedTime;">

    <h1 class="documentFirstHeading"
        i18n:translate="heading_recently_modified">
        Modified items
    </h1>

    <div i18n:translate="description_recently_modified" class="documentDescription">
        All recently modified items, latest first.
    </div>

    <div id="content-core">
        <form name="searchresults" action="" method="post" tal:condition="results"
                          tal:define="batch python:Batch(results, 20, int(b_start), orphan=1)">

            <tal:results tal:repeat="result batch">

                <dl tal:define="description result/Description">
                    <dt tal:define="item_icon python:plone_view.getIcon(result);
                                    item_wf_state result/review_state;
                                    item_wf_state_class python:'state-' + normalizeString(item_wf_state);">
                        <span tal:attributes="class python:'contenttype-' + normalizeString(result.portal_type)">
                          <img tal:replace="structure item_icon/html_tag" />
                          <a href="/view"
                             tal:content="result/pretty_title_or_id"
                             tal:attributes="href result/getURL;
                                             class string:$item_wf_state_class">
                          Title
                          </a>
                        </span>

                        <span class="discreet" i18n:translate="text_creator_date">
                            by
                            <span tal:define="creator result/Creator;
                                              author python:context.portal_membership.getMemberInfo(creator)"
                                  tal:content="python:author and author['fullname'] or creator"
                                  tal:omit-tag=""
                                  i18n:name="creator">creator</span>,
                            last updated:
                            <span tal:content="python:toLocalizedTime(result.ModificationDate, long_format=1)"
                                  tal:omit-tag=""
                                  i18n:name="date">date</span>
                        </span>
                    </dt>

                    <dd tal:condition="description"
                        tal:content="description">
                        Description
                    </dd>

                    <dd tal:condition="not:description">
                        &nbsp;
                    </dd>
                </dl>

            </tal:results>

            <div class="spacer">
                &nbsp;
            </div>

            <div metal:use-macro="context/batch_macros/macros/navigation" />

        </form>

        <p tal:condition="not: results" i18n:translate="text_no_new_modified_items">
            No items have been modified.
        </p>
    </div>

</metal:main>
</body>

</html>
