X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=templates%2Ffactory%2Flist;h=9f7fe0e03e418df5e531566b3f67e143439925a8;hb=079efd1d7e2ba90ad0c51fbe694f5eb27a719e98;hp=efd3a95518fb09e64bde86e16fb7f5b179a569ac;hpb=77137f7d4d6b7768b9c64eb1e893ac90083cfd63;p=maypole.git diff --git a/templates/factory/list b/templates/factory/list index efd3a95..9f7fe0e 100644 --- a/templates/factory/list +++ b/templates/factory/list @@ -2,7 +2,11 @@ [% INCLUDE header %] +[% IF search %] +

Search results

+[% ELSE %]

Listing of all [% classmetadata.plural %]

+[% END %] [% INCLUDE navbar %] @@ -12,7 +16,13 @@ [% FOR col = classmetadata.columns.list; NEXT IF col == "id"; - ""; 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); + ""; END %] @@ -26,5 +36,8 @@ FOR item = objects; ""; END %] + +[% INCLUDE pager; %] [% INCLUDE addnew; %] +[% INCLUDE footer %]