<!-- BEGIN resources/menu/chronological.tt -->

    [%
        colours = {
            request_data  = '#e6ffe6',
            lab_test_data = '#ffefdf',            
        }
    %]
    
    <h3 class="header">
        Request [% IF is_lab_user %]&amp; lab test[% END %] history:
    </h3>
    <div class="indent">
        <table class="history">
            <tr>
                <th>Day</th>
                <th>Date</th>
                <th>Time</th>
                <th>UserID</th>
                <th>Action</th>
            </tr>
            [% FOREACH event IN chronological; # PROCESS dumper.tt dump = event.as_tree;
                # lab-test data filtered out in Controller if not lab user %]
                <tr style="background: [% colours.item(event.history_type) %]">
                    <td>
                        [% event.time.strftime('%a') %]
                    </td>
                    <td>
                        [% event.time.strftime('%d.%b.%Y') %]
                    </td>
                    <td>
                        [% event.time.strftime('%T') %]
                    </td>
                    <td>
                        [% event.user.username | upper %]
                    </td>
                    <td>
                        [% event.action | html %]
                        [% IF is_lab_user # must be lab-staff to see this:
                            AND (
                                event.action.match('amended comment') OR
                                event.action.match('modified Comment')
                            )
                        %]
                            [<a href="[% url_with_path.replace('=', 'comment') %]">
                               view
                            </a>]
                        [% END %]
                    </td>
                </tr>
            [% END %]
        </table>
    </div>
    
<!-- END resources/menu/chronological.tt -->

