X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=templates%2Ffactory%2Flist;h=206066f3eb533ef081f814be066cc9459fc69504;hb=52794a09f33740c16104826e7d4beb6610edebeb;hp=69bb8680a8aa18820b83e3d1867d84b536cab702;hpb=0ad4ba7aa71b7dda17f0b07ccc9d8f0ad3424b82;p=maypole.git diff --git a/templates/factory/list b/templates/factory/list index 69bb868..206066f 100644 --- a/templates/factory/list +++ b/templates/factory/list @@ -1,16 +1,28 @@ -[% PROCESS list_macros %] +[% PROCESS macros %] [% INCLUDE header %] +[% IF search %] +

Search results

+[% ELSE %]

Listing of all [% classmetadata.plural %]

+[% END %] [% INCLUDE navbar %] + +
[% FOR col = classmetadata.columns.list; NEXT IF col == "id"; - ""; + ""; END %] @@ -25,5 +37,6 @@ FOR item = objects; END %]
"; classmetadata.colnames.$col; ""; + SET additional = "?order=" _ col; + SET additional = additional _ "&page=" _ pager.current_page IF pager; + SET additional = additional _ "&o2=desc" + IF col == request.query.order and request.query.o2 != "desc"; + link(classmetadata.table, "list", additional, classmetadata.colnames.$col); + "
- +[% INCLUDE pager; %] [% INCLUDE addnew; %] +