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
6ef5c08f
Commit
6ef5c08f
authored
Apr 05, 2019
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of gitlab.geoint.mx:mario.chirinos/GeoInt_SIDT into dev
parents
00ad91b1
e0a6f684
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
27989 additions
and
258 deletions
+27989
-258
views.py
administration/views.py
+0
-1
base_top.html
catalog/templates/base_top.html
+3
-1
show_cart.html
catalog/templates/show_cart.html
+254
-235
views.py
catalog/views.py
+0
-1
Reports.css
reports/static/reports/css/Reports.css
+1
-1
ol-ext.css
reports/static/reports/css/ol-ext.css
+4102
-0
scldata.css
reports/static/reports/css/scldata.css
+55
-0
Reports_scripts.js
reports/static/reports/js/Reports_scripts.js
+0
-1
minimap.js
reports/static/reports/js/minimap.js
+136
-0
ol-ext.js
reports/static/reports/js/ol-ext.js
+23337
-0
aside.html
reports/templates/aside.html
+38
-0
sclData.html
reports/templates/sclData.html
+23
-1
views.py
reports/views.py
+40
-17
No files found.
administration/views.py
View file @
6ef5c08f
...
@@ -196,7 +196,6 @@ def wsPurchasesPM(request):
...
@@ -196,7 +196,6 @@ def wsPurchasesPM(request):
'storage'
:
storage
,
'storage'
:
storage
,
'in_process'
:
pending
.
count
(),
'in_process'
:
pending
.
count
(),
})
})
print
(
table_data
)
return
HttpResponse
(
json
.
dumps
(
table_data
))
return
HttpResponse
(
json
.
dumps
(
table_data
))
else
:
else
:
raise
Http404
raise
Http404
...
...
catalog/templates/base_top.html
View file @
6ef5c08f
...
@@ -187,9 +187,10 @@
...
@@ -187,9 +187,10 @@
{% block templates %}{% endblock %}
{% block templates %}{% endblock %}
<!-- T E M P L A T E S -->
<!-- T E M P L A T E S -->
<!-- MODAL 1 -->
<!-- MODAL 1 -->
{% block modal
1
%}{% endblock %}
{% block modal
s
%}{% endblock %}
<!-- MODAL 1 -->
<!-- MODAL 1 -->
<!-- Bootstrap 3.3.7 -->
<!-- Bootstrap 3.3.7 -->
<script
src=
"{% static 'catalog/adminlte/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"
></script>
<script
src=
"{% static 'catalog/adminlte/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"
></script>
<!-- AdminLTE App -->
<!-- AdminLTE App -->
...
@@ -199,6 +200,7 @@
...
@@ -199,6 +200,7 @@
<!-- Chartsjs -->
<!-- Chartsjs -->
<script
src=
"{% static 'catalog/js/Chart.min.js' %}"
type=
"text/javascript"
></script>
<script
src=
"{% static 'catalog/js/Chart.min.js' %}"
type=
"text/javascript"
></script>
{% block footer %}{% endblock %}
{% block scripts %}{% endblock %}
{% block scripts %}{% endblock %}
</body>
</body>
</html>
</html>
...
...
catalog/templates/show_cart.html
View file @
6ef5c08f
This diff is collapsed.
Click to expand it.
catalog/views.py
View file @
6ef5c08f
...
@@ -616,7 +616,6 @@ def Pay(request):
...
@@ -616,7 +616,6 @@ def Pay(request):
@
csrf_exempt
@
csrf_exempt
def
IPN
(
request
):
def
IPN
(
request
):
PATH_USERS
=
config
[
'PATHS'
][
'PATH_USERS'
]
PATH_USERS
=
config
[
'PATHS'
][
'PATH_USERS'
]
print
()
f
=
open
(
PATH_USERS
+
"myfile.txt"
,
"w"
)
f
=
open
(
PATH_USERS
+
"myfile.txt"
,
"w"
)
x
=
request
.
POST
.
dict
()
x
=
request
.
POST
.
dict
()
f
.
write
(
'variables'
)
f
.
write
(
'variables'
)
...
...
reports/static/reports/css/Reports.css
View file @
6ef5c08f
reports/static/reports/css/ol-ext.css
0 → 100644
View file @
6ef5c08f
This diff is collapsed.
Click to expand it.
reports/static/reports/css/scldata.css
View file @
6ef5c08f
...
@@ -162,3 +162,58 @@ input[type=range]::-webkit-slider-thumb {
...
@@ -162,3 +162,58 @@ input[type=range]::-webkit-slider-thumb {
border-radius: 100%;
border-radius: 100%;
cursor: pointer;
cursor: pointer;
} */
} */
/* Reset Select */
select
{
-webkit-appearance
:
none
;
-moz-appearance
:
none
;
-ms-appearance
:
none
;
appearance
:
none
;
outline
:
0
;
box-shadow
:
none
;
border
:
0
!important
;
background
:
#2c3e50
;
background-image
:
none
;
}
/* Custom Select */
.select
{
position
:
relative
;
display
:
block
;
width
:
9em
;
height
:
3em
;
line-height
:
3
;
background
:
#2c3e50
;
overflow
:
hidden
;
border-radius
:
.25em
;
}
select
{
width
:
100%
;
height
:
100%
;
margin
:
0
;
padding
:
0
0
0
.5em
;
color
:
#fff
;
cursor
:
pointer
;
}
select
::-ms-expand
{
display
:
none
;
}
/* Arrow */
.select
::after
{
content
:
'\25BC'
;
position
:
absolute
;
top
:
0
;
right
:
0
;
bottom
:
0
;
padding
:
0
1em
;
background
:
#34495e
;
pointer-events
:
none
;
}
/* Transition */
.select
:hover::after
{
color
:
#f39c12
;
}
.select
::after
{
-webkit-transition
:
.25s
all
ease
;
-o-transition
:
.25s
all
ease
;
transition
:
.25s
all
ease
;
}
reports/static/reports/js/Reports_scripts.js
View file @
6ef5c08f
...
@@ -65,7 +65,6 @@ $(function () {
...
@@ -65,7 +65,6 @@ $(function () {
responsive
:
true
responsive
:
true
});
});
});
});
...
...
reports/static/reports/js/minimap.js
View file @
6ef5c08f
...
@@ -114,3 +114,139 @@ function setOpacity(value) {
...
@@ -114,3 +114,139 @@ function setOpacity(value) {
}
}
})
})
}
}
// *********** Irving ******************
// Funciones de comparacion
//vigila cuando se cierra el menu de comparar y cuando se cierra desactiva la comparacion (si la clase de compare incluye menu-open está abierto)
var
compareMenu
=
document
.
getElementById
(
'compare'
);
var
observer
=
new
MutationObserver
(
function
(
mutations
)
{
mutations
.
forEach
(
function
(
mutation
)
{
if
(
mutation
.
attributeName
==
'class'
)
{
if
(
compareMenu
.
className
.
indexOf
(
"open"
)
===-
1
)
{
//se cerró el menu de comparacion
exitCompare
();
}
}
});
});
observer
.
observe
(
compareMenu
,
{
attributes
:
true
,
attributeOldValue
:
true
,
attributeFilter
:
[
'class'
],
subtree
:
true
});
//crea el control swipe, que sirve para comparar
var
ctrl
=
new
ol
.
control
.
Swipe
();
//funcion que inicia la comparacion
//recibe la lista de fechas y por default compara la primera y la ultima
function
compare
(
labels
)
{
var
swipeControl
=
false
;
map
.
getControls
().
forEach
(
function
(
control
)
{
//checa si ya se añadio el control de comparacion (swipe), si no lo tiene, lo agrega
if
(
control
instanceof
ol
.
control
.
Swipe
){
//si ya tiene el control agregado
swipeControl
=
true
;
}
});
if
(
swipeControl
==
true
)
{
//si ya tiene el comparador no hace nada, ya esta en modo comparacion
//map.removeControl(swipeControlObj);
}
else
{
//si no tiene el comparador lo agrega
//removeImageLayers();
map
.
addControl
(
ctrl
);
ctrl
.
set
(
'position'
,
0.5
);
//console.log(map.controls)
var
labelDateLeft
=
labels
[
0
]
//por default compara la primera y ultima fecha
var
labelDateRight
=
labels
[
labels
.
length
-
1
]
//pone las fechas por default en los selectores de fechas
document
.
getElementById
(
"selectLeftCompare"
).
value
=
labelDateLeft
;
document
.
getElementById
(
"selectRightCompare"
).
value
=
labelDateRight
;
//agrega las capas izquierda/derecha
selectLeft
(
labelDateLeft
);
selectRight
(
labelDateRight
);
//muestra los selectores de fechas y oculta la linea de tiempo
document
.
getElementById
(
"selectLeft"
).
style
.
display
=
"block"
;
document
.
getElementById
(
"selectRight"
).
style
.
display
=
"block"
;
document
.
getElementById
(
"timeLine"
).
style
.
display
=
"none"
;
}
}
//sale del modo comparacion
function
exitCompare
()
{
map
.
getControls
().
forEach
(
function
(
control
)
{
//checa si ya se añadio el control de comparacion (swipe)
if
(
control
instanceof
ol
.
control
.
Swipe
){
//ya tiene el control agregado lo quita
map
.
removeControl
(
control
);
}
});
//quita las capas de comparacion izquierda/derecha
var
imageLayers
=
map
.
getLayers
().
getArray
().
slice
();
imageLayers
.
forEach
(
layer
=>
{
if
(
layer
.
get
(
'name'
)
===
'left'
||
layer
.
get
(
'name'
)
===
'right'
)
{
map
.
removeLayer
(
layer
)
}
})
//oculta los selectores de fechas y muestra la linea de tiempo
document
.
getElementById
(
"selectLeft"
).
style
.
display
=
"none"
;
document
.
getElementById
(
"selectRight"
).
style
.
display
=
"none"
;
document
.
getElementById
(
"timeLine"
).
style
.
display
=
"block"
;
}
//selecciona el lado izquierdo para comparar
function
selectLeft
(
date
)
{
var
labelDateLeft
=
date
;
var
layer_type
=
'TCI'
;
const
left
=
new
ol
.
layer
.
Tile
({
name
:
'left'
,
opacity
:
1
,
source
:
new
ol
.
source
.
XYZ
({
projection
:
'EPSG:3857'
,
url
:
'/reports/tiles/'
+
purchase_id
+
'/'
+
zone
+
'/'
+
layer_type
+
'/'
+
labelDateLeft
+
'/{z}/{x}/{-y}.png'
,
tilePixelRatio
:
2
,
minZoom
:
10
,
maxZoom
:
15
})
});
map
.
addLayer
(
left
);
ctrl
.
addLayer
(
left
);
}
//selecciona el lado derecho para comparar
function
selectRight
(
date
){
var
labelDateRight
=
date
;
var
layer_type
=
'TCI'
;
const
right
=
new
ol
.
layer
.
Tile
({
name
:
'right'
,
opacity
:
1
,
source
:
new
ol
.
source
.
XYZ
({
projection
:
'EPSG:3857'
,
url
:
'/reports/tiles/'
+
purchase_id
+
'/'
+
zone
+
'/'
+
layer_type
+
'/'
+
labelDateRight
+
'/{z}/{x}/{-y}.png'
,
tilePixelRatio
:
2
,
minZoom
:
10
,
maxZoom
:
15
})
});
map
.
addLayer
(
right
);
ctrl
.
addLayer
(
right
,
true
);
}
//selecciona comparacion vertical u horizontal
function
setCompareDirection
(
direction
){
ctrl
.
set
(
'orientation'
,
direction
)
//mueve los selectores de fechas
if
(
direction
===
'horizontal'
){
document
.
getElementById
(
"selectLeft"
).
style
.
bottom
=
"70%"
;
document
.
getElementById
(
"selectLeft"
).
style
.
left
=
"15%"
;
document
.
getElementById
(
"selectRight"
).
style
.
left
=
"15%"
;
}
else
{
document
.
getElementById
(
"selectLeft"
).
style
.
bottom
=
"50px"
;
document
.
getElementById
(
"selectLeft"
).
style
.
left
=
"30%"
;
document
.
getElementById
(
"selectRight"
).
style
.
left
=
"75%"
;
}
}
// Fin funciones de comparacion
//******************************
reports/static/reports/js/ol-ext.js
0 → 100644
View file @
6ef5c08f
This diff is collapsed.
Click to expand it.
reports/templates/aside.html
View file @
6ef5c08f
...
@@ -35,6 +35,44 @@
...
@@ -35,6 +35,44 @@
<span
class=
"label label-primary pull-right"
></span>
<span
class=
"label label-primary pull-right"
></span>
</span>
</span>
</a>
</a>
<li
class=
"treeview"
id=
"compare"
>
<a
href=
"#"
onclick=
"compare(labels)"
>
<i
class=
"fas fa-columns"
></i>
<span>
Compare
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
<ul
class=
"treeview-menu sidebar-form"
id=
"compareOptions"
>
<li>
<a
class=
"treeview submenu"
href=
"#"
onclick=
"setCompareDirection('vertical')"
id=
"compvertical"
>
<i
class=
"fas fa-arrows-alt-v"
></i>
<span>
Vertical
</span>
</span>
</a>
</li>
<li>
<a
class=
"treeview submenu"
href=
"#"
onclick=
"setCompareDirection('horizontal')"
id=
"comphorizontal"
>
<i
class=
"fas fa-arrows-alt-h"
></i>
<span>
Horizontal
</span>
</span>
</a>
</li>
</ul>
</li>
<!--
<a class="treeview " href="#" onclick="compare(labels)">
<i class="fas fa-columns"></i></i>
<i class="fa fa-eye-slash hideChart" style="display:none"></i>
<span class="showChart">Compare</span>
<span class="hideChart" style="display:none">Not compare</span>
<span class="pull-right-container">
<span class="label label-primary pull-right"></span>
</span>
</a>
-->
</li>
</li>
{% endif %}
{% endif %}
<li
class=
"treeview"
>
<li
class=
"treeview"
>
...
...
reports/templates/sclData.html
View file @
6ef5c08f
...
@@ -5,12 +5,14 @@
...
@@ -5,12 +5,14 @@
<link
rel=
"stylesheet"
href=
"{% static 'catalog/css/body.css' %}"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"{% static 'catalog/css/body.css' %}"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"{% static 'reports/css/scldata.css' %}"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"{% static 'reports/css/scldata.css' %}"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"{% static 'reports/css/crossrange.css' %}"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"{% static 'reports/css/crossrange.css' %}"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"{% static 'reports/css/ol-ext.css' %}"
type=
"text/css"
>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"
></script>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"
></script>
<link
rel=
"stylesheet"
href=
"https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css"
<link
rel=
"stylesheet"
href=
"https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css"
type=
"text/css"
>
type=
"text/css"
>
<script
src=
"https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"
></script>
<script
src=
"https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"
/>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"
/>
<script
type=
"text/javascript"
src=
"https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"
></script>
<script
type=
"text/javascript"
src=
"https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"
></script>
<script
type=
"text/javascript"
src=
"{% static 'reports/js/ol-ext.js' %}"
></script>
{% endblock %}
{% endblock %}
{% block messages %}
{% block messages %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
...
@@ -117,7 +119,7 @@
...
@@ -117,7 +119,7 @@
{% block content %}
{% block content %}
<!-- Content Wrapper. Contains page content -->
<!-- Content Wrapper. Contains page content -->
<!-- Main content -->
<!-- Main content -->
<div
class=
"container floating-panel"
style=
"position:absolute
; bottom: 40px; left: 12%; width: 500px; z-index: 1000"
>
<div
id=
"timeLine"
class=
"container floating-panel slidecontainer"
style=
"position:absolute; display:block
; bottom: 40px; left: 12%; width: 500px; z-index: 1000"
>
<div
class=
"range-control"
id=
"rangecontrol"
>
<div
class=
"range-control"
id=
"rangecontrol"
>
<span
id=
"tooltiptext"
>
{{ labels|first|slice:"6:8" }}/{{ labels|first|slice:"4:6" }}/{{ labels|first|slice:"0:4" }}
</span>
<span
id=
"tooltiptext"
>
{{ labels|first|slice:"6:8" }}/{{ labels|first|slice:"4:6" }}/{{ labels|first|slice:"0:4" }}
</span>
<input
class=
"cross-range"
id=
"inputRange"
type=
"range"
min=
"0"
max=
"{{ labels|length|add:'-1' }}"
step=
"1"
value=
"0"
data-thumbwidth=
"20"
style=
"background: transparent;"
>
<input
class=
"cross-range"
id=
"inputRange"
type=
"range"
min=
"0"
max=
"{{ labels|length|add:'-1' }}"
step=
"1"
value=
"0"
data-thumbwidth=
"20"
style=
"background: transparent;"
>
...
@@ -132,6 +134,26 @@
...
@@ -132,6 +134,26 @@
</div>
</div>
</div>
</div>
<div
id=
"selectLeft"
class=
"container floating-panel"
style=
"position:absolute; display:none; bottom: 50px; left: 30%; width: 300px; z-index: 1000"
>
<div
class=
"select"
>
<select
onchange=
"selectLeft(this.value)"
id=
"selectLeftCompare"
>
{% for label in labels %}
<option
value=
"{{label}}"
>
{{ label|slice:"6:8" }}/{{ label|slice:"4:6" }}/{{label|slice:"0:4" }}
</option>
{% endfor %}
</select>
</div>
</div>
<div
id=
"selectRight"
class=
"container floating-panel"
style=
"position:absolute; display:none; bottom: 50px; left: 75%; width: 300px; z-index: 1000"
>
<div
class=
"select"
>
<select
onchange=
"selectRight(this.value)"
id=
"selectRightCompare"
>
{% for label in labels %}
<option
value=
"{{label}}"
>
{{ label|slice:"6:8" }}/{{ label|slice:"4:6" }}/{{label|slice:"0:4" }}
</option>
{% endfor %}
</select>
</div>
</div>
<div
id=
"reportPage"
class=
"wrapper"
style=
"background-color: #ecf0f5"
>
<div
id=
"reportPage"
class=
"wrapper"
style=
"background-color: #ecf0f5"
>
<div
id=
"minimap"
class=
"minimap"
></div>
<div
id=
"minimap"
class=
"minimap"
></div>
...
...
reports/views.py
View file @
6ef5c08f
...
@@ -16,6 +16,7 @@ from reportlab.pdfgen import canvas
...
@@ -16,6 +16,7 @@ from reportlab.pdfgen import canvas
from
django.views.decorators.csrf
import
csrf_exempt
from
django.views.decorators.csrf
import
csrf_exempt
from
GeoInt_SIDT.settings
import
BASE_URL
from
GeoInt_SIDT.settings
import
BASE_URL
from
administration.views
import
best_unit_size
from
catalog.models
import
Purchase
from
catalog.models
import
Purchase
from
reportlab.pdfgen.canvas
import
Canvas
from
reportlab.pdfgen.canvas
import
Canvas
...
@@ -64,10 +65,7 @@ def report_L2ASCL(request, purchase_id):
...
@@ -64,10 +65,7 @@ def report_L2ASCL(request, purchase_id):
image_path
=
email
+
"/"
+
purchase_id
+
"/"
+
"out/"
+
reporteDir
+
"/TCI/thumbnails/"
image_path
=
email
+
"/"
+
purchase_id
+
"/"
+
"out/"
+
reporteDir
+
"/TCI/thumbnails/"
SCL_path
=
email
+
"/"
+
purchase_id
+
"/"
+
"out/"
+
reporteDir
+
"/SCL/"
SCL_path
=
email
+
"/"
+
purchase_id
+
"/"
+
"out/"
+
reporteDir
+
"/SCL/"
if
os
.
path
.
exists
(
path
+
reporteDir
+
".pdf"
):
print
(
"si existe"
)
else
:
PDFGenerator
(
request
,
path
,
reporteDir
,
datasets
)
searchInfo
=
{
searchInfo
=
{
"title"
:
purchase
[
'name'
],
"title"
:
purchase
[
'name'
],
...
@@ -82,6 +80,11 @@ def report_L2ASCL(request, purchase_id):
...
@@ -82,6 +80,11 @@ def report_L2ASCL(request, purchase_id):
"report_name"
:
"SCL Image Classification Data(Km²)"
"report_name"
:
"SCL Image Classification Data(Km²)"
}
}
if
os
.
path
.
exists
(
path
+
reporteDir
+
".pdf"
):
print
(
"si existe"
)
else
:
PDFGenerator
(
request
,
path
,
reporteDir
,
datasets
,
searchInfo
)
return
render
(
request
,
template
,
{
"graphData"
:
json
.
dumps
(
graphData
),
return
render
(
request
,
template
,
{
"graphData"
:
json
.
dumps
(
graphData
),
"searchInfo"
:
searchInfo
,
"IMAGE_PATH"
:
image_path
,
"searchInfo"
:
searchInfo
,
"IMAGE_PATH"
:
image_path
,
"SCL_PATH"
:
SCL_path
,
'dafaultLabel'
:
defaultLabel
,
"SCL_PATH"
:
SCL_path
,
'dafaultLabel'
:
defaultLabel
,
...
@@ -133,11 +136,10 @@ def Reports(request):
...
@@ -133,11 +136,10 @@ def Reports(request):
for
p
in
json
.
loads
(
producto
[
'productList'
]):
for
p
in
json
.
loads
(
producto
[
'productList'
]):
size
=
size
+
float
(
p
[
'info'
][
'size'
][:
-
3
])
size
=
size
+
float
(
p
[
'info'
][
'size'
][:
-
3
])
if
size
>
1000
:
size2
=
size
/
1000
size
=
size
*
1048576
final_size
=
str
(
round
(
size2
,
2
))
+
" GB"
final_size
=
best_unit_size
(
size
)
else
:
final_size
=
str
(
round
(
size
,
2
))
+
" MB"
initial_folder
=
"."
initial_folder
=
"."
absolute_path
=
USERS_PATH
+
request
.
user
.
email
+
"/"
+
str
(
producto
[
'id'
])
+
"/"
absolute_path
=
USERS_PATH
+
request
.
user
.
email
+
"/"
+
str
(
producto
[
'id'
])
+
"/"
...
@@ -448,31 +450,52 @@ def myBarLegend(drawing, labels):
...
@@ -448,31 +450,52 @@ def myBarLegend(drawing, labels):
return
d
return
d
def
PDFGenerator
(
request
,
ruta
,
reporteDir
,
datasets
):
def
PDFGenerator
(
request
,
ruta
,
reporteDir
,
datasets
,
searchInfo
):
thumbs
=
ruta
+
'out/'
+
reporteDir
+
'/TCI/thumbnails/'
thumbs
=
ruta
+
'out/'
+
reporteDir
+
'/TCI/thumbnails/'
SCL
=
ruta
+
'out/'
+
reporteDir
+
'/SCL/split/'
SCL
=
ruta
+
'out/'
+
reporteDir
+
'/SCL/split/'
story
=
[]
story
=
[]
#story.append(tileinfo("hola"))
# define the style for our paragraph text
# define the style for our paragraph text
styles
=
getSampleStyleSheet
()
styles
=
getSampleStyleSheet
()
styles2
=
getSampleStyleSheet
()
styleN
=
styles
[
'Normal'
]
styleN
=
styles
[
'Normal'
]
styleN
.
alignment
=
1
styleN
.
fontSize
=
25
style2
=
styles2
[
'Normal'
]
style2
.
alignment
=
1
style2
.
fontSize
=
15
# Header
# Header
im
=
Image
(
USERS_PATH
+
'header.png'
,
width
=
300
,
height
=
70
)
im
=
Image
(
USERS_PATH
+
'header.png'
,
width
=
300
,
height
=
70
)
im
.
hAlign
=
'CENTER'
im
.
hAlign
=
'CENTER'
story
.
append
(
im
)
story
.
append
(
im
)
story
.
append
(
Spacer
(
1
,
1.5
*
inch
))
# add the title
# add the title
# story.append(Paragraph("<strong>Results for Vizard Experiment</strong>", styleN))
story
.
append
(
Paragraph
(
"<strong>"
+
searchInfo
[
'report_name'
]
+
"</strong>"
,
styleN
,))
# story.append(Spacer(1, .25 * inch))
story
.
append
(
Spacer
(
1
,
.60
*
inch
))
story
.
append
(
Paragraph
(
"<strong>"
+
searchInfo
[
'title'
]
+
"</strong>"
,
styleN
,))
story
.
append
(
Spacer
(
1
,
.40
*
inch
))
story
.
append
(
Paragraph
(
"<strong>("
+
searchInfo
[
'startDate'
]
+
" - "
+
searchInfo
[
'endDate'
]
+
")</strong>"
,
style2
,))
story
.
append
(
Spacer
(
1
,
.60
*
inch
))
story
.
append
(
Paragraph
(
"<strong>Platform: "
+
searchInfo
[
'platform'
]
+
"</strong>"
,
style2
,))
story
.
append
(
Spacer
(
1
,
.40
*
inch
))
story
.
append
(
Paragraph
(
"<strong>Product level: "
+
searchInfo
[
'productLevel'
]
+
"</strong>"
,
style2
,))
story
.
append
(
Spacer
(
1
,
.40
*
inch
))
story
.
append
(
Paragraph
(
"<strong>Process:"
+
searchInfo
[
'process'
]
+
"</strong>"
,
style2
,))
story
.
append
(
Spacer
(
1
,
.40
*
inch
))
story
.
append
(
Paragraph
(
"<strong>Clouds: "
+
str
(
searchInfo
[
'clouds'
])
+
"
%
</strong>"
,
style2
,))
story
.
append
(
Spacer
(
1
,
.40
*
inch
))
# convert data to paragraph form and then add paragraphs
# convert data to paragraph form and then add paragraphs
#
story.append(Paragraph(dataToParagraph(subject1, results1), styleN))
#story.append(Paragraph(dataToParagraph(subject1, results1), styleN))
#
story.append(Spacer(1, .25 * inch))
#story.append(Spacer(1, .25 * inch))
#
story.append(Paragraph(dataToParagraph(subject2, results2), styleN))
#story.append(Paragraph(dataToParagraph(subject2, results2), styleN))
#
story.append(Spacer(1, .5 * inch))
#story.append(Spacer(1, .5 * inch))
story
.
append
(
PageBreak
())
story
.
append
(
PageBreak
())
...
...
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