[%
USE Utils; # App::TT::Utils between() function
USE date(format = '%d/%m/%Y');
SET max_num = settings.max_records_per_page; # max number of records to show without filter
SET filter_title = params.category ? 'Filter selected' : 'SELECT FILTER';
%]
Found [% records.size %] record[% 's' IF records.size != 1 %]
[% IF params.category; ' in '; params.category.upper; ' category ' %]
[% ELSIF params.search; ' matching search term "'; params.search; '" ' %]
[% ELSIF records.size > max_num AND NOT params.search %]
[too many to display, please select a filter below or enter a search term above]
[% END %]
[% # display records IF size between 1 & $max_size OR is a search result
# OR a category aleady been selected
IF records.size AND
( params.category OR params.search OR Utils.is_between(records.size, 1, max_num) )
%]
| Date |
Category |
Detail |
Retained |
Uploaded |
[% FOREACH entry IN records %]
| [% date.format(entry.date _ " 00:00:00") # add time to satisfy requirement %]
|
[% entry.category.ucfirst %] |
[% entry.description %] [[%-
IF entry.comment.match('^http') %][% entry.comment %][%- ELSE %][% entry.comment %][% END %]]
[% IF entry.filename %]
[% END %]
|
[% entry.retained.upper %] |
[% date.format(entry.time) %] |
[% END # entry IN records %]
[% END # record.size between 1 and 100 %]