<div i18n:domain="ploneintranet"
     tal:define="history view/fullHistory;"
     tal:omit-tag="">
     <div tal:condition="not: history">—</div>
     <article class="rich pat-rich">
     <table class="listing" id="history-list" tal:condition="history"
        summary="Content listing"
        i18n:attributes="summary summary_content_listing;">
        <tbody>
            <tr class="odd">
                <th class="nosort"
                    i18n:translate="abbreviation_number">No.</th>
                <th class="nosort"
                    i18n:translate="">What</th>
                <th class="nosort"
                    i18n:translate="">View</th>
                <tal:comment replace="nothing"> <!-- Not yet supported -->
                <th class="nosort" colspan="2"
                    i18n:translate="">Compare</th>
                </tal:comment>
                <th class="nosort"
                    i18n:translate="">Revert</th>
            </tr>
            <tr tal:repeat="item history" class="historyRecord">
             <tal:historyItem
                define="rhComments item/comments|nothing;
                        actor item/actor;
                        actor_name python:actor and actor.get('fullname','username') or item['actorid'];
                        actor_home item/actor_home;
                        action item/transition_title;
                        action_id python:item['action'] or item['review_state'];
                        effective item/effective_date|nothing;
                        effectiveDate python:effective and view.toLocalizedTime(item['effective_date'],long_format=True);
                        isVersion python:item['type']=='versioning'">
                <td valign="top">${item/version_id|string:-}</td>
                <td>
                    <span class="historyByLine">
                        <tal:action i18n:translate="history_action">
                            <span class="historyAction" tal:content="action" i18n:translate="" i18n:name="action"
                               tal:attributes="class string:historyAction state-${action_id}"/>
                            -
                            <tal:actor i18n:name="actor">
                             <a href=""
                                tal:condition="actor_home"
                                tal:attributes="href actor_home"
                                tal:content="actor_name"> runyaga </a>
                             <span tal:condition="not: actor_home"
                                   tal:replace="actor_name"/>
                            <br/>
                            </tal:actor>
                            on
                            <span i18n:translate="" i18n:name="time" tal:content="python:context.toLocalizedTime(item['time'],long_format=True)" class="pat-moment" data-pat-moment="format:relative;"/>
                        </tal:action>
                        <tal:effective tal:condition="effective|nothing">
                            (<span i18n:translate="label_publishing_effective" tal:omit-tag="">effective</span>:
                            <span tal:content="python:item['effective']" class="pat-moment" data-pat-moment="format:relative;" />)
                        </tal:effective>

                    </span>
                    <p i18n:translate="" tal:content="rhComments" tal:condition="rhComments" class="historyComment discreet" />
                </td>
                <td>
                    <span class="historyLinks" tal:condition="isVersion">
                        <a class="context" href=""
                            tal:attributes="href item/preview_url"
                            i18n:translate="title_view_revision">View</a>
                    </span>
                </td>
                <tal:comment replace="nothing"> <!-- Not yet supported -->
                <td>
                    <span class="historyLinks" tal:condition="isVersion">
                        <a class="standalone" href="" tal:attributes="href item/diff_current_url"
                            tal:condition="exists:item/diff_current_url">
                            <span>&#x2912; <span i18n:translate="title_compare_revision">Compare to current</span></span>
                        </a>
                    </span>
                </td>
                <td>
                    <a class="historyComparePrevious standalone" tal:condition="exists:item/diff_previous_url"
                        tal:attributes="href item/diff_previous_url"
                        title="Compare with previous revision"
                        i18n:attributes="title title_compare_previous_revision">
                        <span>&#x2193; <span i18n:translate="label_compare" tal:omit-tag="">Compare</span></span>
                    </a>
                </td>
                </tal:comment>
                <td>
                    <span class="historyTools" tal:condition="isVersion">
                    <form action="" method="post" class="pat-form" tal:condition="item/revert_url" tal:attributes="action item/revert_url">
                        <input type="hidden" name="version_id" value="" tal:attributes="value item/version_id" />
                        <input class="destructive" type="submit" i18n:attributes="value title_revert_revision"
                                value="Revert to this revision" />
                    </form>
                    </span>
                </td>
                </tal:historyItem>
            </tr>
        </tbody>
    </table>
    </article>
</div>
