Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
ecommerce-ui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
ecommerce-ui
Commits
201ad90f
Commit
201ad90f
authored
May 01, 2014
by
Sven Franck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
app/data: fixed search for groups, brands and categories
parent
b33b4acf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
17 deletions
+39
-17
data/ui_panel_detail_search.json
data/ui_panel_detail_search.json
+26
-10
data/ui_panel_groups.json
data/ui_panel_groups.json
+1
-1
js/erp5_loader.js
js/erp5_loader.js
+12
-6
No files found.
data/ui_panel_detail_search.json
View file @
201ad90f
...
...
@@ -41,20 +41,28 @@
"type"
:
"input"
,
"direct"
:
{
"id"
:
"select_brand"
,
"className"
:
"translate"
},
"attributes"
:
{
"data-enhanced"
:
"true"
,
"data-inset"
:
false
,
"data-i18n"
:
"[placeholder]global_dict.filter"
,
"data-icon"
:
"search"
,
"data-action-btn"
:
"true"
,
"data-type"
:
"search"
,
"type"
:
"search"
},
"logic"
:{
"clear"
:
"true"
,
"action"
:
"search"
,
"add_label"
:
false
}
"logic"
:{
"clear"
:
"true"
,
"add_label"
:
false
}
},
{
"type"
:
"input"
,
"direct"
:
{
"className"
:
"action translate"
},
"attributes"
:
{
"type"
:
"submit"
,
"data-column"
:
"brand_id"
,
"data-i18n"
:
"[value]global_dict.search_brands"
,
"data-action"
:
"custom_checkbox_search"
},
"logic"
:
{
"wrapper_class_list"
:
" skim_button ui-btn-icon-right ui-icon-search "
}
},
{
"portal_type_source"
:
"Portal Category"
,
"portal_type_title"
:
"category"
,
"initial_query"
:
{
"query"
:
"reference: 'sub_websection'"
,
"include_docs"
:
true
,
"select_list"
:
[
"title"
,
"title_i18n"
]},
"property_dict"
:
{
"check"
:
true
},
"initial_query"
:
{
"query"
:
"reference: 'sub_websection'"
,
"include_docs"
:
true
,
"select_list"
:
[
"_id"
,
"title"
,
"title_i18n"
]},
"property_dict"
:
{},
"scheme"
:
[
{
"position"
:
"center"
,
"field_list"
:
[
{
"field"
:
"title"
}
]
},
{
"position"
:
"right"
,
"field_list"
:
[
{
"field"
:
"_id"
,
"setKey"
:
"id"
,
"type"
:
"check"
}
]
}
],
"children"
:
[{
...
...
@@ -84,20 +92,28 @@
"type"
:
"input"
,
"direct"
:
{
"id"
:
"select_category"
,
"className"
:
"translate"
},
"attributes"
:
{
"data-enhanced"
:
"true"
,
"data-inset"
:
false
,
"data-i18n"
:
"[placeholder]global_dict.filter"
,
"data-icon"
:
"search"
,
"data-action-btn"
:
"true"
,
"data-type"
:
"search"
,
"type"
:
"search"
},
"logic"
:{
"clear"
:
"true"
,
"action"
:
"search"
,
"add_label"
:
false
}
"logic"
:{
"clear"
:
"true"
,
"add_label"
:
false
}
},
{
"type"
:
"input"
,
"direct"
:
{
"className"
:
"action translate"
},
"attributes"
:
{
"type"
:
"submit"
,
"data-column"
:
"category"
,
"data-i18n"
:
"[value]global_dict.search_categories"
,
"data-action"
:
"custom_checkbox_search"
},
"logic"
:
{
"wrapper_class_list"
:
" skim_button ui-btn-icon-right ui-icon-search "
}
},
{
"portal_type_source"
:
"Portal Category"
,
"portal_type_title"
:
"category"
,
"initial_query"
:
{
"query"
:
"reference: 'product_category'"
,
"include_docs"
:
true
,
"select_list"
:
[
"title"
,
"title_i18n"
]},
"property_dict"
:
{
"check"
:
true
},
"initial_query"
:
{
"query"
:
"reference: 'product_category'"
,
"include_docs"
:
true
,
"select_list"
:
[
"_id"
,
"title"
,
"title_i18n"
]},
"property_dict"
:
{},
"scheme"
:
[
{
"position"
:
"center"
,
"field_list"
:
[
{
"field"
:
"title"
}
]
},
{
"position"
:
"right"
,
"field_list"
:
[
{
"field"
:
"_id"
,
"setKey"
:
"id"
,
"type"
:
"check"
}
]
}
],
"children"
:
[{
...
...
data/ui_panel_groups.json
View file @
201ad90f
...
...
@@ -49,7 +49,7 @@
"children"
:
[{
"type"
:
"input"
,
"direct"
:
{
"className"
:
"action translate"
},
"attributes"
:
{
"type"
:
"submit"
,
"data-i18n"
:
"[value]global_dict.search_categories"
,
"data-action"
:
"custom_checkbox_search"
},
"attributes"
:
{
"type"
:
"submit"
,
"data-
column"
:
"group"
,
"data-
i18n"
:
"[value]global_dict.search_categories"
,
"data-action"
:
"custom_checkbox_search"
},
"logic"
:
{
"wrapper_class_list"
:
" skim_button ui-btn-icon-right ui-icon-search "
}
}]
},{
...
...
js/erp5_loader.js
View file @
201ad90f
...
...
@@ -2985,19 +2985,25 @@
map
.
actions
=
{
"
custom_checkbox_search
"
:
function
(
obj
)
{
var
form_check_list
,
i
,
check_len
,
check
,
value_str
;
// TODO: it should be possible to inherit results so a dynamic listview
// could be child of a form, which is not dynamic!
form_check_list
=
obj
.
element
.
parentNode
.
parentNode
.
nextSibling
.
getElementsByTagName
(
"
input
"
);
var
form_check_list
,
i
,
check_len
,
check
,
value_str
,
target
;
// TODO: checkbox-listview should be child of form. This requires
// inheriting dynamic data, which still does not work... !
// TODO: find better way to set the key to search, if possible not
// on the checkbox unless it's easy to set and get!!!
target
=
obj
.
element
.
getAttribute
(
"
data-column
"
);
// HM
form_check_list
=
obj
.
element
.
parentNode
.
parentNode
.
parentNode
.
getElementsByTagName
(
"
ul
"
)[
0
].
getElementsByTagName
(
"
input
"
);
value_str
=
""
;
for
(
i
=
0
,
check_len
=
form_check_list
.
length
;
i
<
check_len
;
i
+=
1
)
{
check
=
form_check_list
[
i
];
if
(
check
.
type
=
"
checkbox
"
&&
check
.
checked
)
{
value_str
+=
"
group
=
"
+
check
.
id
.
split
(
"
select_
"
)[
1
]
+
"
|
"
;
value_str
+=
target
+
"
=
"
+
check
.
id
.
split
(
"
select_
"
)[
1
]
+
"
|
"
;
}
}
$
.
mobile
.
changePage
(
"
#
"
+
window
.
encodeURIComponent
(
"
product_module&query:
"
+
value_str
.
slice
(
0
,
-
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment