<div i18n:domain="plone"
     tal:define="history view/fullHistory;"
     tal:omit-tag="">
     <div tal:condition="not: history">—</div>

    <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="">What</th>
                <th class="nosort"
                    i18n:translate="">Who</th>
                <th class="nosort"
                    i18n:translate="">When</th>
                <th class="nosort" colspan="2"
                    i18n:translate="">Actions</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>
                  <p>${action}</p>
                  <p i18n:translate="" tal:content="rhComments" tal:condition="rhComments" class="historyComment discreet" />
                </td>
                <td>
                  <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"/>
                </td>
                <td>
                  <span tal:content="python:view.toLocalizedTime(item['time'],long_format=True)"
                        class="pat-moment" data-pat-moment="format:relative;"/>
                  <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>
                </td>
                <td>
                  <a class="plone-btn plone-btn-default"
                     tal:condition="isVersion"
                     href="${context/absolute_url}/@@history?version=${item/version_id}">View</a>
                  <span class="historyTools" tal:condition="isVersion">
                    <form action="" method="post" tal:condition="item/revert_url" tal:attributes="action item/revert_url"
                          style="display:inline">
                        <input type="hidden" name="version_id" value="" tal:attributes="value item/version_id" />
                        <input class="destructive" type="submit" i18n:attributes="value title_revert_revision"
                                tal:condition="exists:item/diff_current_url"
                                value="Revert to this revision" />
                    </form>
                  </span>
                </td>
              </tal:historyItem>
            </tr>
        </tbody>
    </table>

</div>
