summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Clement Mogensen <mogensen@diku.dk>2013-04-23 15:35:53 (GMT)
committerThomas Clement Mogensen <mogensen@diku.dk>2013-04-23 15:35:53 (GMT)
commite1ce2ee6b940b0686bbe4004c0e403fd4aa0cdbc (patch)
tree72bbcd49c729e08692f28f7416efd7ffa8836533
parent36a579b1f26e991b55be8b4cc7c06ee23c0e21cc (diff)
downloadplone.formwidget.querystring-e1ce2ee6b940b0686bbe4004c0e403fd4aa0cdbc.zip
plone.formwidget.querystring-e1ce2ee6b940b0686bbe4004c0e403fd4aa0cdbc.tar.gz
plone.formwidget.querystring-e1ce2ee6b940b0686bbe4004c0e403fd4aa0cdbc.tar.bz2
add handling of the RelativeDateWidget, already expected to exist in p.a.querystring
-rw-r--r--plone/formwidget/querystring/input.pt7
-rw-r--r--plone/formwidget/querystring/querywidget.js15
2 files changed, 22 insertions, 0 deletions
diff --git a/plone/formwidget/querystring/input.pt b/plone/formwidget/querystring/input.pt
index 3520b94..fc22da8 100644
--- a/plone/formwidget/querystring/input.pt
+++ b/plone/formwidget/querystring/input.pt
@@ -73,6 +73,13 @@
tal:attributes="name python:str(fieldName)+'.v:records:list'; value python:row['v'][1]"/>
</div>
+ <div class="querywidget relativeDateWidget"
+ tal:condition="python:indexes[row.i]['operators'][row.o]['widget'] == 'RelativeDateWidget'">
+ <input class="queryvalue" autocomplete="off" type="text" name="form.widgets.query.v:records"
+ tal:attributes="name python:str(fieldName)+'.v:records'; value python:row['v']"/>
+ <span i18n:translate="">days</span>
+ </div>
+
<input class="querywidget queryvalue relativePathWidget"
autocomplete="off" type="text" name="form.widgets.query.v:records"
tal:attributes="name python:str(fieldName)+'.v:records'; value python:row['v']"
diff --git a/plone/formwidget/querystring/querywidget.js b/plone/formwidget/querystring/querywidget.js
index d49f81b..45df752 100644
--- a/plone/formwidget/querystring/querywidget.js
+++ b/plone/formwidget/querystring/querywidget.js
@@ -97,6 +97,20 @@
})
.addClass('queryvalue')
);
+ case 'RelativeDateWidget':
+ return $(document.createElement('div'))
+ .addClass('querywidget relativeDateWidget')
+ .append($(document.createElement('input'))
+ .attr({
+ 'autocomplete': 'off',
+ 'type': 'text',
+ 'name': fname + '.v:records'
+ })
+ .addClass('queryvalue')
+ )
+ .append($(document.createElement('span'))
+ .html('days')
+ );
case 'ReferenceWidget':
return $(document.createElement('dl'))
.addClass('querywidget referenceWidget')
@@ -200,6 +214,7 @@
querylist.push('query.v:records:list=' + $(daterangewidget.children('input')[0]).val());
querylist.push('query.v:records:list=' + $(daterangewidget.children('input')[1]).val());
break;
+
case 'MultipleSelectionWidget':
var multipleselectionwidget = $(this).parents('.criteria').find('.querywidget');
multipleselectionwidget.find('input:checked').each(function () {