cpack_repository/commit

Support sorting on the main-page

authorJan Wielemaker
Wed Dec 1 21:23:22 2010 +0100
committerJan Wielemaker
Wed Dec 1 21:23:22 2010 +0100
commit96549ad317aa51546fd9b1c0386262a5ffa54cd8
tree48c115afc16c3d151f7a968690b20ed6a7fa8ad2
parentc1a265302f9a3f2903d0ffde6acdedc77846d7d7
Diff style: patch stat
diff --git a/applications/cpack_home.pl b/applications/cpack_home.pl
index bdcf66c..f23483d 100644
--- a/applications/cpack_home.pl
+++ b/applications/cpack_home.pl
@@ -38,10 +38,17 @@
 %
 %	HTTP handler that provides the CPACK welcome page
 
-cpack_home(_Request) :-
+cpack_home(Request) :-
+	http_parameters(Request,
+			[ sort_by(By,
+				  [ oneof([status,name,title,type,author]),
+				    default(name),
+				    description('Sort table by this key')
+				  ])
+			]),
 	reply_html_page(cliopatria(cpack),
 			title('CPACK: The ClioPatria Package Manager'),
 			div(class(cpack),
 			    [ \insert_html_file(html('cpack_home.html')),
-			      \package_table([])
+			      \package_table([sort_by(By)])
 			    ])).