--- a/server/src/main/webapp/WEB-INF/templates/projectIndex.html Wed Apr 03 23:36:05 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/templates/projectIndex.html Thu Apr 04 15:35:15 2013 +0200
@@ -46,12 +46,12 @@
<a href="#?p.page=7">>></a>
</div>
</div>
- <table>
- <thead>
+ <table th:with="columnSort=${param['p.sort']}?${param['p.sort'][0]}:'updated',sortDir=${param['p.sort.dir']}?${param['p.sort.dir'][0]}:'desc'">
+ <thead th:with="sortDirInv=${sortDir}=='desc'?'asc':'desc'">
<tr>
- <th th:text="#{renkanIndex.project_name}">Name</th>
- <th th:text="#{renkanIndex.project_updated}">Updated</th>
- <th th:text="#{renkanIndex.project_creation}">Creation</th>
+ <th th:with="sorted=(${columnSort}=='title')"><span th:text="#{renkanIndex.project_name}">Name</span><form method="get" class="proj-sort-form"><input type="hidden" name="p.sort" value="title"/><input type="hidden" name="p.sort.dir" th:value="${sorted}?${sortDirInv}:'desc'"/><input type="submit" class="proj-sortable-col" th:class="${sorted}?'proj-sort-'+${sortDir}+'-col':'proj-sortable-col'" value=""/></form></th>
+ <th th:with="sorted=(${columnSort}=='updated')"><span th:text="#{renkanIndex.project_updated}">Updated</span><form method="get" class="proj-sort-form"><input type="hidden" name="p.sort" value="updated"/><input type="hidden" name="p.sort.dir" th:value="(${sorted})?${sortDirInv}:'desc'"/><input type="submit" class="proj-sort-desc-col" th:class="${sorted}?'proj-sort-'+${sortDir}+'-col':'proj-sortable-col'" value=""/></form></th>
+ <th th:with="sorted=(${columnSort}=='created')"><span th:text="#{renkanIndex.project_creation}" >Creation</span><form method="get" class="proj-sort-form"><input type="hidden" name="p.sort" value="created"/><input type="hidden" name="p.sort.dir" th:value="${sorted}?${sortDirInv}:'desc'"/><input type="submit" class="proj-sort-asc-col" th:class="${sorted}?'proj-sort-'+${sortDir}+'-col':'proj-sortable-col'" value=""/></form></th>
<th th:text="#{renkanIndex.project_edit}">Edit</th>
<th th:text="#{renkanIndex.project_copy}">Copy</th>
<th th:text="#{renkanIndex.project_delete}">Del.</th>