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
bb012a39
Commit
bb012a39
authored
Feb 07, 2019
by
Luis Ernesto Dominguez Uriostegui
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab.geoint.mx/mario.chirinos/GeoInt_SIDT
into dev
parents
83887981
8c60ef81
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
44 additions
and
6 deletions
+44
-6
settings.py
GeoInt_SIDT/settings.py
+1
-1
body.css
catalog/static/catalog/css/body.css
+13
-2
dataRetrieval.js
catalog/static/catalog/js/dataRetrieval.js
+18
-1
base_top.html
catalog/templates/base_top.html
+1
-1
map.html
catalog/templates/map.html
+1
-0
templates.html
catalog/templates/templates.html
+1
-0
urls.py
catalog/urls.py
+1
-0
views.py
catalog/views.py
+8
-1
No files found.
GeoInt_SIDT/settings.py
View file @
bb012a39
...
...
@@ -27,7 +27,7 @@ DEBUG = True
ALLOWED_HOSTS
=
[
'*'
]
DATA_UPLOAD_MAX_MEMORY_SIZE
=
500242880
#the post max is 500MB
# Application definition
INSTALLED_APPS
=
[
...
...
catalog/static/catalog/css/body.css
View file @
bb012a39
...
...
@@ -337,7 +337,7 @@ div #product-list-globe {
div
#product-list-cart-items
{
max-height
:
700px
;
max-width
:
207px
;
max-width
:
105%
;
overflow
:
auto
;
}
...
...
@@ -351,7 +351,7 @@ ul #product-list-cart-items li:hover div.bg-geo {
div
.product_list_category
{
max-height
:
700px
;
max-width
:
207px
;
max-width
:
105%
;
overflow
:
auto
;
}
...
...
@@ -423,3 +423,14 @@ div .sidebar-input input[type="text"] {
border
:
1px
solid
transparent
;
height
:
35px
;
}
.control-sidebar
{
right
:
-250px
;
width
:
250px
;
}
.control-sidebar-bg
{
right
:
-250px
;
width
:
250px
;
}
.control-sidebar-open
{
right
:
0px
!important
;
}
\ No newline at end of file
catalog/static/catalog/js/dataRetrieval.js
View file @
bb012a39
...
...
@@ -102,6 +102,22 @@ function updateCart(){
});
};
function
deleteProductCar
(
element
){
let
id
=
element
.
parentElement
.
querySelector
(
'span'
).
id
;
element
.
parentElement
.
parentElement
.
classList
.
remove
(
'treeview'
);
$
.
ajax
({
type
:
'POST'
,
url
:
del_prod_cartDB_url
,
data
:
{
'csrfmiddlewaretoken'
:
document
.
getElementsByName
(
'csrfmiddlewaretoken'
)[
0
].
value
,
'id'
:
id
},
dataType
:
'json'
,
success
:
function
(
data
)
{
element
.
parentElement
.
parentElement
.
remove
();
}
});
}
function
drawPolygon
(
element
)
{
polygonList
.
forEach
(
function
(
polygon
)
{
...
...
@@ -211,7 +227,8 @@ function createProductContainer(products) {
products
.
forEach
(
function
(
list
){
var
temp_1
=
document
.
querySelector
(
'#product_cart_1'
);
let
name
=
list
.
aggreg_date
.
replace
(
/
([
.*+?^=!:${}()|
\[\]\/\\])
/g
,
"-"
);
temp_1
.
content
.
querySelector
(
'span'
).
textContent
=
name
;
temp_1
.
content
.
querySelector
(
'span'
).
id
=
list
.
id
;
temp_1
.
content
.
querySelector
(
'span'
).
textContent
=
list
.
aggreg_date
;
temp_1
.
content
.
querySelector
(
'ul .control-sidebar-menu'
).
id
=
"L-"
+
name
;
var
clone_1
=
document
.
importNode
(
temp_1
.
content
,
true
);
document
.
querySelector
(
'#product-list-cart'
).
appendChild
(
clone_1
);
...
...
catalog/templates/base_top.html
View file @
bb012a39
...
...
@@ -162,7 +162,7 @@
</div>
</div>
<!-- this ul element is filled with data -->
<ul
id=
"product-list-cart"
class=
"sidebar-menu"
data-widget=
"tree"
></ul>
<ul
id=
"product-list-cart"
class=
"
control-
sidebar-menu"
data-widget=
"tree"
></ul>
</div>
<!-- /.tab-pane -->
</div>
...
...
catalog/templates/map.html
View file @
bb012a39
...
...
@@ -357,5 +357,6 @@
var
prod_cart_url
=
"{% url 'cart-rqst' %}"
;
// url for requesting product saving in cart
var
prod_from_cartDB_url
=
"{% url 'from-cart-rqst' %}"
;
// url for requesting product from cart table in DB
var
purch_prod_url
=
"{% url 'purch-prod-rqst' %}"
;
var
del_prod_cartDB_url
=
"{% url 'del-cart-rqst' %}"
;
</script>
{% endblock %}
catalog/templates/templates.html
View file @
bb012a39
...
...
@@ -74,6 +74,7 @@
<a
href=
"#"
>
<i
class=
"fa fa-cubes"
></i>
<span></span>
<i
class=
"glyphicon glyphicon-remove"
style=
"padding-left: 15px"
onclick=
"deleteProductCar(this);"
></i>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
...
...
catalog/urls.py
View file @
bb012a39
...
...
@@ -11,6 +11,7 @@ urlpatterns = [
url
(
r'^imgrequest/$'
,
views
.
requestToImage
,
name
=
'img-rqst'
),
url
(
r'^cartrequest/$'
,
views
.
saveInCart
,
name
=
'cart-rqst'
),
url
(
r'^fromcartrqst/$'
,
views
.
getFromCart
,
name
=
'from-cart-rqst'
),
url
(
r'^delcartrqst/$'
,
views
.
delFromCart
,
name
=
'del-cart-rqst'
),
url
(
r'^purchcartrqst/$'
,
views
.
purchaseProduct
,
name
=
'purch-prod-rqst'
),
url
(
r'^cart/$'
,
views
.
showCart
,
name
=
'show-cart'
),
]
catalog/views.py
View file @
bb012a39
...
...
@@ -213,7 +213,7 @@ def getFromCart(request):
user
=
User
.
objects
.
get
(
id
=
request
.
user
.
id
)
prod_list
=
[]
product_list
=
Purchase
.
objects
.
values
(
'user'
,
'productList'
,
'purchased'
,
'price'
,
'aggreg_date'
)
.
filter
(
user
=
user
,
purchased
=
0
)
product_list
=
Purchase
.
objects
.
values
(
'user'
,
'productList'
,
'purchased'
,
'price'
,
'aggreg_date'
,
'id'
)
.
filter
(
user
=
user
,
purchased
=
0
)
for
products
in
product_list
:
product
=
json
.
loads
(
products
[
'productList'
])
...
...
@@ -221,10 +221,17 @@ def getFromCart(request):
'purchased'
:
products
[
'purchased'
],
'price'
:
products
[
'price'
],
'aggreg_date'
:
products
[
'aggreg_date'
],
'id'
:
products
[
'id'
],
'catalog'
:
product
})
return
JsonResponse
({
'product_list'
:
prod_list
})
#-------------------------------------------------------------------------------
def
delFromCart
(
request
):
user
=
User
.
objects
.
get
(
id
=
request
.
user
.
id
)
product_list
=
Purchase
.
objects
.
filter
(
user
=
user
,
id
=
request
.
POST
[
'id'
])
.
delete
()
return
HttpResponse
(
status
=
204
)
##-------------------------------------------------------------------------------
#def L2ASCL_data(request):
# with open("/home/mario/NAS_MarioCh/mario_repsat_test/T15QZD_sclData.json") as f:
...
...
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