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
44a74f0e
Commit
44a74f0e
authored
May 28, 2018
by
Renán Sosa Guillen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prueba
parent
86898394
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
77 additions
and
22 deletions
+77
-22
body.css
catalog/static/css/body.css
+4
-4
dataRetrieval.js
catalog/static/js/dataRetrieval.js
+67
-17
base_top.html
catalog/templates/base_top.html
+3
-0
views.py
catalog/views.py
+3
-1
No files found.
catalog/static/css/body.css
View file @
44a74f0e
...
@@ -144,7 +144,7 @@ div .item-info-view {
...
@@ -144,7 +144,7 @@ div .item-info-view {
top
:
52px
;
top
:
52px
;
left
:
-402px
;
left
:
-402px
;
width
:
400px
;
width
:
400px
;
height
:
418
px
;
height
:
360
px
;
background-color
:
#dc7828
;
background-color
:
#dc7828
;
}
}
...
@@ -157,7 +157,7 @@ ul.control-sidebar-menu li:hover div.item-info-view {
...
@@ -157,7 +157,7 @@ ul.control-sidebar-menu li:hover div.item-info-view {
}
}
div
.cropped-preview
{
div
.cropped-preview
{
max-height
:
14
0px
;
max-height
:
20
0px
;
overflow
:
hidden
;
overflow
:
hidden
;
}
}
...
@@ -172,7 +172,7 @@ div .polygon-item-data {
...
@@ -172,7 +172,7 @@ div .polygon-item-data {
}
}
div
.polygon-item-data
.city
{
div
.polygon-item-data
.city
{
font-size
:
20
px
;
font-size
:
12
px
;
font-weight
:
bolder
;
font-weight
:
bolder
;
padding-bottom
:
5px
;
padding-bottom
:
5px
;
border-bottom
:
2px
solid
;
border-bottom
:
2px
solid
;
...
@@ -198,7 +198,7 @@ div .item-info-view .button-add-del {
...
@@ -198,7 +198,7 @@ div .item-info-view .button-add-del {
}
}
div
#product-list-globe
{
div
#product-list-globe
{
max-height
:
1
00px
;
max-height
:
5
00px
;
overflow
:
auto
;
overflow
:
auto
;
}
}
/*----------product list clases----------*/
/*----------product list clases----------*/
...
...
catalog/static/js/dataRetrieval.js
View file @
44a74f0e
...
@@ -182,6 +182,7 @@ $(document).ready(function () {
...
@@ -182,6 +182,7 @@ $(document).ready(function () {
var
productListGlobe
=
[];
// this array represent DB where products will be stored
var
productListGlobe
=
[];
// this array represent DB where products will be stored
var
PRODUCT_IN_LIST
=
false
;
var
PRODUCT_IN_LIST
=
false
;
var
product_list
=
[]
// function for making POST request to productList in view.py
// function for making POST request to productList in view.py
$
(
'#product-form'
).
submit
(
function
(
event
)
{
$
(
'#product-form'
).
submit
(
function
(
event
)
{
...
@@ -194,6 +195,7 @@ $(document).ready(function () {
...
@@ -194,6 +195,7 @@ $(document).ready(function () {
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
console
.
log
(
"DATA: "
,
data
);
console
.
log
(
"DATA: "
,
data
);
product_list
=
data
;
if
(
productListGlobe
.
length
>
0
)
{
if
(
productListGlobe
.
length
>
0
)
{
PRODUCT_IN_LIST
=
false
;
PRODUCT_IN_LIST
=
false
;
...
@@ -215,8 +217,8 @@ $(document).ready(function () {
...
@@ -215,8 +217,8 @@ $(document).ready(function () {
'<a href="javascript:void(0)">'
+
'<a href="javascript:void(0)">'
+
'<i class="menu-icon glyphicon glyphicon-bookmark bg-red"></i>'
+
'<i class="menu-icon glyphicon glyphicon-bookmark bg-red"></i>'
+
'<div class="menu-info">'
+
'<div class="menu-info">'
+
'<h4 class="control-sidebar-subheading">'
+
data
.
city_name
+
'</h4>'
+
'<h4 class="control-sidebar-subheading">'
+
data
.
product
.
producttype
+
'_'
+
data
.
product
.
tileid
+
'</h4>'
+
'<p>
May 26th 2018
</p>'
+
'<p>
'
+
data
.
product
.
beginposition
+
'
</p>'
+
'</div>'
+
'</div>'
+
'</a>'
+
'</a>'
+
// '</li>'+
// '</li>'+
...
@@ -227,27 +229,27 @@ $(document).ready(function () {
...
@@ -227,27 +229,27 @@ $(document).ready(function () {
'<img src="'
+
data
.
img
+
'">'
+
'<img src="'
+
data
.
img
+
'">'
+
'</div>'
+
'</div>'
+
'<div class="polygon-item-data">'
+
'<div class="polygon-item-data">'
+
'<div class="city">'
+
data
.
city_name
+
'</div>'
+
'<div class="city">'
+
data
.
product
.
identifier
+
'</div>'
+
'<p class="info">'
+
'<p class="info">'
+
'<i class="fa fa-sync-alt"></i>'
+
'<i class="fa fa-sync-alt"></i>'
+
'<span class="type">
Process
:</span><br>'
+
'<span class="type">
Size
:</span><br>'
+
'<span class="data-info">'
+
data
.
pro
cess
+
'</span>'
+
'<span class="data-info">'
+
data
.
pro
duct
.
size
+
'</span>'
+
'</p>'
+
'</p>'
+
'<p class="info">'
+
'<p class="info">'
+
'<i class="fa fa-calendar-
alt
"></i>'
+
'<i class="fa fa-calendar-
gear
"></i>'
+
'<span class="type">
Date range
:</span><br>'
+
'<span class="type">
Instrument
:</span><br>'
+
'<span class="data-info">
From '
+
data
.
start_date
+
' to '
+
data
.
end_dat
e
+
'</span>'
+
'<span class="data-info">
'
+
data
.
product
.
instrumentnam
e
+
'</span>'
+
'</p>'
+
'</p>'
+
'<p class="info">'
+
// '<p class="info">'+
'<i class="fa fa-cloud"></i>'
+
// '<i class="fa fa-cloud"></i>'+
'<span class="type">Cloud percentage:</span><br>'
+
// '<span class="type">Cloud percentage:</span><br>'+
'<span class="data-info">'
+
data
.
cloud_percentage
+
' %</span>'
+
// '<span class="data-info">' + data.product.cloudcoverpercentage + ' %</span>'+
'</p>'
+
// '</p>'+
'</div>'
+
'<div class="button-add-del">'
+
'<button type="button" class="btn btn-success">Add to cart</button> '
+
'<button type="button" class="btn btn-danger">Remove</button>'
+
'</div>'
+
'</div>'
+
// '<div class="button-add-del">'+
// '<button type="button" class="btn btn-success">Add to cart</button> '+
// '<button type="button" class="btn btn-danger">Remove</button>'+
// '</div>'+
'</div>'
+
'</div>'
+
// '</div>'+
// '</div>'+
// '</div>'+
// '</div>'+
...
@@ -261,4 +263,52 @@ $(document).ready(function () {
...
@@ -261,4 +263,52 @@ $(document).ready(function () {
event
.
preventDefault
();
event
.
preventDefault
();
});
});
$
(
'#add-cart'
).
click
(
function
()
{
product_list
.
catalog
.
forEach
(
function
(
data
)
{
var
product_html
=
'<li id="'
+
data
.
id
+
' class="hover-me">'
+
'<a href="javascript:void(0)">'
+
'<i class="menu-icon glyphicon glyphicon-bookmark bg-red"></i>'
+
'<div class="menu-info">'
+
'<h4 class="control-sidebar-subheading">'
+
data
.
product
.
producttype
+
'_'
+
data
.
product
.
tileid
+
'</h4>'
+
'<p>'
+
data
.
product
.
beginposition
+
'</p>'
+
'</div>'
+
'</a>'
+
// '</li>'+
// '<div id="' + data.id + '-hover" class="row">'+
// '<div class="col-12">'+
'<div id="'
+
data
.
id
+
'-hover" class="item-info-view">'
+
'<div class="cropped-preview">'
+
'<img src="'
+
data
.
img
+
'">'
+
'</div>'
+
'<div class="polygon-item-data">'
+
'<div class="city">'
+
data
.
product
.
identifier
+
'</div>'
+
'<p class="info">'
+
'<i class="fa fa-sync-alt"></i>'
+
'<span class="type">Size:</span><br>'
+
'<span class="data-info">'
+
data
.
product
.
size
+
'</span>'
+
'</p>'
+
'<p class="info">'
+
'<i class="fa fa-calendar-gear"></i>'
+
'<span class="type">Instrument:</span><br>'
+
'<span class="data-info">'
+
data
.
product
.
instrumentname
+
'</span>'
+
'</p>'
+
// '<p class="info">'+
// '<i class="fa fa-cloud"></i>'+
// '<span class="type">Cloud percentage:</span><br>'+
// '<span class="data-info">' + data.product.cloudcoverpercentage + ' %</span>'+
// '</p>'+
'</div>'
+
// '<div class="button-add-del">'+
// '<button type="button" class="btn btn-success">Add to cart</button> '+
// '<button type="button" class="btn btn-danger">Remove</button>'+
// '</div>'+
'</div>'
+
// '</div>'+
// '</div>'+
'</li>'
;
$
(
'#product-list-globe'
).
append
(
product_html
);
});
});
});
});
catalog/templates/base_top.html
View file @
44a74f0e
...
@@ -105,6 +105,9 @@
...
@@ -105,6 +105,9 @@
<!-- Home tab content -->
<!-- Home tab content -->
<div
class=
"tab-pane"
id=
"control-sidebar-home-tab"
>
<div
class=
"tab-pane"
id=
"control-sidebar-home-tab"
>
<h3
class=
"control-sidebar-heading"
><b>
Products
</b></h3>
<h3
class=
"control-sidebar-heading"
><b>
Products
</b></h3>
<button
type=
"button"
name=
"search"
id=
"add-cart"
class=
"btn btn-primary"
>
Add to cart
</button>
<ul
id=
"product-list-globe"
class=
"control-sidebar-menu"
></ul>
<ul
id=
"product-list-globe"
class=
"control-sidebar-menu"
></ul>
<!-- <li id="me-id">
<!-- <li id="me-id">
...
...
catalog/views.py
View file @
44a74f0e
...
@@ -59,7 +59,6 @@ def productList(request):
...
@@ -59,7 +59,6 @@ def productList(request):
img_preview
=
'/static/images/sat_preview/sat_test.jpg'
img_preview
=
'/static/images/sat_preview/sat_test.jpg'
item_data
=
{
item_data
=
{
'img'
:
img_preview
,
'process'
:
process
,
'process'
:
process
,
'start_date'
:
init_date
,
'start_date'
:
init_date
,
'end_date'
:
end_date
,
'end_date'
:
end_date
,
...
@@ -69,7 +68,10 @@ def productList(request):
...
@@ -69,7 +68,10 @@ def productList(request):
# se crea una lista de objetos del catalogo
# se crea una lista de objetos del catalogo
catalog
=
[]
catalog
=
[]
for
p
in
products
:
for
p
in
products
:
img_link
=
products
[
p
][
'link_icon'
]
img_link
=
img_link
[:
img_link
.
find
(
"/"
)
+
2
]
+
"emmhp:geoemm29@"
+
img_link
[
img_link
.
find
(
"/"
)
+
2
:]
item_data
[
'id'
]
=
products
[
p
][
'uuid'
]
item_data
[
'id'
]
=
products
[
p
][
'uuid'
]
item_data
[
'img'
]
=
img_link
item_data
[
'product'
]
=
products
[
p
]
item_data
[
'product'
]
=
products
[
p
]
catalog
.
append
(
item_data
)
catalog
.
append
(
item_data
)
...
...
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