[% USE date %]

[% IF show_log_entries or full_log_entries %]
    <div align="center" class='dataTitle'>[% IF service %]Service[% ELSE %]Host[% END %] Log Entries:</div><br>
    <div align="center" class='infoMessage'>
      <a href='avail.cgi?t1=[% start %]&amp;t2=[% end %][% IF host %]&amp;host=[% host | uri %][% END %][% IF service %]&amp;service=[% service | uri %][% END %]&amp;backtrack=[% backtrack %]&amp;assumestateretention=[% assumestateretention %]&amp;assumeinitialstates=[% assumeinitialstates %]&amp;assumestatesduringnotrunning=[% assumestatesduringnotrunning %]&amp;initialassumedhoststate=[% initialassumedhoststate %]&amp;initialassumedservicestate=[% initialassumedservicestate %]&amp;[% IF full_log_entries %]show_log_entries[% ELSE %]full_log_entries[% END %]&amp;showscheduleddowntime=[% showscheduleddowntime %]&amp;rpttimeperiod=[% rpttimeperiod %]'>[ View [% IF full_log_entries %]condensed[% ELSE %]full[% END %] log entries ]</a>
    </div>
    <div align="center">
      <table border="1" class='logEntries'>
        <tr>
          <th class='logEntries'>Event Start Time</th>
          <th class='logEntries'>Event End Time</th>
          <th class='logEntries'>Event Duration</th>
          <th class='logEntries'>Event/State Type</th>
          <th class='logEntries'>Event/State Information</th>
        </tr>
        [% FOR log IN logs %]
        [% SET class = 'logEntriesEven' IF loop.odd  %]
        [% SET class = 'logEntriesOdd'  IF loop.even %]
        <tr class='[% class %]'>
          <td class='[% class %]'>[% format_date(log.start, datetime_format) %]</td>
          <td class='[% class %]'>[% format_date(log.end, datetime_format) %]</td>
          <td class='[% class %]'>[% log.duration %]</td>
          <td class='logEntries[% log.class %]'>[% log.type %]</td>
          <td class='[% class %]'>[% IF escape_html_tags %][% escape_html(log.plugin_output) %][% ELSE %][% log.plugin_output %][% END %]</td>
        </tr>
        [% END %]
      </table>
    </div>
[% END %]
