On 11/13/09 5:19 PM, vmassol (SVN) wrote:
Author: vmassol
Date: 2009-11-13 17:19:01 +0100 (Fri, 13 Nov 2009)
New Revision: 25059
Modified:
platform/core/trunk/xwiki-core/src/main/resources/
ApplicationResources.properties
platform/web/trunk/standard/src/main/webapp/templates/macros.vm
Log:
XWIKI-4588: Associate labels with livetable filter inputs and
improve livetable title attributes
* TODO: add labels for lists too
Modified: platform/core/trunk/xwiki-core/src/main/resources/
ApplicationResources.properties
===================================================================
--- platform/core/trunk/xwiki-core/src/main/resources/
ApplicationResources.properties 2009-11-13 16:18:12 UTC (rev 25058)
+++ platform/core/trunk/xwiki-core/src/main/resources/
ApplicationResources.properties 2009-11-13 16:19:01 UTC (rev 25059)
@@ -1843,7 +1843,7 @@
xe.livetable._actions.rename=rename
xe.livetable._actions.rights=rights
xe.livetable._actions.copy=copy
-xe.livetable.filters.title=Enter a filter for this field
+xe.livetable.filters.title=Filter for the {0} column
xe.livetable.loading=Loading...
xe.livetable.tags.help=Click on one or more tags to filter the
list
xe.livetable.tags.help.cancel=and click again on a tag to cancel
the filter
Modified: platform/web/trunk/standard/src/main/webapp/templates/
macros.vm
===================================================================
--- platform/web/trunk/standard/src/main/webapp/templates/
macros.vm 2009-11-13 16:18:12 UTC (rev 25058)
+++ platform/web/trunk/standard/src/main/webapp/templates/
macros.vm 2009-11-13 16:19:01 UTC (rev 25059)
@@ -1564,6 +1564,11 @@
<tr>
#foreach($colname in $collist)
#set($colprop = $colprops.get($colname))
+ #if(("$!colprop.filterable" == "" ||
$colprop.filterable != false)&& "$!colname" != "_actions")
+ #set($isFilterable = true)
+ #else
+ #set($isFilterable = false)
+ #end
#if(("$!colprop.sortable" == "" ||
$colprop.sortable != false)&& "$!colname" != "_actions")
#set($isSortable = true)
#else
@@ -1572,7 +1577,9 @@
#if($colname != "_actions" || $hasAdmin)
<th class="xwiki-livetable-display-header-text
#if($isSortable)sortable #if($colname == $selectedColumn)selected
$defaultOrder#else asc#end#end" #if("$!colprop.type"=="hidden")
style="display: none" #end>
#if($isSortable)<a rel="${colname}">#end
+ #if($isFilterable&& ("$!
colprop.type"=="text"||"$!colprop.type"=="number"))<label
for="xwiki-livetable-filter-${velocityCount}">#end
With this, we'll have ID collision if several live tables are
displayed
on the page.
You need to add the table identifier (passed as a parameter of the
macro
AFAIR) in the field ID.
Sorry for the noise, just seen you've fixed it already.