[%- USE date(format = '%a, %d-%b-%Y') -%] [%- WRAPPER site_wrapper.html title = 'List' -%] [%- SET p = c.req.query_params result = list_posts( p ) posts = result.rows -%] [% BLOCK simple_paging_controls %] [% IF result.first_qs %] << [% ELSE %] << [% END %] [% IF result.prev_qs %] < [% ELSE %] < [% END %] [% IF result.next_qs %] > [% ELSE %] > [% END %] [% IF result.last_qs %] >> [% ELSE %] >> [% END %] [% END %]

### [% IF p.search %] Posts containing "[% p.search %]" [% IF p.tag %] and [% END %] [% END %] [% IF p.tag %]Tagged "[% p.tag %]" [% END %] [% IF p.category %]In "[% p.category %]" [% END %] [% IF p.section_id %]Section: "[% resolve_section_id(p.section_id) %]" [% ELSIF p.under_section_id %]Under Section: "[% resolve_section_id(p.under_section_id) %]" [% END %]

[% IF result.params.username %]

### written by [% result.params.username %]

[% END %]

#### [% IF result.total > 0 %] [% result.start %] - [% result.end %] of [% result.total %] posts: [% ELSE %] No posts found. [% END %]

[% INCLUDE simple_paging_controls %] Summaries [% IF result.params.summary %] on [% ELSE %] off [% END %]

[% FOREACH Post IN posts %]
- [% Post.title %] [% date.format(Post.ts) %] by [% Post.author.full_name %] [% IF result.params.summary %]
  [% IF Post.num_categories %]
  in: [% FOREACH category IN Post.category_list %] [% category %] [% IF loop.next() %], [% END %] [% END %]
  [% END %]

  [% IF Post.image_url %] [% END %] | [% Post.summary %] ... read more

  [% END %]
[% END %]

[% INCLUDE simple_paging_controls %]
[%- SET page_choices = [5,10,20,50,100,200,500] -%] Max results per page: [%- FOREACH size IN page_choices -%] [% IF size == result.limit %] [% size %] [% ELSE %] [% size %] [% END %] [%- END -%]
[% END %]