Commit 5c9b784b authored by Ivan Tyagov's avatar Ivan Tyagov

It's possible reuse full text configuration from listbox definition.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37341 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6c9cd06c
......@@ -67,6 +67,9 @@
selection.getParams().get(\'list_style\', here.getDefaultDisplayStyle()));\n
dummy python: list_style == \'search\' and here.setDisplayedColumnIdList((\'getIconAsHTML\', \'getSummaryAsHTML\'))\n
or list_style == \'thumbnail\' and here.setDisplayedColumnIdList((\'title\', \'thumbnail\'));\n
full_text_search_key here/getFullTextSearchKey;\n
full_text_search_key_script here/getFullTextSearchKeyScript;\n
show_full_text python: full_text_search_key not in (\'\', None) and full_text_search_key_script not in (\'\', None);\n
line_list here/query;\n
listbox_max_lines python: int(here.getMaxLineNumber());\n
total_line python: int(here.total_size);\n
......@@ -442,7 +445,7 @@
<!-- Choose display mode -->\n
<!--TODO define show_display_selection macro-->\n
<div tal:condition="python: len(display_style_list) > 0"\n
class="list-style-selection">\n
class="listbox-list-style-selection">\n
<span i18n:translate="" i18n:domain="ui">Display:</span>\n
<ul>\n
<li tal:repeat="style display_style_list">\n
......@@ -454,29 +457,32 @@
</ul>\n
</div>\n
\n
<!-- Full Text Search -->\n
<!--XXX This implementation is not finished.-->\n
<tal:comment tal:replace="nothing">\n
<div tal:define="your_search_text nothing"\n
tal:condition="python: show_full_text" \n
class="extendedSearchBar">\n
<tal:block tal:condition="python: not is_gadget_mode">\n
<!-- Extra Search -->\n
<div tal:define="search_text real_context/Base_getSearchText"\n
tal:condition="show_full_text" \n
class="listbox-full-text-search">\n
\n
<tal:block tal:condition="not: is_gadget_mode">\n
<!-- Normal mode -->\n
<input name="bottom_your_search_text" size="25" value="" type="text"\n
onkeypress="submitFormOnEnter(event, this.form, \'ERP5Site_processAdvancedSearchBottom\');"\n
tal:attributes="value your_search_text" />\n
<input class="button" i18n:domain="ui" i18n:attributes="value"\n
value="Search" name="ERP5Site_processAdvancedSearchBottom:method" type="submit" />\n
</tal:block>\n
<tal:block tal:condition="python: is_gadget_mode">\n
<!-- Gadget mode -->\n
<input tal:define ="params python: {\'ERP5Site_processAdvancedSearchBottom:method\':\'\',\'bottom_your_search_text\':\'this.value\'};"\n
name="bottom_your_search_text" size="25" value="" type="text"\n
tal:attributes=\'value your_search_text;\n
onkeypress python:"if(event.keyCode==13){" + real_context.KnowledgePad_generateAjaxCall(context_url+"/"+form_id,box,box_id,params).replace("\\"this.value\\"","this.value")+ "return false;;}"\'/>\n
</tal:block>\n
</div> \n
</tal:comment>\n
<input type="text"\n
tal:attributes="value search_text;\n
name full_text_search_key;\n
onkeypress string: submitFormOnEnter(event, this.form, \'${full_text_search_key_script}\');"/>\n
<input class="button" \n
i18n:domain="ui" i18n:attributes="value"\n
value="Search" type="submit" \n
tal:attributes="name string:${full_text_search_key_script}:method"/>\n
</tal:block>\n
<tal:block tal:condition="is_gadget_mode">\n
<!-- Gadget mode -->\n
<input tal:define="params python: {\'%s:method\' %full_text_search_key_script:\'\',\'%s\' %full_text_search_key:\'this.value\'};"\n
type="text"\n
tal:attributes=\'value search_text;\n
name full_text_search_key;\n
onkeypress python:"if(event.keyCode==13){" + real_context.KnowledgePad_generateAjaxCall(context_url+"/"+form_id,box,box_id,params).replace("\\"this.value\\"","this.value")+ "return false;;}"\'/>\n
</tal:block>\n
</div> \n
\n
</div>\n
<div class="listbox_footer_box"\n
tal:define="need_pagination python: int(here.total_size) > int(here.getMaxLineNumber())"\n
......
......@@ -76,9 +76,7 @@
<key> <string>bottom</string> </key>
<value>
<list>
<string>top_search_text</string>
<string>listbox</string>
<string>bottom_search_text</string>
</list>
</value>
</item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>bottom_search_text</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>search_text_listbox</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>WebSection_viewMinimalKMWidgetFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Bottom search text</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -462,6 +462,14 @@
<key> <string>full_text_search</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>full_text_search_key</string> </key>
<value> <string>field_your_search_text_listbox</string> </value>
</item>
<item>
<key> <string>full_text_search_key_script</string> </key>
<value> <string>WebSite_viewQuickSearchResultList</string> </value>
</item>
<item>
<key> <string>global_attributes</string> </key>
<value>
......
......@@ -219,39 +219,44 @@ div.search_popup{\n
}\n
\n
/* List style selection */\n
div.list-style-selection {\n
div.listbox-list-style-selection {\n
width:auto;\n
float:left;\n
}\n
div.list-style-selection span{\n
div.listbox-list-style-selection span{\n
font-weight:bold;\n
padding-left:10px;\n
vertical-align:-4px;\n
}\n
div.list-style-selection ul{\n
div.listbox-list-style-selection ul{\n
display:inline;\n
padding-left:0;\n
margin: 0;\n
vertical-align: -4px;\n
}\n
div.list-style-selection li{\n
div.listbox-list-style-selection li{\n
display: inline;\n
}\n
div.list-style-selection li a.selected{\n
div.listbox-list-style-selection li a.selected{\n
font-weight: bold;\n
}\n
/* Search bar */\n
div.extendedSearchBar {\n
\n
/* Listbox full text search bar */\n
div.listbox-full-text-search {\n
float:left;\n
margin-top:0;\n
padding:1em 0 0.5em;\n
}\n
div.extendedSearchBar input.button{\n
div.listbox-full-text-search input{\n
width: auto;\n
}\n
div.listbox-full-text-search input.button{\n
background-image: url(\'./km_img/search_background.png\');\n
background-color: inherit;\n
border: 0 none;\n
color:#FFFFFF;\n
}\n
\n
div.resultList{\n
float:left;\n
}\n
......
1497
\ No newline at end of file
1498
\ No newline at end of file
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