<div class="reviewHistory"
      metal:define-macro="review_history" 
      i18n:domain="plone"
      tal:define="history here/getWorkflowHistory;">
    <tal:history tal:condition="history">
      <dl id="history" class="collapsible inline collapsedOnLoad">
        <dt class="collapsibleHeader" i18n:translate="label_history">History</dt>
        <dd class="collapsibleContent">

        <table class="listing nosort" summary="Review History"
               i18n:attributes="summary summary_review_history;"
               tal:define="review_history python:wtool.getInfoFor(here, 'review_history', []);
                                review_history python:[review for review in review_history if review.get('action','')]"
               tal:condition="review_history">

          <tr>
            <th i18n:translate="listingheader_action">Action</th>
            <th i18n:translate="listingheader_performed_by">Performed by</th>
            <th i18n:translate="listingheader_date_and_time">Date and Time</th>
            <th i18n:translate="listingheader_comment">Comment</th>
          </tr>

          <metal:block tal:define="review_history python: portal.reverseList(review_history);"
                       tal:repeat="item review_history">
            <tr tal:define="odd repeat/item/odd;
                            rhComments item/comments|nothing;
                            state item/review_state|nothing"
                tal:attributes="class python:test(odd, 'even', 'odd')"
                tal:condition="item/action">
              <td i18n:translate="" tal:content="python:wtool.getTitleForTransitionOnType(item['action'],context.portal_type)"
                  tal:attributes="class string:state-${state}">
                action
              </td>

              <td>
                <a href="/Members/runyaga"
                   tal:define="actorid python:item.get('actor');
                               actor python:mtool.getMemberInfo(actorid);
                               fullname actor/fullname|nothing;
                               username actor/username|nothing"
                   tal:attributes="href string:${portal_url}/author/${actorid}"
                   tal:content="python:fullname or username or actorid">
                  runyaga
                </a>
              </td>

              <td>
                <span tal:replace="python:toLocalizedTime(item['time'],long_format=True)" />
                <span tal:condition="item/effective_date|nothing">
                  (<span i18n:translate="label_publishing_effective" tal:omit-tag="">effective</span>:
                  <span tal:replace="python: toLocalizedTime(item['effective_date'],long_format=True)"></span>)
                </span>
              </td>

              <td>
                <span tal:condition="rhComments">
                  <span tal:replace="rhComments"> some comments </span>
                </span>

                <span tal:condition="not: rhComments" i18n:translate="no_comments">
                  No comments.
                </span>
              </td>
            </tr>
          </metal:block>
        </table>

        </dd>
      </dl>
    </tal:history>
</div>
