<tal:block metal:use-macro="python:here.getFormsTool().getForm('site_admin_template').macros['page']">
<h1 metal:fill-slot="title" i18n:translate="">Comments on content</h1>

<tal:block metal:fill-slot="section">
<script type="text/javascript" src="/++resource++Products.Naaya/lib/datatables/jquery.dataTables.min.js"></script>
<link rel="stylesheet" type="text/css" href="/++resource++Products.Naaya/lib/datatables/jquery.dataTables.css" />
<link rel="stylesheet" href="/++resource++naaya.updater/updater.css" type="text/css" media="screen" charset="utf-8" />

<p i18n:translate="">This page presents links to all content for which comments have been added. You can follow the links, see the comments and delete the irrelevant ones.</p>

<table cellpadding="0" cellspacing="0" class="datatable display listing" id="comments-list">
    <thead>
        <tr class="list-header">
            <th i18n:translate="" style="width: 14%">
                Author
            </th>

            <th i18n:translate="">
                Author
            </th>

            <th i18n:translate="">
                Release date
            </th>

            <th i18n:translate="">
                Title
            </th>

            <th i18n:translate="">
                Comment
            </th>

            <th i18n:translate="">
                Comment
            </th>

            <th i18n:translate="" style="width: 10%;">
                Answer for
            </th>

            <th i18n:translate="">
                Status
            </th>
        </tr>
    </thead>
    <tbody>
<tal:block define="commented_items here/getCommentedObjects"
            repeat="item commented_items">
    <tal:block define="comments item/get_comments_list"
               repeat="comment comments">
        <tal:block define="spamstatus comment/spamstatus|nothing">
        <tr tal:attributes="class python: test(spamstatus, 'spam-comment', 'ham-comment')">
            <td i18n:translate="">
                Posted by
                <strong tal:content="comment/author" i18n:name="comment_author" />
                <br i18n:name="break_line" />
                at
                <span tal:replace="python:here.utShowFullDateTime(comment.releasedate)" i18n:name="comment_date" />
            </td>

            <td tal:content="comment/author" />

            <td>
                <span tal:replace="python:here.utShowFullDateTime(comment.releasedate)" />
            </td>

            <td tal:content="comment/title" />

            <td tal:content="structure comment/body" />

            <td>
                <a tal:attributes="href string:${item/absolute_url}#comment-${comment/getId}"
                   tal:content="comment/title_or_id" title="Read comment" i18n:attributes="title"
                   class="comment-title" />
                <br />
                <span tal:replace="structure comment/body" />
                <span class="comment-actions">
                    <span class="actions-label" i18n:translate="">
                        Actions:
                    </span>
                    <a title="Mark as SPAM" class="toggle-spam-status spam-status"
                       i18n:translate="" i18n:attributes="title"
                       tal:attributes="href string:${item/absolute_url}/comment_spam_status?id=${comment/getId}&status=True;
                                       id string:c-${comment/id}">
                        Mark as junk
                    </a>

                    <a title="Mark as valid" class="toggle-spam-status ham-status"
                       i18n:translate="" i18n:attributes="title"
                       tal:attributes="href string:${item/absolute_url}/comment_spam_status?id=${comment/getId}&status=False;
                                       id string:c-${comment/getId}">
                        Mark as valid
                    </a>

                    <a title="Delete comment" class="delete-comment"
                       i18n:translate="" i18n:attributes="title"
                       tal:attributes="href string:${item/absolute_url}/comment_del?id=${comment/getId};">
                        Delete
                    </a>
                    <span class="akismet-loading">
                        <span class="icon"></span>
                        <span i18n:translate="">Submitting to Akismet. Please wait!</span>
                    </span>
                </span>
            </td>

            <td align="center">
                <a tal:attributes="href string:${item/absolute_url}#comment-${comment/getId}"
                   tal:content="item/title_or_id" title="Read comment" i18n:attributes="title" />
                <br />
                <span i18n:translate="">(<strong tal:content="item/count_comments" i18n:name="total_comments" /> comments)</span>
            </td>

            <td align="center">
                <strong i18n:translate="" tal:content="string: Junk" class="spam-status-label" />
                <strong i18n:translate="" tal:content="string: Not Junk" class="ham-status-label" />
            </td>
        </tr>
        </tal:block>
    </tal:block>
</tal:block>
    </tbody>
    <tfoot>
        <tr class="list-header">
            <th i18n:translate="" style="width: 14%">
                Author
            </th>

            <th i18n:translate="">
                Author
            </th>

            <th i18n:translate="">
                Release date
            </th>

            <th i18n:translate="">
                Title
            </th>

            <th i18n:translate="">
                Comment
            </th>

            <th i18n:translate="">
                Comment
            </th>

            <th i18n:translate="" style="width: 10%;">
                Answer for
            </th>

            <th i18n:translate="" style="width: 10%;">
                Status
            </th>
        </tr>
    </tfoot>
</table>
</tal:block>

</tal:block>
