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
a3a9c241
Commit
a3a9c241
authored
Apr 11, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pdf con scl
parent
fb432ee0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
Platform.html
administration/templates/Platform.html
+6
-0
views.py
reports/views.py
+20
-6
No files found.
administration/templates/Platform.html
View file @
a3a9c241
...
@@ -121,6 +121,12 @@
...
@@ -121,6 +121,12 @@
<div
class=
"panel panel-default"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
{{ Viewname }}
</div>
<div
class=
"panel-heading"
>
{{ Viewname }}
</div>
<div
class=
"panel-body text-center"
>
<div
class=
"panel-body text-center"
>
<div
class=
"row col-md-1 pull-right "
>
<a
class=
"btn btn-success btn-sm col-md-6 col-sm-6 col-xs-6 col-lg-6 col-xl-6"
>
New
</a>
<br>
<br>
</div>
<table
data-toggle=
"table"
id=
"example"
class=
"table table-striped table-bordered"
<table
data-toggle=
"table"
id=
"example"
class=
"table table-striped table-bordered"
style=
"width:100%"
>
style=
"width:100%"
>
<thead>
<thead>
...
...
reports/views.py
View file @
a3a9c241
...
@@ -19,17 +19,17 @@ from GeoInt_SIDT.settings import BASE_URL
...
@@ -19,17 +19,17 @@ from GeoInt_SIDT.settings import BASE_URL
from
administration.views
import
best_unit_size
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.lib.pagesizes
import
letter
from
reportlab.lib.pagesizes
import
letter
from
reportlab.lib.styles
import
getSampleStyleSheet
from
reportlab.lib.styles
import
getSampleStyleSheet
from
reportlab.lib.units
import
inch
from
reportlab.lib.units
import
inch
from
reportlab.lib
import
colors
from
reportlab.lib
import
colors
from
reportlab.platypus
import
Paragraph
,
Frame
,
Spacer
,
Image
,
Table
,
TableStyle
,
SimpleDocTemplate
,
PageBreak
from
reportlab.platypus
import
Paragraph
,
Frame
,
Spacer
,
Image
,
Table
,
TableStyle
,
SimpleDocTemplate
,
PageBreak
from
reportlab.graphics.charts.barcharts
import
VerticalBarChart
from
reportlab.graphics.charts.barcharts
import
VerticalBarChart
from
reportlab.graphics.shapes
import
Drawing
,
String
from
reportlab.graphics.shapes
import
Drawing
from
reportlab.graphics.charts.textlabels
import
Label
,
LabelOffset
from
reportlab.graphics.charts.legends
import
Legend
from
reportlab.graphics.charts.legends
import
Legend
# -------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
########### lee archivo de configuración ################
########### lee archivo de configuración ################
...
@@ -334,6 +334,19 @@ def dataToTable(name, data):
...
@@ -334,6 +334,19 @@ def dataToTable(name, data):
data
.
insert
(
0
,
name
)
data
.
insert
(
0
,
name
)
return
data
return
data
def
mergeimages
(
path
,
file
):
from
PIL
import
Image
layer1
=
Image
.
open
(
path
+
file
[:
8
]
+
"_SCL_60m_0.tif"
)
for
i
in
range
(
10
):
print
(
file
[:
8
]
+
"_SCL_60m_"
+
str
(
i
)
+
".tif"
)
layer2
=
Image
.
open
(
path
+
file
[:
8
]
+
"_SCL_60m_"
+
str
(
i
)
+
".tif"
)
nueva
=
Image
.
alpha_composite
(
layer1
,
layer2
)
layer1
=
nueva
nueva
.
save
(
path
+
file
[:
8
]
+
"_SCL_60m_10.tif"
)
return
path
+
file
[:
8
]
+
"_SCL_60m_10.tif"
# create the table for our document
# create the table for our document
def
myTable
(
path1
,
path2
,
basefile
):
def
myTable
(
path1
,
path2
,
basefile
):
...
@@ -351,8 +364,10 @@ def myTable(path1, path2, basefile):
...
@@ -351,8 +364,10 @@ def myTable(path1, path2, basefile):
if
file
.
startswith
(
basefile
[:
8
]):
if
file
.
startswith
(
basefile
[:
8
]):
if
file
.
endswith
(
'.tif'
)
and
not
file
.
endswith
(
'0.tif'
):
if
file
.
endswith
(
'.tif'
)
and
not
file
.
endswith
(
'0.tif'
):
# image2 = Image(path2 + file, height=300, width=200, mask='auto')
if
image1
.
imageWidth
<
image1
.
imageHeight
:
image3
=
image2
image3
=
Image
(
mergeimages
(
path2
,
file
),
height
=
300
,
width
=
200
,
mask
=
'auto'
)
else
:
image3
=
Image
(
mergeimages
(
path2
,
file
),
height
=
150
,
width
=
400
,
mask
=
'auto'
)
if
image1
.
imageWidth
<
image1
.
imageHeight
:
if
image1
.
imageWidth
<
image1
.
imageHeight
:
data
=
[[
'TCI'
,
'SCL'
],
[
image2
,
image3
]]
data
=
[[
'TCI'
,
'SCL'
],
[
image2
,
image3
]]
...
@@ -622,7 +637,6 @@ def wsEditTitle(request):
...
@@ -622,7 +637,6 @@ def wsEditTitle(request):
purchase
.
name
=
request
.
GET
.
get
(
"zone"
)
purchase
.
name
=
request
.
GET
.
get
(
"zone"
)
purchase
.
description
=
request
.
GET
.
get
(
"description"
)
purchase
.
description
=
request
.
GET
.
get
(
"description"
)
purchase
.
save
()
purchase
.
save
()
print
(
"hola"
)
return
HttpResponse
(
"hola"
)
return
HttpResponse
(
"hola"
)
else
:
else
:
raise
Http404
raise
Http404
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