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
415d4503
Commit
415d4503
authored
Feb 21, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parchado de errores
parent
7e5946ec
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
30 deletions
+14
-30
base_top.html
catalog/templates/base_top.html
+1
-1
L2ASCL_data.html
reports/templates/L2ASCL_data.html
+13
-29
No files found.
catalog/templates/base_top.html
View file @
415d4503
...
...
@@ -48,7 +48,7 @@
<ul
class=
"nav navbar-nav"
>
<li>
{% if request.user.is_superuser %}
<a
id=
"product-list-toggle"
href=
"
../administration"
title=
"super user"
><i
<a
href=
"../../
../administration"
title=
"super user"
><i
class=
"fa fa-gears"
></i></a>
{% endif %}
</li>
...
...
reports/templates/L2ASCL_data.html
View file @
415d4503
...
...
@@ -2,22 +2,12 @@
{% load staticfiles %}
{% block headMedia %}
<link
rel=
"stylesheet"
href=
"{% static 'catalog/css/map.css' %}"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"{% static 'catalog/css/body.css' %}"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"{% static 'catalog/css/modal1.css' %}"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"{% static 'reports/css/scldata.css' %}"
type=
"text/css"
>
<!-- <link rel="stylesheet" href="https://openlayers.org/en/v4.6.4/css/ol.css" type="text/css">-->
<link
rel=
"stylesheet"
href=
"https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css"
>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"
></script>
<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
src=
"https://cdn.polyfill.io/v2/polyfill.min.js?features=requestAnimationFrame,Element.prototype.classList,URL"
></script>
<!-- <script src="https://openlayers.org/en/v4.6.4/build/ol.js"></script>-->
<script
src=
"https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"
></script>
<script
src=
"{% static 'catalog/js/openLayers4.js' %}"
></script>
<script
src=
"{% static 'catalog/js/sidtMap.js' %}"
></script>
{% endblock %}
{% block messages %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
...
...
@@ -545,54 +535,48 @@
};
// Transformar canvas a pdf
$
(
'#downloadPdf'
).
click
(
function
(
event
)
{
//
obtener el tamaño de la pá
gina
//
tomar el tamaño de la pa
gina
var
reportPageHeight
=
$
(
'#reportPage'
).
innerHeight
();
var
reportPageWidth
=
$
(
'#reportPage'
).
innerWidth
();
//
Creamos un nuevo canvas
que rellenaremos con todos los demás canvas
// que rellenaremos con todos los demás canvas
var
pdfCanvas
=
$
(
'<canvas />'
).
attr
({
id
:
"canvaspdf"
,
width
:
reportPageWidth
,
height
:
reportPageHeight
});
//
Mantenemos la posicion del canvaslabel
var
pdfctx
=
$
(
pdfCanvas
)[
0
].
getCont
label
//
mantener la posicion del canvas
var
pdfctx
=
$
(
pdfCanvas
)[
0
].
getCont
ext
(
'2d'
);
var
pdfctxX
=
0
;
var
pdfctxY
=
0
;
var
buffer
=
100
;
//
por cada gráfica ejecutamos la funcion
//
for each chart.js chart
$
(
"canvas"
).
each
(
function
(
index
)
{
// obtene
mos las medidas de la grafica
// obtene
r medidas height/width
var
canvasHeight
=
$
(
this
).
innerHeight
();
var
canvasWidth
=
$
(
this
).
innerWidth
();
//
Dibujamos la gráfica en el
canvas
//
dibujar en el nuevo
canvas
pdfctx
.
drawImage
(
$
(
this
)[
0
],
pdfctxX
,
pdfctxY
,
canvasWidth
,
canvasHeight
);
pdfctxX
+=
canvasWidth
+
buffer
;
//
nuestra página de informes está en un patrón de cuadrícula, por lo que se replica en el nuevo
canvas
//
our report page is in a grid pattern so replicate that in the new
canvas
if
(
index
%
2
===
1
)
{
pdfctxX
=
0
;
pdfctxY
+=
canvasHeight
+
buffer
;
}
});
//
Crea un nuevo pdf y agrega nuestro nuevo canvas como imagen.
//
create new pdf and add our new canvas as an image
var
pdf
=
new
jsPDF
(
'l'
,
'pt'
,
[
reportPageWidth
,
reportPageHeight
]);
pdf
.
addImage
(
$
(
pdfCanvas
)[
0
],
'PNG'
,
0
,
0
);
// d
escargamos el
pdf
pdf
.
save
(
label
+
'
.pdf'
);
// d
ownload the
pdf
pdf
.
save
(
'filename
.pdf'
);
});
function
export_json
()
{
}
</script>
...
...
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