add handling of the RelativeDateWidget, already expected to exist in p.a.querystring

This commit is contained in:
Thomas Clement Mogensen 2013-04-23 17:35:53 +02:00
parent 36a579b1f2
commit e1ce2ee6b9
2 changed files with 22 additions and 0 deletions

View File

@ -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']"

View File

@ -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 () {