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
fb5cd2c0
Commit
fb5cd2c0
authored
Feb 08, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Paypal
parent
427ba53f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
246 additions
and
178 deletions
+246
-178
dataRetrieval.js
catalog/static/catalog/js/dataRetrieval.js
+1
-0
base_top.html
catalog/templates/base_top.html
+2
-1
show_cart.html
catalog/templates/show_cart.html
+209
-175
user_button.html
catalog/templates/user_button.html
+9
-0
views.py
catalog/views.py
+25
-2
No files found.
catalog/static/catalog/js/dataRetrieval.js
View file @
fb5cd2c0
...
@@ -445,6 +445,7 @@ $(document).ready(function () {
...
@@ -445,6 +445,7 @@ $(document).ready(function () {
});
});
}
else
{
}
else
{
hideWaitingModal
();
$
(
'aside'
).
removeClass
(
"control-sidebar-open"
);
$
(
'aside'
).
removeClass
(
"control-sidebar-open"
);
mssgModal
({
mssgModal
({
title
:
"No products were found!"
,
title
:
"No products were found!"
,
...
...
catalog/templates/base_top.html
View file @
fb5cd2c0
...
@@ -68,9 +68,10 @@
...
@@ -68,9 +68,10 @@
{% block user %}{% endblock %}
{% block user %}{% endblock %}
</li>
</li>
<!-- Control Sidebar Toggle Button -->
<!-- Control Sidebar Toggle Button -->
<li>
<li>
{% if showcart %}
<a
id=
"product-list-toggle"
href=
"#"
data-toggle=
"control-sidebar"
><i
<a
id=
"product-list-toggle"
href=
"#"
data-toggle=
"control-sidebar"
><i
class=
"fa fa-shopping-cart"
></i></a>
class=
"fa fa-shopping-cart"
></i></a>
{% endif %}
</li>
</li>
</ul>
</ul>
</div>
</div>
...
...
catalog/templates/show_cart.html
View file @
fb5cd2c0
This diff is collapsed.
Click to expand it.
catalog/templates/user_button.html
View file @
fb5cd2c0
...
@@ -34,6 +34,15 @@
...
@@ -34,6 +34,15 @@
</span>
</span>
</a>
</a>
</li>
</li>
<li>
<a
class=
"treeview "
href=
"{{ BASE_URL }}/catalog/cart"
>
<i
class=
"fa fa-shopping-cart"
></i>
<span>
View shopping cart
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
</li>
<li>
<li>
<a
class=
"treeview "
href=
"{% url 'logout' %}?next={{ request.path }}"
>
<a
class=
"treeview "
href=
"{% url 'logout' %}?next={{ request.path }}"
>
<i
class=
"fa fa-sign-out"
></i>
<i
class=
"fa fa-sign-out"
></i>
...
...
catalog/views.py
View file @
fb5cd2c0
...
@@ -62,9 +62,9 @@ def map(request):
...
@@ -62,9 +62,9 @@ def map(request):
View function for home page of site.
View function for home page of site.
"""
"""
form
=
ASFSearchForm
(
request
.
POST
)
form
=
ASFSearchForm
(
request
.
POST
)
showcart
=
True
# Render the HTML template index.html with the data in the context variable
# Render the HTML template index.html with the data in the context variable
return
render
(
request
,
'map.html'
,
{
"searchForm"
:
form
})
return
render
(
request
,
'map.html'
,
{
"searchForm"
:
form
,
"showcart"
:
showcart
})
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
def
requestToImage
(
request
):
def
requestToImage
(
request
):
...
@@ -559,5 +559,28 @@ def Pay (request):
...
@@ -559,5 +559,28 @@ def Pay (request):
user
=
User
.
objects
.
get
(
id
=
request
.
user
.
id
)
prod_list
=
[]
product_list
=
Purchase
.
objects
.
values
(
'id'
,
'user'
,
'productList'
,
'purchased'
,
'price'
,
'aggreg_date'
,
'search__process_id__name'
)
.
filter
(
user
=
user
,
purchased
=
0
)
total_price
=
0
total_products
=
0
for
products
in
product_list
:
product
=
json
.
loads
(
products
[
'productList'
])
prod_list
.
append
({
'purchased'
:
products
[
'purchased'
],
'price'
:
products
[
'price'
],
'aggreg_date'
:
products
[
'aggreg_date'
],
'catalog'
:
product
,
'product_id'
:
products
[
'id'
],
"process"
:
products
[
'search__process_id__name'
],
})
total_price
+=
products
[
'price'
]
total_products
+=
1
return
render
(
request
,
'show_cart.html'
,
{
'product_list'
:
prod_list
,
'total_price'
:
total_price
,
'total_products'
:
total_products
})
#-------------------------------------
def
Pay
(
request
):
Purchase
.
objects
.
filter
(
user_id
=
request
.
user
.
id
,
purchased
=
0
)
.
update
(
purchased
=
True
)
Purchase
.
objects
.
filter
(
user_id
=
request
.
user
.
id
,
purchased
=
0
)
.
update
(
purchased
=
True
)
return
redirect
(
'../../reports'
)
return
redirect
(
'../../reports'
)
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