Commit 6bffa0b9 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: show domain info in search input and correct some name error

parent 2fe3e7ad
......@@ -633,7 +633,7 @@
"submit",\n
false,\n
function () {\n
createTranslatedItem(gadget);\n
return createTranslatedItem(gadget);\n
}\n
);\n
loopEventListener(\n
......@@ -789,7 +789,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.5968.16440.8482</string> </value>
<value> <string>946.26033.17518.45738</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -807,7 +807,7 @@
</tuple>
<state>
<tuple>
<float>1443627977.21</float>
<float>1444745422.24</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -505,7 +505,7 @@
})\n
.fail(function (error) {\n
if (error.target && error.target.status === 500) {\n
return gadget.showQueryError(" Unsupportred Query");\n
return gadget.showQueryError(" Unsupported Query");\n
}\n
throw error;\n
});\n
......@@ -806,7 +806,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.5543.47694.6075</string> </value>
<value> <string>946.5879.32028.47257</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -824,7 +824,7 @@
</tuple>
<state>
<tuple>
<float>1443622529.3</float>
<float>1444722552.95</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -187,6 +187,7 @@
\n
if (options.domain_tree) {\n
form_options.form_definition.domain_tree = options.domain_tree;\n
search_options.domain_tree = options.domain_tree;\n
}\n
form_options.begin_from = options.begin_from;\n
form_options.view = options.view;\n
......@@ -397,7 +398,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.4412.4475.4949</string> </value>
<value> <string>946.4414.7934.44748</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -415,7 +416,7 @@
</tuple>
<state>
<tuple>
<float>1443534607.25</float>
<float>1444816468.81</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -123,7 +123,7 @@
<script id="panel-template" type="text/x-handlebars-template">\n
<div class="field_container">\n
<div class="ui-field-contain">\n
<div class="css-compatability-helper">\n
<div class="bottom">\n
<div class="ui-input-text ui-body-{{theme}} ui-input-has-icon ui-corner-all ui-shadow-inset ui-input-has-clear {{status_class}} {{css_class}}">\n
<form class="save_form document_form">\n
<input type="text" data-enhanced="true" value="{{widget_value}}" name="search" {{widget_status_attribute}} />\n
......@@ -290,7 +290,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.13789.16491.47428</string> </value>
<value> <string>946.26055.51865.42035</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -308,7 +308,7 @@
</tuple>
<state>
<tuple>
<float>1440168925.51</float>
<float>1444746743.09</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -101,7 +101,7 @@
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*global window, rJS, RSVP, loopEventListener, Handlebars */\n
/*global window, rJS, RSVP, loopEventListener, Handlebars, QueryFactory, SimpleQuery, ComplexQuery, Query */\n
/*jslint nomen: true, indent: 2, maxerr: 3 */\n
(function (window, rJS, RSVP, loopEventListener, Handlebars) {\n
"use strict";\n
......@@ -147,7 +147,6 @@
append_attribute,\n
placeholder = "",\n
value,\n
hide_value,\n
is_disabled = option_dict.disabled,\n
search_gadget = this;\n
search_gadget.props.jio_key = option_dict.jio_key;\n
......@@ -156,8 +155,12 @@
append_attribute = \' disabled="disabled\';\n
}\n
value = option_dict.extended_search || "";\n
if (option_dict.domain_tree) {\n
value = (value === "" ? option_dict.domain_tree : value + " AND " + option_dict.domain_tree);\n
}\n
\n
if (option_dict.hide_item) {\n
value = (value === ""? option_dict.hide_item : value + " AND " + option_dict.hide_item);\n
value = (value === "" ? option_dict.hide_item : value + " AND " + option_dict.hide_item);\n
}\n
return new RSVP.Queue()\n
.push(function () {\n
......@@ -190,15 +193,17 @@
var gadget = this,\n
i,\n
query_list,\n
domain_tree_list,\n
domain_tree_query,\n
tmp,\n
hide_query,\n
search_query;\n
\n
function filterSubmit(evt) {\n
function filterSubmit() {\n
return gadget.triggerFilterEditor();\n
}\n
\n
function formSubmit(evt) {\n
function formSubmit() {\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.getContent();\n
......@@ -206,6 +211,7 @@
.push(function (data) {\n
if (data.search) {\n
query_list = [];\n
domain_tree_list = [];\n
search_query = QueryFactory.create(data.search);\n
if (search_query instanceof SimpleQuery) {\n
tmp = [search_query];\n
......@@ -214,8 +220,10 @@
}\n
for (i = 0; i < tmp.length; i += 1) {\n
if (tmp[i] instanceof SimpleQuery) {\n
if (tmp[i].key !== "catalog.uid") {\n
if (tmp[i].key !== "catalog.uid" && tmp[i].key.indexOf("category") === -1) {\n
query_list.push(tmp[i]);\n
} else if (tmp[i].key.indexOf("category") !== -1) {\n
domain_tree_list.push(tmp[i]);\n
} else {\n
hide_query = new ComplexQuery({\n
operator: "AND",\n
......@@ -229,16 +237,25 @@
}\n
}\n
\n
if (domain_tree_list.length) {\n
domain_tree_query = new ComplexQuery({\n
operator: "AND",\n
query_list: domain_tree_list,\n
type: "complex"\n
});\n
}\n
return gadget.redirect({jio_key: gadget.props.jio_key,\n
"extended_search": Query.objectToSearchText(new ComplexQuery({\n
operator: search_query.operator || "AND",\n
query_list: query_list,\n
type: "complex"\n
operator: search_query.operator || "AND",\n
query_list: query_list,\n
type: "complex"\n
})),\n
"hide_item": hide_query ? Query.objectToSearchText(hide_query) : ""});\n
"domain_tree": domain_tree_query ? Query.objectToSearchText(domain_tree_query) : "",\n
"hide_item": hide_query ? Query.objectToSearchText(hide_query) : ""\n
});\n
}\n
return gadget.redirect({jio_key: gadget.props.jio_key,\n
"extended_search": "", "hide_item": ""});\n
"extended_search": "", "domain_tree": "", "hide_item": ""});\n
});\n
}\n
// Listen to form submit\n
......@@ -393,7 +410,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.4406.57134.42359</string> </value>
<value> <string>946.27251.38084.62685</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -411,7 +428,7 @@
</tuple>
<state>
<tuple>
<float>1443534489.37</float>
<float>1444824166.86</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -141,7 +141,7 @@
</div>\n
</div>\n
\n
<h1 class="ui-title" role="heading" data-i18n="sort Editor" aria-level="1">Sort Editor</h1>\n
<h1 class="ui-title" role="heading" data-i18n="Sort Editor" aria-level="1">Sort Editor</h1>\n
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right">\n
<div class="ui-controlgroup-controls">\n
<form class="submit">\n
......@@ -299,7 +299,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.4096.6867.34269</string> </value>
<value> <string>946.5841.39273.59596</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -317,7 +317,7 @@
</tuple>
<state>
<tuple>
<float>1443620255.9</float>
<float>1444813823.63</float>
<string>UTC</string>
</tuple>
</state>
......
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