Commit 8ec19c3c authored by Sergio Adrian Gongora Euan's avatar Sergio Adrian Gongora Euan

update with dev

parents afe2dc5b cea0dbaf
This diff is collapsed.
{% extends "base_top.html" %}
{% load staticfiles %}
{% block headMedia %}
<link rel="stylesheet" href="{% static 'catalog/css/body.css' %}" type="text/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>
{% 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 %}
{% include 'administration_aside.html' %}
{% endblock %}
{% block user %}
{% include "user_button.html" %}
{% endblock %}
{% block content %}
<div 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">{{ Viewname }}</div>
<div class="panel-body text-center">
<table data-toggle="table" id="example" class="table table-striped table-bordered"
style="width:100%">
<thead>
<th>ID</th>
<th>Name</th>
<th>Platform</th>
<th>Product Level</th>
<th>Status</th>
<th>Actions</th>
</thead>
<tbody>
{% for process in process %}
<tr>
<td>{{ process.id }}</td>
<td>{{ process.name }}</td>
<td>{{ process.platform_id }}</td>
<td>{{ process.product_level }}</td>
<form method="post" action="{% url 'update' %}">
{% csrf_token %}
<input type="hidden" name="request_path" value="{{ request.path }}">
<input type="hidden" name="user_id" value="{{ user.user_id }}">
<td>
<input type="checkbox" name="status" value="1"
{% if not request.user.is_superuser %}disabled{% endif %}
{% if process.status == True %}checked{% endif %}>
</td>
<td>
<button {% if not request.user.is_superuser %}disabled{% endif %} title="save" type="submit" class="btn btn-success"><i
class="fa fa-save"></i></button>
</td>
</form>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</section>
<!-- /.content -->
</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>
</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">© 2019 Copyright:
<a href="http://geoint.mx/"> Centro de Investigación en Ciencias de Información Geoespacial.</a>
</div>
<!-- Copyright -->
</footer>
{% endblock %}
{% block templates %}{% include "templates.html" %}{% endblock %}
{% block scripts %}
<script>
$(document).ready(function () {
$('#example').DataTable();
});
</script>
{% endblock %}
\ No newline at end of file
......@@ -2,7 +2,7 @@
<br>
<ul class="sidebar-menu" data-widget="tree">
<li>
<a class="treeview " href="{{ BASE_URL }}/administration">
<a class="treeview " href="{% url 'Dashboard' %}">
<i class="fa fa-home"></i>
<span>Dashboard</span>
<span class="pull-right-container">
......@@ -11,7 +11,7 @@
</a>
</li>
<li>
<a class="treeview " href="../../administration/request">
<a class="treeview " href="{% url 'request' %}">
<i class="fa fa-user-plus"></i>
<span>Request</span>
<span class="pull-right-container">
......@@ -20,7 +20,7 @@
</a>
</li>
<li>
<a class="treeview " href="../../administration/users">
<a class="treeview " href="{% url 'active_users' %}">
<i class="fa fa-users"></i>
<span>Active users</span>
<span class="pull-right-container">
......@@ -29,6 +29,24 @@
</a>
</li>
<li>
<a class="treeview " href="{% url 'all_process' %}">
<i class="fa fa-sync-alt"></i>
<span>Catalog of Process</span>
<span class="pull-right-container">
<span class="label label-primary pull-right"></span>
</span>
</a>
</li>
<li>
<a class="treeview " href="{% url 'all_platform' %}">
<i class="fa fa-satellite"></i>
<span>Catalog of Platforms</span>
<span class="pull-right-container">
<span class="label label-primary pull-right"></span>
</span>
</a>
</li>
<!--li>
<a class="treeview " href="#" onclick="window.history.back();">
<i class="fa fa-backward"></i>
<span>Back</span>
......@@ -36,6 +54,6 @@
<span class="label label-primary pull-right"></span>
</span>
</a>
</li>
</li-->
</ul>
</div>
\ No newline at end of file
......@@ -8,7 +8,8 @@
<script src="{% static 'js/Chart.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>
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css" integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.7.2/css/all.css"
integrity="sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr" crossorigin="anonymous">
{% endblock %}
{% block messages %}
......@@ -146,7 +147,7 @@
<span class="info-box-text">Active Users</span>
<span class="info-box-number">{{ Usuarios }}</span>
<span class="info-box-more pull-right">
<a href="../../administration/users" class="small-box-footer">
<a href="{% url 'active_users' %}" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</span>
......@@ -168,7 +169,7 @@
<span class="info-box-text">User Registrations</span>
<span class="info-box-number">{{ Solicitud }}</span>
<span class="info-box-more pull-right">
<a href="../../administration/request" class="small-box-footer">
<a href="{% url 'request' %}" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</span>
......@@ -186,15 +187,13 @@
<span class="info-box-text">Processing</span>
<span class="info-box-number">{{ Descargando }}</span>
<span class="info-box-more pull-right">
<a href="#" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</span>
</div>
<!-- /.info-box-content -->
</div>
<!-- /.info-box -->
</div>
</div>
<div class="col-md-2 col-sm-6 col-xs-12">
<div class="info-box">
......@@ -204,9 +203,6 @@
<span class="info-box-text">Repsat Storage</span>
<span class="info-box-number">{{ size_repsat }}</span>
<span class="info-box-more pull-right">
<a href="#" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</span>
</div>
<!-- /.info-box-content -->
......@@ -222,9 +218,6 @@
<span class="info-box-text">Sentinel Storage</span>
<span class="info-box-number">{{ size_sentinel }}</span>
<span class="info-box-more pull-right">
<a href="#" class="small-box-footer">
More info <i class="fa fa-arrow-circle-right"></i>
</a>
</span>
</div>
<!-- /.info-box-content -->
......@@ -368,19 +361,56 @@
<!-- /.content -->
</div>
</footer>
{% if messages %}
<div class="container col-md-2 col-lg-2 col-xs-2 col-sm-2" style="bottom: 0; right: 0;position: absolute">
{% for message in messages %}
<div {% if message.tags %} class="fade in alert alert-dismissible alert-{{ message.tags }}"{% endif %}>
<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a>
<strong>{{ message.tags }}!</strong> {{ message }}.
</div>
{% endfor %}
{% endblock %}
{% block 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>
{% endif %}
<div id="ol"></div>
<!-- Footer Elements -->
<!-- Copyright -->
<div class="footer-copyright text-center py-3">© 2019 Copyright:
<a href="http://geoint.mx/"> Centro de Investigación en Ciencias de Información Geoespacial.</a>
</div>
<!-- Copyright -->
</footer>
{% endblock %}
{% block templates %}
......@@ -407,20 +437,11 @@
{% endfor %}
],
backgroundColor: [
'rgba(255, 99, 132, 0.2)',
'rgba(54, 162, 235, 0.2)',
'rgba(255, 206, 86, 0.2)',
'rgba(75, 192, 192, 0.2)',
'rgba(153, 102, 255, 0.2)',
'rgba(255, 159, 64, 0.2)'
'rgba(222, 130, 50, 0.2)'
],
borderColor: [
'rgba(255,99,132,1)',
'rgba(54, 162, 235, 1)',
'rgba(255, 206, 86, 1)',
'rgba(75, 192, 192, 1)',
'rgba(153, 102, 255, 1)',
'rgba(255, 159, 64, 1)'
'rgba(222, 130, 50,1)',
],
borderWidth: 1
}]
......@@ -437,7 +458,6 @@
});
// mostrar imagen al dar click en los puntos
document.getElementById("salesChart").onclick = function (evt) {
// activePoints = myChart.getElementsAtEvent(evt);
......@@ -458,35 +478,34 @@
console.log("hola");
$('#mostrar').empty();
$('#mostrar').append("<table class=\"table table-hover\" id=\"example\">"+
$('#mostrar').append("<table class=\"table table-hover\" id=\"example\">" +
"<thead>" +
"<tr>" +
"<th class=\"text-center\">User ID</th>" +
"<th class=\"text-center\">User</th>" +
"<th class=\"text-center\">E-Mail</th>" +
"<th class=\"text-center\">Purchases</th>" +
"<th class=\"text-center\">Storage</th>" +
//"<th class=\"text-center\">Storage</th>" +
"<th class=\"text-center\">Downloads in process</th>" +
"</tr>" +
"</thead>" +
"<tbody id=\"tbody\" class=\"text-center\">");
$.each(data, function (key, val) {
$("#tbody").append("<tr>"+
"<td>"+val['user_id']+"</td>"+
"<td>"+val['username']+"</td>"+
"<td>"+val['email']+"</td>"+
"<td>"+val['purchases']+"</td>"+
"<td>"+val['storage']+"</td>"+
"<td>"+val['in_process']+"</td>"+
$("#tbody").append("<tr>" +
"<td>" + val['user_id'] + "</td>" +
"<td>" + val['username'] + "</td>" +
"<td>" + val['email'] + "</td>" +
"<td>" + val['purchases'] + "</td>" +
//"<td>"+val['storage']+"</td>"+
"<td>" + val['in_process'] + "</td>" +
"</tr>"
);
});
$('#mostrar').append("</tbody>" +
"</table>");
$('#example').DataTable({
});
$('#example').DataTable({});
}
});
......
......@@ -195,51 +195,7 @@
{% block scripts %}
<script>
$(document).ready(function () {
$('#example').DataTable
({
language:
{
"sProcessing": "Procesando...",
"sLengthMenu": "Mostrar _MENU_ registros",
"sZeroRecords": "No se encontraron resultados",
"sEmptyTable": "Ningún dato disponible en esta tabla",
"sInfo": "Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros",
"sInfoEmpty": "Mostrando registros del 0 al 0 de un total de 0 registros",
"sInfoFiltered": "(filtrado de un total de _MAX_ registros)",
"sInfoPostFix": "",
"sSearch": "Buscar:",
"sUrl": "",
"sInfoThousands": ",",
"sLoadingRecords": "Cargando...",
"oPaginate":
{
"sFirst": "Primero",
"sLast": "Último",
"sNext": "Siguiente",
"sPrevious": "Anterior"
},
"oAria":
{
"sSortAscending": ": Activar para ordenar la columna de manera ascendente",
"sSortDescending": ": Activar para ordenar la columna de manera descendente"
}
},
responsive:
{
details:
{
type: 'column',
target: 'tr'
}
},
columnDefs:
[{
className: 'control',
orderable: false,
targets: 0
}],
order: [1, 'asc']
});
$('#example').DataTable();
});
</script>
{% endblock %}
\ No newline at end of file
......@@ -4,8 +4,10 @@ from . import views
urlpatterns = [
url(r'^$', views.Dashboard, name='Dashboard'),
url(r'^request/$', views.Request_users, name='Request'),
url(r'^request/$', views.Request_users, name='request'),
url(r'^update/$', views.update_user, name='update'),
url(r'^users/$', views.active_users, name='users'),
url(r'^users/$', views.active_users, name='active_users'),
url(r'^platform/$', views.all_Platform, name='all_platform'),
url(r'^process/$', views.all_Process, name='all_process'),
url(r'^ws/report_table$', views.wsPurchasesPM, name='wsPurchasesPM'),
]
\ No newline at end of file
......@@ -13,7 +13,7 @@ from django.http import HttpResponse, HttpResponseRedirect, HttpRequest, Http404
# Create your views here.
from django.views.decorators.csrf import csrf_exempt
from catalog.models import Purchase, Search
from catalog.models import Purchase, Search, Platform, Process
from catalog.views import config
USERS_PATH = config['PATHS']['PATH_NAS']
......@@ -250,4 +250,32 @@ def best_unit_size(bytes_size):
return str(round(bu_size,2))+" "+unit
#------------------------------------------------
def all_Platform (request):
platforms = Platform.objects.all()
platforms_list=[]
for platform in platforms:
platforms_list.append({
"id": platform.id,
"name": platform.name,
"acronym": platform.acronym,
"status": platform.status,
})
return render(request,"Platform.html",{'platforms': platforms_list})
#------------------------------------------------
def all_Process (request):
process = Process.objects.values('id','name','status','platform__name','productLevel')
process_list = []
for process in process:
process_list.append({
"id": process['id'],
"name": process['name'],
"platform_id": process['platform__name'],
"product_level": process['productLevel'],
"status": process['status'],
})
return render(request, "Process.html", {'process': process_list})
......@@ -10,6 +10,7 @@ from django.db import models
class Platform(models.Model):
name = models.CharField(max_length=64)
acronym = models.CharField(max_length=16)
status = models.BooleanField(default=True)
class Polygon(models.Model):
......@@ -53,6 +54,7 @@ class Process(models.Model):
name = models.CharField(max_length=50)
platform = models.ForeignKey(Platform, on_delete=models.CASCADE, default='')
productLevel = models.CharField(max_length=8, default='')
status = models.BooleanField(default=True)
class Search(models.Model):
......
......@@ -33,3 +33,7 @@ html, body
text-decoration: none;
color: black;
}
#cloudPercentageSelector {
background: transparent;
}
This diff is collapsed.
......@@ -15,7 +15,7 @@
<ul class="sidebar-menu" data-widget="tree">
<!-- History element -->
<li>
<a class="treeview " href="../../../users">
<a class="treeview " href="{% url 'users' %}">
<i class="fa fa-user-circle"></i>
<span>Profile</span>
<span class="pull-right-container">
......@@ -26,7 +26,7 @@
<!-- End History element -->
<!-- History element -->
<li>
<a class="treeview " href="{{ BASE_URL }}/reports">
<a class="treeview " href="{% url 'reports' %}">
<i class="fa fa-history"></i>
<span>Shopping History</span>
<span class="pull-right-container">
......@@ -35,7 +35,7 @@
</a>
</li>
<li>
<a class="treeview " href="{{ BASE_URL }}/catalog/cart">
<a class="treeview " href="{% url 'show-cart' %}">
<i class="fa fa-shopping-cart"></i>
<span>View shopping cart</span>
<span class="pull-right-container">
......
......@@ -616,7 +616,6 @@ def Pay(request):
@csrf_exempt
def IPN(request):
PATH_USERS = config['PATHS']['PATH_USERS']
print()
f = open(PATH_USERS+"myfile.txt", "w")
x = request.POST.dict()
f.write('variables')
......
This diff is collapsed.
......@@ -162,3 +162,58 @@ input[type=range]::-webkit-slider-thumb {
border-radius: 100%;
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;
}
......@@ -65,7 +65,6 @@ $(function () {
responsive: true
});
});
......
This diff is collapsed.
This diff is collapsed.
......@@ -25,10 +25,13 @@ document.getElementById("myChart").onclick = function (evt) {
if(activePoint.length>0){
var firstPoint = activePoint[0];
//console.log(firstPoint)
//console.log(firstPoint._datasetIndex) //indice de la clase a la que pertenece (vegetación, agua, etc.)
var label = myChart.data.labels[firstPoint._index];
addImageLayer(label)
//console.log(firstPoint._datasetIndex) //indice de la clase a la que pertenece (vegetación, agua, etc.)
addImageLayer({
layerDate: label
});
//console.log(myChart.legend.legendItems[firstPoint._datasetIndex].text) //nombre de la capa a la que pertenece (vegetación, agua, etc.)
//if (!firstPoint) return;
activePoints.forEach(function (value, index) {
......
......@@ -130,7 +130,7 @@
<br>
<ul class="sidebar-menu" data-widget="tree">
<li>
<a class="treeview " href="{{ BASE_URL }}/catalog">
<a class="treeview " href="{% url 'map' %}">
<i class="fa fa-map"></i>
<span>Home</span>
<span class="pull-right-container">
......
......@@ -35,6 +35,44 @@
<span class="label label-primary pull-right"></span>
</span>
</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>
{% endif %}
<li class="treeview">
......@@ -131,7 +169,7 @@
</a>
</li>
<li>
<a class="treeview submenu" href="#" id="downloadPdf">
<a class="treeview submenu" href="{% url 'PDF' purchaseID %}" target="_blank" download="Report">
<i class="fa fa-file-pdf-o"></i>
<span>Export to PDF</span>
<span class="pull-right-container">
......@@ -139,15 +177,6 @@
</span>
</a>
</li>
<li>
<a class="treeview submenu" href="../../static/reports/tmpImages/repsat_test_dev/{{ email }}/{{ purchaseID }}/{{ zone }}.pdf" id="downloadPdf" target="_blank">
<i class="fa fa-file-pdf-o"></i>
<span>Export to PDF v2</span>
<span class="pull-right-container">
<span class="label label-primary pull-right"></span>
</span>
</a>
</li>
</ul>
</li>
<li class="treeview">
......
......@@ -5,12 +5,14 @@
<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/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>
<link rel="stylesheet" href="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css"
type="text/css">
<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"/>
<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 %}
{% block messages %}
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
......@@ -117,7 +119,7 @@
{% block content %}
<!-- Content Wrapper. Contains page 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">
<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;">
......@@ -132,6 +134,26 @@
</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="minimap" class="minimap"></div>
......@@ -247,31 +269,28 @@
{% block scripts %}
<script id="rendered-js">
$('input[id="inputRange"]').on('input', function () {
let control = $(this);
let controlMin = control.attr('min');
let controlMax = control.attr('max');
let controlVal = control.val();
let controlThumbWidth = control.data('thumbwidth');
let range = controlMax - controlMin;
let position = (controlVal - controlMin) / range * 100;
let positionOffset = Math.round(controlThumbWidth * position / 100) - controlThumbWidth / 2;
let fecha = $("option:eq(" + controlVal + ")").text();
let valor = $("option:eq(" + controlVal + ")").val();
addImageLayer({
layerDate: valor
});
var control = $(this),
controlMin = control.attr('min'),
controlMax = control.attr('max'),
controlVal = control.val(),
controlThumbWidth = control.data('thumbwidth');
var range = controlMax - controlMin;
var position = (controlVal - controlMin) / range * 100;
var positionOffset = Math.round(controlThumbWidth * position / 100) - controlThumbWidth / 2;
var fecha = $("option:eq(" + controlVal + ")").text();
var valor = $("option:eq(" + controlVal + ")").val();
addImageLayer(valor);
$("#maptitle").empty();
$("#maptitle").append("Map Date: " + fecha);
$("#tooltiptext").empty();
$("#tooltiptext").append(fecha);
});
var slider2 = document.getElementById("inputRange");
var sliderOffsetX = slider2.getBoundingClientRect().left - document.documentElement.getBoundingClientRect().left;
var sliderOffsetY = slider2.getBoundingClientRect().top - document.documentElement.getBoundingClientRect().top;
var sliderWidth = slider2.offsetWidth - 1;
......@@ -282,20 +301,19 @@
value = sliderValAtPos - 1;
var fecha = $("option:eq(" + value + ")").text();
var valor = $("option:eq(" + value + ")").val();
$("#tooltiptext").empty();
$("#tooltiptext").css({"margin-left": currentMouseXPos + 'px', "margin-top": sliderOffsetY + 'px'});
$("#tooltiptext").append(fecha);
});
</script>
<!-- page script -->
<script>
var legendOnClickHandler = function (e, legendItem) {
var index = legendItem.datasetIndex;
var ch = this.chart;
let checkbox_id = '#sclcheck-'+legendItem.text.toLowerCase().replace(/\s/g, '-');
const legendOnClickHandler = function (e, legendItem) {
const index = legendItem.datasetIndex;
const ch = this.chart;
const checkbox_id = '#sclcheck-'+legendItem.text.toLowerCase().replace(/\s/g, '-');
// isDatasetVisible return the opposite status?
if (ch.getDatasetMeta(index).hidden === null) {
......@@ -303,14 +321,22 @@
} else {
ch.getDatasetMeta(index).hidden = !ch.getDatasetMeta(index).hidden;
}
ch.update();
$(checkbox_id+" :input").prop("checked", !ch.getDatasetMeta(index).hidden);
addImageLayer(currentDate);
const layerInput = $(checkbox_id+" :input");
layerInput.prop("checked", !ch.getDatasetMeta(index).hidden);
if (layerInput.prop("checked")) {
addImageLayer({
layerName: layerInput.val()
});
} else {
removeLayer(layerInput.val());
}
};
var showSCLcheckboxes = function(datasets) {
const showSCLcheckboxes = function (datasets) {
if (!datasets || datasets.length < 1) {
return;
}
......@@ -322,6 +348,43 @@
});
}
const getSelectedLayersName = function () {
const inputs = $("input[name=layer_type]:checked");
let values = []
Object.keys(inputs).forEach(key => {
let value = inputs[key].value;
if (value) {values.push(value)}
});
return values;
}
const getChartDataIndex = function (id) {
const datasetsLabels = myChart.config.data.datasets.map(data =>
'sclcheck-' + data.label.toLowerCase().replace(' ', '-')
);
return datasetsLabels.indexOf(id);
}
$('input[name=layer_type]').on('click', function() {
const input = $(this);
const index = getChartDataIndex(input.parent().attr('id'));
if (index > -1) {
myChart.getDatasetMeta(index).hidden=!input.prop("checked");
myChart.update();
}
if (input.prop("checked")) {
addImageLayer({
layerName: input.val()
});
} else {
removeLayer(input.val());
}
});
var label;
// Recibimos el JSON con los datos desde el View
{% autoescape off %}
......
......@@ -16,4 +16,5 @@ urlpatterns = [
url(r'^ws/process_progress$', views.wsProcessProgress, name='wsProcessProgress'),
url(r'^ws/is_public', views.wsIs_Public, name='wsIs_Public'),
url(r'^ws/wsEditTitle', views.wsEditTitle, name='wsEditTitle'),
url(r'^ws/PDF/(?P<purchase_id>(\d+))$', views.PDFGenerator, name='PDF'),
]
This diff is collapsed.
......@@ -122,7 +122,7 @@
User Profile
</h1>
<ol class="breadcrumb">
<li><a href="../"><i class="fa fa-home"></i> Home</a></li>
<li><a href="{% url 'map' %}"><i class="fa fa-home"></i> Home</a></li>
<li class="active">User profile</li>
</ol>
</section>
......@@ -356,7 +356,8 @@
type: 'POST',
dataType: "json",
data: {'title': label, "user_id": $('#user_id').val()},
url: '../../users/ws/report_table',
//url: '../../users/ws/report_table',
url: '{% url "wsPurchasesPM" %}',
success: function (data) {
console.log(data);
$('#mostrar').empty();
......
......@@ -2,7 +2,7 @@
<br>
<ul class="sidebar-menu" data-widget="tree">
<li>
<a class="treeview " href="{{ BASE_URL }}/reports">
<a class="treeview " href="{% url 'reports' %}">
<i class="fa fa-files-o"></i>
<span>Reports</span>
<span class="pull-right-container">
......
......@@ -35,14 +35,14 @@ def Users(request):
purchases = Purchase.objects.filter(user_id=user.id)
in_process = Purchase.objects.filter(user_id=user.id).exclude(progress=100)
bytes_size = 0
for path, directories, files in os.walk(USERS_PATH + "repsat_test_dev/" + user.email):
for filename in files:
bytes_size += os.lstat(os.path.join(path, filename)).st_size
for directory in directories:
bytes_size += os.lstat(os.path.join(path, directory)).st_size
bytes_size += os.path.getsize(USERS_PATH + "repsat_test_dev/" + user.email)
size_repsat = best_unit_size(bytes_size)
#bytes_size = 0
#for path, directories, files in os.walk(USERS_PATH + "repsat_test_dev/" + user.email):
# for filename in files:
# bytes_size += os.lstat(os.path.join(path, filename)).st_size
# for directory in directories:
# bytes_size += os.lstat(os.path.join(path, directory)).st_size
#bytes_size += os.path.getsize(USERS_PATH + "repsat_test_dev/" + user.email)
#size_repsat = best_unit_size(bytes_size)
user_data.append({
"user_id": user.id,
......@@ -50,7 +50,7 @@ def Users(request):
"searches": searches.count(),
"purchases": purchases.count(),
"in_process": in_process.count(),
"size": size_repsat,
#"size": size_repsat,
})
for search in Search.objects.values('search_name').filter(user_id=user.id).annotate(
......@@ -155,13 +155,13 @@ def User_id(request, user_id):
in_process = Purchase.objects.filter(user_id=user.id).exclude(progress=100)
bytes_size = 0
for path, directories, files in os.walk(USERS_PATH + "repsat_test_dev/"+user.email):
for filename in files:
bytes_size += os.lstat(os.path.join(path, filename)).st_size
for directory in directories:
bytes_size += os.lstat(os.path.join(path, directory)).st_size
bytes_size += os.path.getsize(USERS_PATH + "repsat_test_dev/"+user.email)
size_repsat = best_unit_size(bytes_size)
#for path, directories, files in os.walk(USERS_PATH + "repsat_test_dev/"+user.email):
# for filename in files:
# bytes_size += os.lstat(os.path.join(path, filename)).st_size
# for directory in directories:
# bytes_size += os.lstat(os.path.join(path, directory)).st_size
#bytes_size += os.path.getsize(USERS_PATH + "repsat_test_dev/"+user.email)
#size_repsat = best_unit_size(bytes_size)
user_data.append({
"user_id": user.id,
......@@ -169,7 +169,7 @@ def User_id(request, user_id):
"searches": searches.count(),
"purchases": purchases.count(),
"in_process": in_process.count(),
"size": size_repsat,
#"size": size_repsat,
})
for search in Search.objects.values('search_name').filter(user_id=user.id).annotate(
......@@ -269,13 +269,13 @@ def wsPurchasesPM(request):
table_data = []
data = Purchase.objects.values('user_id', 'search__endDate', 'search__startDate', 'aggreg_date',
'search__process_id__name', 'search__search_name').filter(
'search__process_id__name', 'name').filter(
user_id=request.POST.get('user_id'), purchased=True,
aggreg_date__month=to_if(request.POST.get('title'))).order_by('aggreg_date')
for producto in data:
table_data.append({
"search_name": producto['search__search_name'],
"search_name": producto['name'],
"process": producto['search__process_id__name'],
"purchase_date": str(producto['aggreg_date'])[:10],
"startDate": str(producto['search__startDate'])[:10],
......
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