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
77a4b38f
Commit
77a4b38f
authored
Feb 07, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reportes2
parent
4cccc390
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
429 additions
and
260 deletions
+429
-260
map.html
catalog/templates/map.html
+45
-75
show_cart.html
catalog/templates/show_cart.html
+41
-68
user_button.html
catalog/templates/user_button.html
+52
-0
views.py
catalog/views.py
+4
-1
L2ASCL_data.html
reports/templates/L2ASCL_data.html
+42
-108
Reports.html
reports/templates/Reports.html
+214
-0
urls.py
reports/urls.py
+2
-1
views.py
reports/views.py
+29
-7
No files found.
catalog/templates/map.html
View file @
77a4b38f
...
...
@@ -212,84 +212,54 @@
{% endblock %}
{% block user %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-user"
></i>
<!--<img src="dist/img/user2-160x160.jpg" class="user-image" alt="User Image">-->
<!--<span class="hidden-xs">Alexander Pierce</span>-->
{% include "user_button.html" %}
{% endblock %}
{% block content %}
<div
id=
"map"
class=
"map"
tabindex=
"0"
></div>
<footer
class=
" page-footer font-small special-color-dark pt-5"
style=
"bottom: 0; position: absolute"
>
<!-- Footer Elements -->
<div
class=
"container"
>
<!-- Social buttons
<ul class="list-unstyled list-inline text-center">
<li class="list-inline-item">
<a class="btn-floating btn-fb mx-1">
<i class="fa fa-faceboo"> </i>
</a>
<ul
class=
"dropdown-menu"
>
<!-- User image -->
<li
class=
"user-header"
>
<!--<img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">-->
<p>
{{ user.get_full_name }}
<small>
{{ user.get_username }}
</small>
</p>
</li>
<!-- Menu Body -->
<!--<li class="user-body">-->
<!--</li>-->
<!-- Menu Footer-->
<li
class=
"user-footer"
>
<div
class=
"pull-left"
>
<a
href=
"#"
class=
"btn btn-default btn-flat"
>
Profile
</a>
</div>
<div
class=
"pull-right"
>
<a
href=
"{% url 'logout' %}?next={{ request.path }}"
class=
"btn btn-default btn-flat"
>
Sign out
</a>
</div>
<li class="list-inline-item">
<a class="btn-floating btn-tw mx-1">
<i class="fa fa-twitter"> </i>
</a>
</li>
</ul>
{% endblock %}
{% block history %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-history"
></i>
<li class="list-inline-item">
<a class="btn-floating btn-gplus mx-1">
<i class="fa fa-google-plus"> </i>
</a>
<ul
class=
"dropdown-menu"
>
<!-- User image -->
<li
class=
"user-header"
>
<p>
Historial de compras
</p>
</li>
<div
class=
"form-group"
>
<br>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<!-- History element -->
<li>
<a
class=
"treeview "
href=
"../reports/T15QZD_sclData"
>
<i
class=
"fa fa-line-chart"
></i>
<span>
Report #
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
<li class="list-inline-item">
<a class="btn-floating btn-li mx-1">
<i class="fa fa-linkedin"> </i>
</a>
</li>
<!-- End History element -->
<!-- History element -->
<li>
<a
class=
"treeview "
href=
"../reports/T16QBJ_sclData"
>
<i
class=
"fa fa-line-chart"
></i>
<span>
Report #
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
<li class="list-inline-item">
<a class="btn-floating btn-dribbble mx-1">
<i class="fa fa-dribbble"> </i>
</a>
</li>
<!-- End History element -->
</ul>
<!-- Social buttons -->
</div>
</ul>
{% endblock %}
<!-- Footer Elements -->
{% block content %}
<div
id=
"map"
class=
"map"
tabindex=
"0"
></div>
<footer
class=
"my-footer"
>
<strong>
<a
href=
"http://www.centrogeo.org.mx/"
>
© 2018 Centro de Investigación en Ciencias de Información
Geoespacial
</a>
</strong>
</footer>
<!-- Copyright -->
<div
class=
"footer-copyright text-center py-3"
>
© 2018 Copyright:
<a
href=
"http://geoint.mx/"
>
Centro de Investigación en Ciencias de Información Geoespacial.
</a>
</div>
<!-- Copyright -->
</footer>
<div
class=
"waitingModal"
></div>
{% endblock %}
...
...
@@ -311,7 +281,7 @@
document
.
getElementById
(
'id_end'
).
value
=
ano
+
"-"
+
mes
+
"-"
+
dia
;
var
dia_anterior
=
fecha
.
getDate
()
-
d
;
var
mes_anterior
=
fecha
.
getMonth
()
+
1
;
<
div
class
=
"modal"
><!--
Place
at
bottom
of
page
--><
/div
>
var
mes_anterior
=
fecha
.
getMonth
()
+
1
;
var
ano_anterior
=
fecha
.
getFullYear
();
//Condición donde el día anterior cae en un mes anterior
...
...
catalog/templates/show_cart.html
View file @
77a4b38f
...
...
@@ -128,34 +128,7 @@
<!-- form-group-->
{% endblock %}
{% block user %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-user"
></i>
<!--<img src="dist/img/user2-160x160.jpg" class="user-image" alt="User Image">-->
<!--<span class="hidden-xs">Alexander Pierce</span>-->
</a>
<ul
class=
"dropdown-menu"
>
<!-- User image -->
<li
class=
"user-header"
>
<!--<img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">-->
<p>
{{ user.get_full_name }}
<small>
{{ user.get_username }}
</small>
</p>
</li>
<!-- Menu Body -->
<!--<li class="user-body">-->
<!--</li>-->
<!-- Menu Footer-->
<li
class=
"user-footer"
>
<div
class=
"pull-left"
>
<a
href=
"#"
class=
"btn btn-default btn-flat"
>
Profile
</a>
</div>
<div
class=
"pull-right"
>
<a
href=
"{% url 'logout' %}?next={{ request.path }}"
class=
"btn btn-default btn-flat"
>
Sign out
</a>
</div>
</li>
</ul>
{% include "user_button.html" %}
{% endblock %}
{% block content %}
<!-- Content Wrapper. Contains page content -->
...
...
@@ -233,7 +206,7 @@
<!-- /.content -->
</div>
<!-- Footer -->
<footer
class=
" page-footer font-small special-color-dark pt-5"
>
<footer
class=
" page-footer font-small special-color-dark pt-5"
style=
"bottom: 0; position: absolute"
>
<!-- Footer Elements -->
<div
class=
"container"
>
<!-- Social buttons
...
...
@@ -275,7 +248,7 @@
</div>
<!-- Copyright -->
</footer>
</footer>
<!-- Footer -->
<!-- /.content -->
...
...
catalog/templates/user_button.html
0 → 100644
View file @
77a4b38f
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-user"
></i>
<!--<img src="dist/img/user2-160x160.jpg" class="user-image" alt="User Image">-->
<!--<span class="hidden-xs">Alexander Pierce</span>-->
</a>
<ul
class=
"dropdown-menu"
>
<!-- User image -->
<li
class=
"user-header"
>
<!--<img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">-->
<p>
{{ user.get_full_name }}
<small>
{{ user.get_username }}
</small>
</p>
</li>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<!-- History element -->
<li>
<a
class=
"treeview "
href=
"#"
>
<i
class=
"fa fa-user-circle"
></i>
<span>
Profile
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
</li>
<!-- End History element -->
<!-- History element -->
<li>
<a
class=
"treeview "
href=
"{{ BASE_URL }}/reports"
>
<i
class=
"fa fa-history"
></i>
<span>
Shopping History
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
</li>
<li>
<a
class=
"treeview "
href=
"{% url 'logout' %}?next={{ request.path }}"
>
<i
class=
"fa fa-sign-out"
></i>
<span>
Sign Out
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
</li>
<!-- End History element -->
</ul>
<!-- Menu Body -->
<!--<li class="user-body">-->
<!--</li>-->
<!-- Menu Footer-->
</ul>
\ No newline at end of file
catalog/views.py
View file @
77a4b38f
...
...
@@ -19,7 +19,10 @@ sys.path.append('/home/luis/django-apps/Geosentinel')
from
geosentinel
import
APISentinel
,
polygonToBox
sentinel
=
APISentinel
.
APISentinel
(
'emmhp'
,
'geoemm29'
)
NAS_PATH
=
'/home/david/NAS/'
################################################################################
# PONER EL NOMBRE DE SU MAQUINA #
################################################################################
NAS_PATH
=
'/home/ulises/NAS/'
# Create your views here.
...
...
reports/templates/L2ASCL_data.html
View file @
77a4b38f
...
...
@@ -232,75 +232,9 @@
<!-- form-group-->
{% endblock %}
{% block user %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-user"
></i>
<!--<img src="dist/img/user2-160x160.jpg" class="user-image" alt="User Image">-->
<!--<span class="hidden-xs">Alexander Pierce</span>-->
</a>
<ul
class=
"dropdown-menu"
>
<!-- User image -->
<li
class=
"user-header"
>
<!--<img src="dist/img/user2-160x160.jpg" class="img-circle" alt="User Image">-->
<p>
{{ user.get_full_name }}
<small>
{{ user.get_username }}
</small>
</p>
</li>
<!-- Menu Body -->
<!--<li class="user-body">-->
<!--</li>-->
<!-- Menu Footer-->
<li
class=
"user-footer"
>
<div
class=
"pull-left"
>
<a
href=
"#"
class=
"btn btn-default btn-flat"
>
Profile
</a>
</div>
<div
class=
"pull-right"
>
<a
href=
"{% url 'logout' %}?next={{ request.path }}"
class=
"btn btn-default btn-flat"
>
Sign out
</a>
</div>
</li>
</ul>
{% endblock %}
{% block history %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-history"
></i>
</a>
<ul
class=
"dropdown-menu"
>
<!-- User image -->
<li
class=
"user-header"
>
<p>
Historial de compras
</p>
</li>
<div
class=
"form-group"
>
<br>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<!-- History element -->
<li>
<a
class=
"treeview "
href=
"{{ BASE_URL }}/reports/T15QZD_sclData"
>
<i
class=
"fa fa-line-chart"
></i>
<span>
Report #
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
</li>
<!-- End History element -->
<!-- History element -->
<li>
<a
class=
"treeview "
href=
"{{ BASE_URL }}/reports/T16QBJ_sclData"
>
<i
class=
"fa fa-line-chart"
></i>
<span>
Report #
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
</li>
<!-- End History element -->
</ul>
</div>
</ul>
{% include "user_button.html" %}
{% endblock %}
{% block content %}
<!-- Content Wrapper. Contains page content -->
<!-- Main content -->
...
...
@@ -367,7 +301,7 @@
<!-- /.content -->
</div>
<!-- Footer -->
<footer
class=
" page-footer font-small special-color-dark pt-5"
>
<footer
class=
" page-footer font-small special-color-dark pt-5"
style=
"bottom: 0; position: absolute"
>
<!-- Footer Elements -->
<div
class=
"container"
>
<!-- Social buttons
...
...
@@ -409,7 +343,7 @@
</div>
<!-- Copyright -->
</footer>
</footer>
<!-- Footer -->
<!-- /.content -->
...
...
reports/templates/Reports.html
0 → 100644
View file @
77a4b38f
{% extends "base_top.html" %}
{% load staticfiles %}
{% block headMedia %}
<link
rel=
"stylesheet"
href=
"{% static 'catalog/css/body.css' %}"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"https://unpkg.com/bootstrap-table@1.13.4/dist/bootstrap-table.min.css"
>
<script
src=
"https://unpkg.com/bootstrap-table@1.13.4/dist/bootstrap-table.min.js"
></script>
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/core-js/2.6.2/core.min.js"
></script>
{% endblock %}
{% block messages %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-envelope-o"
></i>
<span
class=
"label label-success"
>
4
</span>
</a>
<ul
class=
"dropdown-menu"
>
<li
class=
"header"
>
You have 4 messages
</li>
<li>
<!-- inner menu: contains the actual data -->
<ul
class=
"menu"
>
<li>
<!-- start message -->
<a
href=
"#"
>
<div
class=
"pull-left"
>
<img
src=
"dist/img/user2-160x160.jpg"
class=
"img-circle"
alt=
"User Image"
>
</div>
<h4>
Support Team
<small><i
class=
"fa fa-clock-o"
></i>
5 mins
</small>
</h4>
<p>
Why not buy a new awesome theme?
</p>
</a>
</li>
<!-- end message -->
<li>
<a
href=
"#"
>
<div
class=
"pull-left"
>
<img
src=
"dist/img/user3-128x128.jpg"
class=
"img-circle"
alt=
"User Image"
>
</div>
<h4>
AdminLTE Design Team
<small><i
class=
"fa fa-clock-o"
></i>
2 hours
</small>
</h4>
<p>
Why not buy a new awesome theme?
</p>
</a>
</li>
</ul>
</li>
<li
class=
"footer"
><a
href=
"#"
>
See All Messages
</a></li>
</ul>
{% endblock %}
{% block notifications %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-bell-o"
></i>
<span
class=
"label label-warning"
>
10
</span>
</a>
<ul
class=
"dropdown-menu"
>
<li
class=
"header"
>
You have 10 notifications
</li>
<li>
<!-- inner menu: contains the actual data -->
<ul
class=
"menu"
>
<li>
<a
href=
"#"
>
<i
class=
"fa fa-users text-aqua"
></i>
5 new members joined today
</a>
</li>
</li>
</ul>
</li>
<li
class=
"footer"
><a
href=
"#"
>
View all
</a></li>
</ul>
{% endblock %}
{% block tasks %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-flag-o"
></i>
<span
class=
"label label-danger"
>
9
</span>
</a>
<ul
c
{%
load
static
%}
lass=
"dropdown-menu"
>
<li
class=
"header"
>
You have 9 tasks
</li>
<li>
<!-- inner menu: contains the actual data -->
<ul
class=
"menu"
>
<li>
<!-- Task item -->
<a
href=
"#"
>
<h3>
Design some buttons
<small
class=
"pull-right"
>
20%
</small>
</h3>
<div
class=
"progress xs"
>
<div
class=
"progress-bar progress-bar-aqua"
style=
"width: 20%"
role=
"progressbar"
aria-valuenow=
"20"
aria-valuemin=
"0"
aria-valuemax=
"100"
>
<span
class=
"sr-only"
>
20% Complete
</span>
</div>
</div>
</a>
</li>
<!-- end task item -->
</ul>
</li>
<li
class=
"footer"
>
<a
href=
"#"
>
View all tasks
</a>
</li>
</ul>
{% endblock %}
{% block sidebar %}
<div
class=
"form-group"
>
<br>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<li>
<a
class=
"treeview "
href=
"{{ BASE_URL }}/catalog"
>
<i
class=
"fa fa-map"
></i>
<span>
Home
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
</li>
</ul>
</div>
<!-- form-group-->
{% endblock %}
{% block user %}
{% include "user_button.html" %}
{% endblock %}
{% block content %}
<!-- Content Wrapper. Contains page content -->
<!-- Main content -->
<div
id=
"reportPage"
class=
"wrapper"
style=
"background-color: #ecf0f5"
>
<!-- Content Wrapper. Contains page content -->
<!-- Main content -->
<section
class=
"content"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
Reports
</div>
<div
class=
"panel-body"
>
<table
data-toggle=
"table"
class=
"table table-hover table-bordered"
>
<thead>
<th>
Process
</th>
<th>
Purchase date
</th>
<th>
Start Date
</th>
<th>
End Date
</th>
<th>
Clouds %
</th>
<th>
Size
</th>
<th>
Actions
</th>
</thead>
<tbody>
{% for product in productList %}
<tr>
<td>
{{product.process}}
</td>
<td>
{{product.purchase_date}}
</td>
<td>
{{product.startDate}}
</td>
<td>
{{product.endDate}}
</td>
<td>
{{product.clouds}} %
</td>
<td>
{{product.size}} MB
</td>
<td><a
href=
"{{ BASE_URL }}/reports/T15QZD_sclData/{{product.purchase_id}}"
class=
"btn btn-success"
><i
class=
"fa fa-eye"
></i></a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</section>
<!-- /.content -->
</div>
<!-- Footer -->
<footer
class=
" page-footer font-small special-color-dark pt-5"
style=
"bottom: 0; position: absolute"
>
<!-- Footer Elements -->
<div
class=
"container"
>
<!-- Social buttons
<ul class="list-unstyled list-inline text-center">
<li class="list-inline-item">
<a class="btn-floating btn-fb mx-1">
<i class="fa fa-faceboo"> </i>
</a>
</li>
<li class="list-inline-item">
<a class="btn-floating btn-tw mx-1">
<i class="fa fa-twitter"> </i>
</a>
</li>
<li class="list-inline-item">
<a class="btn-floating btn-gplus mx-1">
<i class="fa fa-google-plus"> </i>
</a>
</li>
<li class="list-inline-item">
<a class="btn-floating btn-li mx-1">
<i class="fa fa-linkedin"> </i>
</a>
</li>
<li class="list-inline-item">
<a class="btn-floating btn-dribbble mx-1">
<i class="fa fa-dribbble"> </i>
</a>
</li>
</ul>
<!-- Social buttons -->
</div>
<!-- Footer Elements -->
<!-- Copyright -->
<div
class=
"footer-copyright text-center py-3"
>
© 2018 Copyright:
<a
href=
"http://geoint.mx/"
>
Centro de Investigación en Ciencias de Información Geoespacial.
</a>
</div>
<!-- Copyright -->
</footer>
<!-- Footer -->
<!-- /.content -->
{% endblock %}
{% block scripts %}
{% endblock%}
\ No newline at end of file
reports/urls.py
View file @
77a4b38f
...
...
@@ -5,6 +5,7 @@ from reports import views
urlpatterns
=
[
url
(
r'^(?P<report>[\w\-]+)/$'
,
views
.
report_L2ASCL
,
name
=
'report'
),
url
(
r'^(?P<report>[\w\-]+)/(?P<purchase_id>(\d+))$'
,
views
.
report_L2ASCL
,
name
=
'report'
),
url
(
r'^$'
,
views
.
Reports
,
name
=
'reports'
),
]
reports/views.py
View file @
77a4b38f
...
...
@@ -10,15 +10,18 @@ from django.shortcuts import render
from
collections
import
OrderedDict
import
json
# -------------------------------------------------------------------------------
from
reportlab.pdfgen
import
canvas
from
GeoInt_SIDT
import
settings
from
catalog.models
import
CartProduct
,
Purchase
,
Search
def
report_L2ASCL
(
request
,
report
):
with
open
(
"/home/emmanuelhp/NAS/mario_repsat_test/"
+
report
+
".json"
)
as
f
:
def
report_L2ASCL
(
request
,
report
,
purchase_id
):
################################################################################
# PONER EL NOMBRE DE SU MAQUINA #
################################################################################
with
open
(
"/home/ulises/NAS/repsat_test_dev/"
+
request
.
user
.
email
+
"/"
+
purchase_id
+
"/"
+
report
+
".json"
)
as
f
:
json_data
=
OrderedDict
(
json
.
load
(
f
))
graphData
=
dict
()
graphData
[
'type'
]
=
"line"
...
...
@@ -49,10 +52,29 @@ def report_L2ASCL(request, report):
data
[
'datasets'
]
.
sort
(
key
=
lambda
k
:
max
(
k
[
'data'
]))
graphData
[
'data'
]
=
data
#print(settings.BASE_URL)
#
print(settings.BASE_URL)
# graphData['options']['responsive']=True
# graphData['options']['maintainAspectRatio']=False
#print(json.dumps(graphData).encode("utf-8"))
#
print(json.dumps(graphData).encode("utf-8"))
return
render
(
request
,
'L2ASCL_data.html'
,
{
"graphData"
:
json
.
dumps
(
graphData
),
"report_name"
:
report
})
# -------------------------------------------------------------------------------
# -------------------------------------------------------------------------------def Reports(request):
def
Reports
(
request
):
productList
=
[]
product_list
=
Purchase
.
objects
.
values
(
'id'
,
'productList'
,
'aggreg_date'
,
'search__clouds'
,
'search__startDate'
,
'search__endDate'
)
.
filter
(
user_id
=
request
.
user
.
id
,
purchased
=
1
)
for
producto
in
product_list
:
size
=
0
for
p
in
json
.
loads
(
producto
[
'productList'
]):
size
=
size
+
float
(
p
[
'info'
][
'size'
][:
-
3
])
productList
.
append
({
"purchase_date"
:
producto
[
'aggreg_date'
],
"startDate"
:
producto
[
'search__startDate'
],
"endDate"
:
producto
[
'search__endDate'
],
"clouds"
:
producto
[
'search__clouds'
],
"size"
:
size
,
"purchase_id"
:
producto
[
'id'
],
})
return
render
(
request
,
'Reports.html'
,
{
"productList"
:
productList
})
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