<dtml-var manage_page_header>
<dtml-var manage_tabs>

<main class="container-fluid">

  <h3>Historical revisions</h3>

  <p class="form-help mb-4">
    Use this form to view the historical revisions for the object, compare
    changes or return the object to a previous state.
    <br/>
    Please note that ZODB packing will remove all but the current revision.
  </p>

  <dtml-if manage_change_history>

    <form action="<dtml-var "REQUEST.URL1" html_quote>" method="POST">

      <table width="100%" cellspacing="0" cellpadding="2" border="0">
  
        <tr class="list-header">
           <td width="50%" align="left" valign="top">
             <div class="list-nav">
               <dtml-if first_transaction>       
                 <dtml-with expr="_(next=first_transaction*2-last_transaction)">
                   <a href="<dtml-var "REQUEST.URL" html_quote>?first_transaction:int=&dtml.-next;&last_transaction:int=&dtml.-first_transaction;&HistoryBatchSize:int=&dtml.-HistoryBatchSize;">&lt; Later Revisions</a>
                 </dtml-with>
               <dtml-else>
                 &nbsp;
               </dtml-if>
             </div>
           </td>
           <td width="50%" align="right" valign="top">
             <div class="list-nav">
               <dtml-if expr="_.len(manage_change_history) == HistoryBatchSize"> 
                 <dtml-with expr="_(last=last_transaction+HistoryBatchSize)">
                   <a href="<dtml-var "REQUEST.URL" html_quote>?first_transaction:int=&dtml.-last_transaction;&last_transaction:int=&dtml.-last;&HistoryBatchSize:int=&dtml.-HistoryBatchSize;">Earlier Revisions &gt;</a>
                 </dtml-with>
               <dtml-else>
                 &nbsp;
               </dtml-if>
             </div>
           </td>
         </tr>

       </table>
  

      <table class="table table-striped table-hover table-sm">

        <tr class="zmi-table-head">
          <th>&nbsp;</th>
          <th>Timestamp</th>
          <th>User</th>
          <th>Description</th>
        </tr>
  
        <dtml-in manage_change_history mapping>
          <tr>
            <td class="zmi-object-check text-right">
              <input type="checkbox" value="&dtml-key;" name="keys:list">
            </td>
            <td class="zmi-object-id">
              <a href="&dtml-absolute_url;/HistoricalRevisions/&dtml-key;/manage_workspace">
                <dtml-var time fmt="%Y-%m-%d %H:%M">
              </a>
            </td>
            <td class="zmi-object-id">
              <dtml-var user_name missing="n/a">
            </td>
            <td class="zmi-object-id">
              <dtml-var description html_quote newline_to_br>
              <dtml-if revision>
                <br/>revision: <em>&dtml-revision;</em>
               </dtml-if>
            </td>
          </tr>
        </dtml-in>

      </table>

      <div class="zmi-controls form-group form-inline">
        <input class="btn btn-primary" type="submit"
               name="manage_historyCopy:method"
               value="Copy to present"/>&nbsp;
        <input class="btn btn-primary" type="submit"
               name="manage_historicalComparison:method"
               value="Compare"/>
      </div>
  
    </form>
  
  <dtml-else>
    <p class="form-help">No change history is available for this object.</p>
  </dtml-if>

</main>

<dtml-var manage_page_footer>
