Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
40679087
Commit
40679087
authored
Feb 05, 2019
by
Sergio Adrian Gongora Euan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
grouping of products added in search
parent
d4bb14e5
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
74 additions
and
8 deletions
+74
-8
body.css
catalog/static/catalog/css/body.css
+28
-6
dataRetrieval.js
catalog/static/catalog/js/dataRetrieval.js
+28
-1
base_top.html
catalog/templates/base_top.html
+1
-1
templates.html
catalog/templates/templates.html
+17
-0
No files found.
catalog/static/catalog/css/body.css
View file @
40679087
...
@@ -206,13 +206,13 @@ div .info-product-cart-box {
...
@@ -206,13 +206,13 @@ div .info-product-cart-box {
margin-bottom
:
15px
;
margin-bottom
:
15px
;
}
}
ul
.control-sidebar-menu
li
div
.bg-geo
{
/* ul.control-sidebar-menu li div.bg-geo {*/
display
:
none
;
/* display: none; */
}
/* } */
ul
.control-sidebar-menu
li
:hover
div
.bg-geo
{
/* ul.control-sidebar-menu li:hover div.bg-geo { */
display
:
block
;
/* display: block; */
}
/* } */
div
.bg-geo
{
div
.bg-geo
{
background-color
:
#dc7828
;
background-color
:
#dc7828
;
...
@@ -341,6 +341,28 @@ div #product-list-cart-items {
...
@@ -341,6 +341,28 @@ div #product-list-cart-items {
overflow
:
auto
;
overflow
:
auto
;
}
}
ul
#product-list-cart-items
li
div
.bg-geo
{
display
:
none
;
}
ul
#product-list-cart-items
li
:hover
div
.bg-geo
{
display
:
block
;
}
div
.product_list_category
{
max-height
:
700px
;
max-width
:
207px
;
overflow
:
auto
;
}
ul
.product_list_category
li
div
.bg-geo
{
display
:
none
;
}
ul
.product_list_category
li
:hover
div
.bg-geo
{
display
:
block
;
}
/*div #product-list-cart-items {
/*div #product-list-cart-items {
max-height: 167px;
max-height: 167px;
overflow: auto;
overflow: auto;
...
...
catalog/static/catalog/js/dataRetrieval.js
View file @
40679087
...
@@ -114,6 +114,7 @@ $("#id_polygon").on('keyup', function (e) {
...
@@ -114,6 +114,7 @@ $("#id_polygon").on('keyup', function (e) {
// this function cleans list of available products
// this function cleans list of available products
function
erase_product_list_globe
()
{
function
erase_product_list_globe
()
{
deletePolygon
();
prevfeature
=
new
Map
();
prevfeature
=
new
Map
();
var
pol_element
=
document
.
getElementById
(
'product-list-globe'
);
var
pol_element
=
document
.
getElementById
(
'product-list-globe'
);
while
(
pol_element
.
firstChild
)
{
while
(
pol_element
.
firstChild
)
{
...
@@ -139,6 +140,14 @@ function erase_product_list_cart() {
...
@@ -139,6 +140,14 @@ function erase_product_list_cart() {
}
}
}
}
function
deletePolygon
(){
prevfeature
.
forEach
(
function
(
value
,
uuid
){
if
(
prevfeature
.
has
(
uuid
))
{
osmap
.
deletefootprint
(
prevfeature
.
get
(
uuid
));
prevfeature
.
delete
(
uuid
);
}
});
};
var
prevfeature
=
new
Map
();
var
prevfeature
=
new
Map
();
function
drawApiResponse
(
element
)
{
function
drawApiResponse
(
element
)
{
...
@@ -172,6 +181,20 @@ function createProductContainer() {
...
@@ -172,6 +181,20 @@ function createProductContainer() {
document
.
querySelector
(
'#product-list-cart'
).
appendChild
(
clone_1
);
document
.
querySelector
(
'#product-list-cart'
).
appendChild
(
clone_1
);
}
}
let
productCategory
=
new
Map
();
function
creatCategoryProductContainer
(
catalog
){
productCategory
=
new
Map
();
catalog
.
forEach
(
function
(
category
){
if
(
!
productCategory
.
has
(
category
.
product
.
tileid
)){
productCategory
.
set
(
category
.
product
.
tileid
,
1
)
var
temp_1
=
document
.
querySelector
(
'#product_list_category'
);
temp_1
.
content
.
querySelector
(
'span'
).
textContent
=
category
.
product
.
tileid
;
temp_1
.
content
.
querySelector
(
'ul .control-sidebar-menu'
).
id
=
"L-"
+
category
.
product
.
tileid
;
var
clone_1
=
document
.
importNode
(
temp_1
.
content
,
true
);
document
.
querySelector
(
'#product-list-globe'
).
appendChild
(
clone_1
);
}
})
}
$
(
'#ajax-input'
).
focus
(
function
()
{
$
(
'#ajax-input'
).
focus
(
function
()
{
console
.
log
(
'in'
);
console
.
log
(
'in'
);
...
@@ -280,6 +303,7 @@ $(document).ready(function () {
...
@@ -280,6 +303,7 @@ $(document).ready(function () {
if
(
product_list
.
catalog
.
length
>
0
)
{
if
(
product_list
.
catalog
.
length
>
0
)
{
console
.
log
(
"DEFS: ahora crea producto"
);
console
.
log
(
"DEFS: ahora crea producto"
);
creatCategoryProductContainer
(
data
.
catalog
);
data
.
catalog
.
forEach
(
function
(
data
)
{
data
.
catalog
.
forEach
(
function
(
data
)
{
// image request to webservice
// image request to webservice
...
@@ -308,7 +332,8 @@ $(document).ready(function () {
...
@@ -308,7 +332,8 @@ $(document).ready(function () {
temp
.
content
.
querySelectorAll
(
'span'
)[
3
].
textContent
=
data
.
product
.
instrumentname
;
temp
.
content
.
querySelectorAll
(
'span'
)[
3
].
textContent
=
data
.
product
.
instrumentname
;
var
clone
=
document
.
importNode
(
temp
.
content
,
true
);
var
clone
=
document
.
importNode
(
temp
.
content
,
true
);
document
.
querySelector
(
'#product-list-globe'
).
appendChild
(
clone
);
//document.querySelector('#product-list-globe').appendChild(clone);
document
.
querySelector
(
'#L-'
+
data
.
product
.
tileid
).
appendChild
(
clone
);
}
}
});
});
...
@@ -343,6 +368,7 @@ $(document).ready(function () {
...
@@ -343,6 +368,7 @@ $(document).ready(function () {
var
submit_data_array
=
submit_data
.
split
(
"&product_selected="
);
var
submit_data_array
=
submit_data
.
split
(
"&product_selected="
);
console
.
log
(
"djdj: "
,
productListGlobe
);
console
.
log
(
"djdj: "
,
productListGlobe
);
deletePolygon
();
productListGlobe
.
forEach
(
function
(
data
)
{
productListGlobe
.
forEach
(
function
(
data
)
{
if
(
submit_data_array
.
indexOf
(
data
.
uuid
)
>
-
1
)
{
if
(
submit_data_array
.
indexOf
(
data
.
uuid
)
>
-
1
)
{
console
.
log
(
"DATA sí esta: "
,
data
.
uuid
);
console
.
log
(
"DATA sí esta: "
,
data
.
uuid
);
...
@@ -365,6 +391,7 @@ $(document).ready(function () {
...
@@ -365,6 +391,7 @@ $(document).ready(function () {
}
}
});
});
$
(
"#product-list-globe"
).
empty
();
if
(
cartProductList
.
length
>
0
)
{
if
(
cartProductList
.
length
>
0
)
{
// request for saving product in cart DB
// request for saving product in cart DB
// variable prod_cart_url in map.html
// variable prod_cart_url in map.html
...
...
catalog/templates/base_top.html
View file @
40679087
...
@@ -111,7 +111,7 @@
...
@@ -111,7 +111,7 @@
</div>
</div>
</div>
</div>
<!-- this ul element is filled with data -->
<!-- this ul element is filled with data -->
<ul
id=
"product-list-globe"
class=
"control-sidebar-menu"
></ul>
<ul
id=
"product-list-globe"
class=
"control-sidebar-menu"
data-widget=
"tree"
></ul>
<!-- /.control-sidebar-menu -->
<!-- /.control-sidebar-menu -->
</form>
</form>
</div>
</div>
...
...
catalog/templates/templates.html
View file @
40679087
...
@@ -21,6 +21,23 @@
...
@@ -21,6 +21,23 @@
<!-- city list template -->
<!-- city list template -->
<!-- product list template -->
<!-- product list template -->
<template
id=
"product_list_category"
>
<li
class=
"treeview"
>
<a
href=
"#"
>
<i
class=
"fa fa-cubes"
></i>
<span></span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
<ul
class=
"treeview-menu sidebar-form"
>
<li>
<ul
id=
""
class=
"control-sidebar-menu product_list_category"
></ul>
</li>
</ul>
</li>
</template>
<template
id=
"product_list_template"
>
<template
id=
"product_list_template"
>
<div
id=
""
class=
"single-product-input"
>
<div
id=
""
class=
"single-product-input"
>
<input
type=
"checkbox"
name=
"product_selected"
value=
""
checked
>
<input
type=
"checkbox"
name=
"product_selected"
value=
""
checked
>
...
...
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