[gen] Added the possibility to span widgets on several columns on the search screen (param Field.scolspan).
This commit is contained in:
parent
3f75d14e92
commit
0dae8b1888
9 changed files with 79 additions and 56 deletions
|
@ -24,17 +24,21 @@
|
|||
<input tal:condition="refInfo" type="hidden" name="ref" tal:attributes="value refInfo"/>
|
||||
|
||||
<table width="100%">
|
||||
<tr tal:repeat="searchRow python: tool.tabularize(searchInfo['fieldDicts'], searchInfo['nbOfColumns'])"
|
||||
<tr tal:repeat="searchRow python: tool.getGroupedSearchFields(searchInfo)"
|
||||
valign="top">
|
||||
<td tal:repeat="widget searchRow" tal:attributes="width python:'%d%%' % (100/searchInfo['nbOfColumns'])">
|
||||
<tal:field condition="widget">
|
||||
<tal:widgets repeat="widget searchRow">
|
||||
<td tal:define="scolspan widget/scolspan|python: 1"
|
||||
tal:attributes="width python:'%d%%' % ((100/searchInfo['nbOfColumns'])*scolspan);
|
||||
colspan scolspan">
|
||||
<tal:field condition="widget">
|
||||
<tal:show define="name widget/name;
|
||||
widgetName python: 'w_%s' % name;
|
||||
macroPage python: widget['type'].lower()">
|
||||
<metal:call use-macro="python: getattr(appFolder.ui.widgets, macroPage).macros['search']"/>
|
||||
</tal:show>
|
||||
</tal:field><br class="discreet"/>
|
||||
</td>
|
||||
</td>
|
||||
</tal:widgets>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
|
|
@ -38,6 +38,6 @@
|
|||
<label tal:attributes="for widgetName" tal:content="python: _(widget['labelId'])"></label><br>
|
||||
<input type="text" tal:define="maxChars python: test(widget['maxChars'], widget['maxChars'], '')"
|
||||
tal:attributes="name python: '%s*string' % widgetName;
|
||||
maxlength maxChars;
|
||||
value widget/defaultForSearch"/>
|
||||
maxlength maxChars; size widget/width;
|
||||
value widget/sdefault"/>
|
||||
</metal:search>
|
||||
|
|
|
@ -25,12 +25,12 @@
|
|||
<label tal:attributes="for fromName" tal:content="python: _('search_from')"></label>
|
||||
<input type="text" size="4"
|
||||
tal:attributes="name fromName; maxlength maxChars;
|
||||
value python: widget['defaultForSearch'][0]"/>
|
||||
value python: widget['sdefault'][0]"/>
|
||||
</tal:from>
|
||||
<tal:to define="toName python: '%s_to' % name">
|
||||
<label tal:attributes="for toName" tal:content="python: _('search_to')"></label>
|
||||
<input type="text" size="4"
|
||||
tal:attributes="name toName; maxlength maxChars;
|
||||
value python: widget['defaultForSearch'][1]"/>
|
||||
value python: widget['sdefault'][1]"/>
|
||||
</tal:to><br/>
|
||||
</metal:search>
|
||||
|
|
|
@ -25,12 +25,12 @@
|
|||
<label tal:attributes="for fromName" tal:content="python: _('search_from')"></label>
|
||||
<input type="text" size="4"
|
||||
tal:attributes="name fromName; maxlength maxChars;
|
||||
value python: widget['defaultForSearch'][0]"/>
|
||||
value python: widget['sdefault'][0]"/>
|
||||
</tal:from>
|
||||
<tal:to define="toName python: '%s_to' % name">
|
||||
<label tal:attributes="for toName" tal:content="python: _('search_to')"></label>
|
||||
<input type="text" size="4"
|
||||
tal:attributes="name toName; maxlength maxChars;
|
||||
value python: widget['defaultForSearch'][1]"/>
|
||||
value python: widget['sdefault'][1]"/>
|
||||
</tal:to><br/>
|
||||
</metal:search>
|
||||
|
|
|
@ -94,9 +94,9 @@
|
|||
<tal:simpleSearch condition="not: widget/isSelect">
|
||||
<input type="text" tal:define="maxChars python: test(widget['maxChars'], widget['maxChars'], '')"
|
||||
tal:attributes="name python: '%s*string-%s' % (widgetName, widget['transform']);
|
||||
maxlength maxChars;
|
||||
maxlength maxChars; size widget/width;
|
||||
style python: 'text-transform:%s' % widget['transform'];
|
||||
value widget/defaultForSearch"/>
|
||||
value widget/sdefault"/>
|
||||
</tal:simpleSearch>
|
||||
<tal:comment replace="nothing">Show a multi-selection box for fields whose
|
||||
validator defines a list of values, with a "AND/OR" checkbox.</tal:comment>
|
||||
|
@ -112,7 +112,7 @@
|
|||
<label tal:attributes="for andName" tal:content="python: _('search_and')"></label><br/>
|
||||
</tal:operator>
|
||||
<tal:comment replace="nothing">The list of values</tal:comment>
|
||||
<select tal:define="preSelected widget/defaultForSearch"
|
||||
<select tal:define="preSelected widget/sdefault"
|
||||
tal:attributes="name widgetName; size widget/height" multiple="multiple">
|
||||
<option tal:repeat="v python:tool.getPossibleValues(name, withTranslations=True, withBlankValue=False, className=className)"
|
||||
tal:attributes="value python:v[0]; title python: v[1];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue