Commit f56d4f4e authored by Kevin Deldycke's avatar Kevin Deldycke

Make column filter box working.

Support pagination of listboxes with custom parameters.
Auto-reset listbox when page or selection change.
WebStyleHTML listboxes return document list, not search results.
Reduce filter input box size.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8662 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 109ed084
......@@ -53,27 +53,35 @@
xmlns:metal="http://xml.zope.org/namespaces/metal"\n
xmlns:i18n="http://xml.zope.org/namespaces/i18n"\n
tal:define="field_id here/getId;\n
form_id python: here.getForm().id;\n
selection_name here/getSelectionName;\n
requested_selection_name here/getRequestedSelectionName;\n
selection_index here/getSelectionIndex;\n
selection here/getSelection;\n
portal_url_string here/getPortalUrlString;\n
real_context here/getContext;\n
context_url real_context/getUrl;\n
md5_string here/getMD5Checksum;\n
line_list here/query;\n
is_domain_tree_mode here/isDomainTreeMode;\n
is_report_tree_mode here/isReportTreeMode;\n
is_domain_tree_supported here/isDomainTreeSupported;\n
is_report_tree_supported here/isReportTreeSupported;\n
show_select_column here/showSelectColumn;\n
show_search_line here/showSearchLine;\n
">\n
form_id python: here.getForm().id;\n
selection_name here/getSelectionName;\n
requested_selection_name here/getRequestedSelectionName;\n
selection_index here/getSelectionIndex;\n
selection here/getSelection;\n
portal_url_string here/getPortalUrlString;\n
real_context here/getContext;\n
context_url real_context/getUrl;\n
md5_string here/getMD5Checksum;\n
line_list here/query;\n
is_domain_tree_mode here/isDomainTreeMode;\n
is_report_tree_mode here/isReportTreeMode;\n
is_domain_tree_supported here/isDomainTreeSupported;\n
is_report_tree_supported here/isReportTreeSupported;\n
show_select_column here/showSelectColumn;\n
show_search_line here/showSearchLine;\n
">\n
\n
<!-- ListBox starts here -->\n
<input type="hidden" name="list_selection_name" value="default" tal:attributes="value selection_name" />\n
<input tal:condition="md5_string" type="hidden" name="md5_object_uid_list" value="checksum" tal:attributes="value md5_string" />\n
\n
<input type="hidden" name="form_id" tal:attributes="value form_id" tal:condition="form_id"/>\n
<input type="hidden" name="selection_name" tal:attributes="value selection_name" tal:condition="selection_name"/>\n
<input type="hidden" name="selection_index" tal:attributes="value selection_index" tal:condition="selection_index"/>\n
<input type="hidden" name="reset" value="1"/>\n
<input id="listbox_select" tal:attributes="id string: ${field_id}_select"\n
title="Filter" alt="Filter" name="Base_doSelect:method"\n
type="submit" style="visibility: hidden"/>\n
\n
<tal:replace tal:content="nothing">\n
Because TAL cannot accept unbalanced tags, the support for a domain tree is realized by a macro.\n
......@@ -107,7 +115,7 @@
current_page_max python: listbox_max_lines * current_page;\n
current_page_start python: (listbox_max_lines * (current_page - 1)) + 1;\n
current_page_stop python: (total_line < current_page_max) and total_line or current_page_max;">\n
<tal:block condition="python: total_line > 0">Resultats <em tal:content="current_page_start"/> - <em tal:content="current_page_stop"/> sur un total de <em tal:content="total_line"/>.</tal:block>\n
<tal:block condition="python: total_line > 0">Documents <em tal:content="current_page_start"/> - <em tal:content="current_page_stop"/> sur un total de <em tal:content="total_line"/>.</tal:block>\n
<span tal:condition="python: total_line == 0" class="warning">No result !</span>\n
</span>\n
</div>\n
......@@ -137,14 +145,6 @@
</tal:block>\n
</tal:block>\n
</tr>\n
\n
\n
\n
\n
\n
\n
\n
\n
<tr tal:condition="show_search_line">\n
<td tal:repeat="value here/getSearchValueList">\n
<tal:block tal:define="alias python: value[0];\n
......@@ -154,28 +154,23 @@
<tal:block\n
tal:condition="python: search_field is not None"\n
tal:replace="structure python: search_field.render(value=param, key=alias)"/>\n
<input tal:condition="python: search_field is None" name="id" size="8" value=""\n
tal:attributes="name alias; value param"/>\n
<input tal:condition="python: search_field is None" name="id" size="5" value=""\n
type="text" tal:attributes="name alias; value param"/>\n
</tal:block>\n
</td>\n
\n
</tr>\n
\n
\n
</tr>\n
</thead>\n
\n
<tfoot tal:condition="python: int(here.total_size) > int(here.getMaxLineNumber())">\n
<tr>\n
<td tal:attributes="colspan python: len(here.getSelectedColumnList())">\n
<a class="pageNavigation"\n
<a class="pageNavigation" href="portal_selections/firstPage:method"\n
tal:condition="python: here.current_page > 0"\n
href="portal_selections/firstPage:method"\n
title="First Page: page 1">|&lt;</a>\n
<a class="pageNavigation"\n
href="portal_selections/previousPage:method"\n
title="First page: Page 1">|&lt;</a>\n
<a class="pageNavigation" href="portal_selections/previousPage:method"\n
tal:condition="python: here.current_page > 0"\n
tal:attributes="title python: \'Previous Page: page \' + str(here.current_page - 1)"\n
title="Previous Page: page 67">&lt;&lt;</a>\n
title="Previous page: Page 67">&lt;&lt;</a>\n
<select id="listbox_page_selection" name="list_start" title="Change Page" size="1"\n
onChange="submitAction(this.form, \'context/portal_selections/setPage\')"\n
tal:define="lines here/getMaxLineNumber"\n
......@@ -192,14 +187,14 @@
</option>\n
</select>\n
<a class="pageNavigation"\n
href="portal_selections/nextPage:method"\n
href="nextPage:method"\n
tal:condition="python: here.current_page + 1 < here.total_pages"\n
tal:attributes="title python: \'Next Page: page \' + str(here.current_page + 1)"\n
tal:attributes="title python: \'Next page: Page \' + str(here.current_page + 1)"\n
>&gt;&gt;</a>\n
<a class="pageNavigation"\n
tal:condition="python: here.current_page + 1 < here.total_pages"\n
href="portal_selections/lastPage:method"\n
tal:attributes="title python: \'Last Page: page \' + str(here.total_pages)">&gt;|</a>\n
tal:attributes="title python: \'Last page: Page \' + str(here.total_pages)">&gt;|</a>\n
</td>\n
</tr>\n
</tfoot>\n
......@@ -232,7 +227,8 @@
</tal:block>\n
<!-- ListBox ends here -->\n
\n
</tal:block>
</tal:block>\n
]]></string> </value>
</item>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment