parchado de errores

parent 7e5946ec
......@@ -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>
......
......@@ -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 pagina
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].getContlabel
// mantener la posicion del canvas
var pdfctx = $(pdfCanvas)[0].getContext('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) {
// obtenemos las medidas de la grafica
// obtener 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);
// descargamos el pdf
pdf.save(label + '.pdf');
// download the pdf
pdf.save('filename.pdf');
});
function export_json() {
}
</script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment