Commit f1909472 authored by Luis Dominguez's avatar Luis Dominguez

Merge branch 'dev' of gitlab.geoint.mx:mario.chirinos/GeoInt_SIDT into dev

parents a02fb58a 79df01e2
...@@ -182,6 +182,23 @@ sidtMap.prototype.changeInteraction = function() { ...@@ -182,6 +182,23 @@ sidtMap.prototype.changeInteraction = function() {
this.map.addInteraction(this.interaction); this.map.addInteraction(this.interaction);
} }
// this shit is really hack hahahahah
sidtMap.prototype.listenShiftButton = function() {
inDown = (evt) => {
if (evt.key != "Shift" || evt.keyCode != 16 || this.interaction.geometryFunction_.name === "r") return;
this.interaction.geometryFunction_ = new ol.interaction.Draw.createRegularPolygon(4);
}
inUp = (evt) => {
if (evt.key != "Shift" || evt.keyCode != 16 || this.interaction.geometryFunction_.name === "r") return;
this.interaction.geometryFunction_ = new ol.interaction.Draw.createRegularPolygon(4, Math.PI/4);
};
document.addEventListener('keydown', inDown);
document.addEventListener('keyup', inUp);
}
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
sidtMap.prototype.onMousemove = function(e) sidtMap.prototype.onMousemove = function(e)
{ {
......
...@@ -33,7 +33,8 @@ ...@@ -33,7 +33,8 @@
<link rel="stylesheet" href="{% static 'catalog/adminlte/bower_components/guides-master/dist/guides.css' %}"> <link rel="stylesheet" href="{% static 'catalog/adminlte/bower_components/guides-master/dist/guides.css' %}">
</head> </head>
<body class="hold-transition skin-yellow sidebar-mini">
<body style="overflow: hidden;" class="hold-transition skin-yellow sidebar-mini">
<!-- <div id="map" class="map" tabindex="0"> </div>--> <!-- <div id="map" class="map" tabindex="0"> </div>-->
<!-- <iframe id="catalogFrame" name="catalogFrame">my frame</iframe>--> <!-- <iframe id="catalogFrame" name="catalogFrame">my frame</iframe>-->
......
...@@ -368,6 +368,7 @@ ...@@ -368,6 +368,7 @@
var osmap = new sidtMap("map", -89.63873079999999, 21.0404457, 7); var osmap = new sidtMap("map", -89.63873079999999, 21.0404457, 7);
osmap.geolocation(); osmap.geolocation();
osmap.addInteraction(); osmap.addInteraction();
osmap.listenShiftButton();
var req_url = "{% url 'search-submit' %}"; // url for requesting polygon data var req_url = "{% url 'search-submit' %}"; // url for requesting polygon data
var prod_req_url = "{% url 'productList' %}"; // url for requesting product data var prod_req_url = "{% url 'productList' %}"; // url for requesting product data
......
.cross-range { input[type=range] {
height: 6px;
-webkit-appearance: none;
margin: 6px 0;
width: 100%;
}
input[type=range]:focus {
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
width: 100%;
height: 14px;
cursor: pointer;
animate: 0.2s;
box-shadow: 1px 1px 1px #50555C;
background: #50555C;
border-radius: 14px;
border: 0px solid #000000;
}
input[type=range]::-webkit-slider-thumb {
box-shadow: 0px 0px 0px #000000;
border: 0px solid #000000;
height: 20px;
width: 40px;
border-radius: 12px;
background: #dc7828;
cursor: pointer;
-webkit-appearance: none;
margin-top: -3px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
background: #50555C;
}
input[type=range]::-moz-range-track {
width: 100%;
height: 14px;
cursor: pointer;
animate: 0.2s;
box-shadow: 1px 1px 1px #50555C;
background: #50555C;
border-radius: 14px;
border: 0px solid #000000;
}
input[type=range]::-moz-range-thumb {
box-shadow: 0px 0px 0px #000000;
border: 0px solid #000000;
height: 20px;
width: 40px;
border-radius: 12px;
background: #529DE1;
cursor: pointer;
}
input[type=range]::-ms-track {
width: 100%;
height: 14px;
cursor: pointer;
animate: 0.2s;
background: transparent;
border-color: transparent;
color: transparent;
}
input[type=range]::-ms-fill-lower {
background: #50555C;
border: 0px solid #000000;
border-radius: 28px;
box-shadow: 1px 1px 1px #50555C;
}
input[type=range]::-ms-fill-upper {
background: #50555C;
border: 0px solid #000000;
border-radius: 28px;
box-shadow: 1px 1px 1px #50555C;
}
input[type=range]::-ms-thumb {
margin-top: 1px;
box-shadow: 0px 0px 0px #000000;
border: 0px solid #000000;
height: 20px;
width: 40px;
border-radius: 12px;
background: #529DE1;
cursor: pointer;
}
input[type=range]:focus::-ms-fill-lower {
background: #50555C;
}
input[type=range]:focus::-ms-fill-upper {
background: #50555C;
}
/*.cross-range {
-webkit-appearance: none; -webkit-appearance: none;
width: 100%; width: 100%;
margin: 4.05px 0; margin: 4.05px 0;
...@@ -89,3 +180,4 @@ ...@@ -89,3 +180,4 @@
padding-left: 10px; padding-left: 10px;
padding-right: 10px; padding-right: 10px;
} }
*/
\ No newline at end of file
...@@ -319,3 +319,40 @@ select::-ms-expand { ...@@ -319,3 +319,40 @@ select::-ms-expand {
border-width: 11px; border-width: 11px;
margin-left: -11px; margin-left: -11px;
} }
/*progress bar effect*/
/*left and right arrows for slider with font-awesome*/
.fas.fa-chevron-left {
position: absolute;
left: 0;
top: 40%;
margin-left: 5px;
color: rgba(11, 15, 192, 0.3);
font-size: 60px;
z-index: 100;
}
.fas.fa-chevron-right {
position: absolute;
right: 0;
top: 40%;
margin-right: 5px;
color: rgba(11, 15, 192, 0.3);
font-size: 60px;
z-index: 100;
}
.fas.fa-chevron-left:hover{
color: blue;
}
.fas.fa-chevron-right:hover {
color: blue;
}
\ No newline at end of file
...@@ -25,9 +25,6 @@ ...@@ -25,9 +25,6 @@
<script type="text/javascript"> <script type="text/javascript">
</script> </script>
{% endblock %} {% endblock %}
{% block messages %} {% block messages %}
...@@ -189,11 +186,14 @@ ...@@ -189,11 +186,14 @@
{% for product in productList %} {% for product in productList %}
<tr> <tr>
<td> <td>
<a href="#" id="title{{ product.purchase_id }}" data-toggle="popover" data-trigger="hover" <a href="#" id="title{{ product.purchase_id }}" data-toggle="popover"
data-content="{% if product.description %}{{ product.description }}{% else %}Without Description{% endif %}" data-trigger="hover"
data-content="
{% if product.description %}{{ product.description }}{% else %}Without Description{% endif %}"
onclick="showMyModalSetTitle('{{ product.search_name }}','{{ product.polygon }}');"> {{ product.search_name }}</a> onclick="showMyModalSetTitle('{{ product.search_name }}','{{ product.polygon }}');"> {{ product.search_name }}</a>
<a href="#" onclick="showEditModal('{{ product.search_name }}','{{ product.description }}','{{ product.purchase_id }}')"><span <a href="#"
onclick="showEditModal('{{ product.search_name }}','{{ product.description }}','{{ product.purchase_id }}')"><span
class="fas fa-pencil-alt" class="fas fa-pencil-alt"
style="margin:3px 0 0 0"></span></a> style="margin:3px 0 0 0"></span></a>
</td> </td>
...@@ -237,14 +237,18 @@ ...@@ -237,14 +237,18 @@
href="../../static/reports/tmpImages/repsat_test_dev/{{ request.user.email }}/{{ product.purchase_id }}/myzip.zip" href="../../static/reports/tmpImages/repsat_test_dev/{{ request.user.email }}/{{ product.purchase_id }}/myzip.zip"
{% else %} {% else %}
href="#" href="#"
{% endif %} class="btn btn-warning btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4"> {% endif %}
class="btn btn-warning btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4">
<i class="fa fa-file-zip-o"></i> <i class="fa fa-file-zip-o"></i>
</a> </a>
<a title="Download PDF" {% if product.progress == 100 %} <a title="Download PDF" {% if product.progress == 100 %}
href="{% url 'PDF' product.purchase_id %}" href="{% url 'PDF' product.purchase_id %}"
{% else %} {% else %}
href="#" href="#"
{% endif %} class="btn btn-info btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4" target="_blank" download="{{ product.search_name }} ({{ product.purchase_date }}).pdf"> {% endif %}
class="btn btn-info btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4"
target="_blank"
download="{{ product.search_name }} ({{ product.purchase_date }}).pdf">
<i class="fa fa-file-pdf-o"></i> <i class="fa fa-file-pdf-o"></i>
</a> </a>
<!--a title="View Log" href="#" class="btn btn-info" <!--a title="View Log" href="#" class="btn btn-info"
...@@ -263,7 +267,7 @@ ...@@ -263,7 +267,7 @@
<!-- /.content --> <!-- /.content -->
</div> </div>
<!-- Footer --> <!-- Footer -->
<footer class=" page-footer font-small special-color-dark pt-5" > <footer class=" page-footer font-small special-color-dark pt-5">
<!-- Footer Elements --> <!-- Footer Elements -->
<div class="container"> <div class="container">
</div> </div>
...@@ -313,12 +317,13 @@ ...@@ -313,12 +317,13 @@
<div class="modal-footer"> <div class="modal-footer">
<div align = "left"> <div align="left">
<textarea id ="polygonText" readonly rows="5" style="width: 61em; resize:none; font-size: 7pt;"> <textarea id="polygonText" readonly rows="5" style="width: 61em; resize:none; font-size: 7pt;">
POLYGON POLYGON
</textarea> </textarea>
</div> </div>
<button style="float: left; type="button" class="btn btn-default" onclick="copyPolygonText()">Copy polygon</button> <button style="float: left; type=" button
" class="btn btn-default" onclick="copyPolygonText()">Copy polygon</button>
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button> <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div> </div>
</div> </div>
......
...@@ -120,26 +120,29 @@ ...@@ -120,26 +120,29 @@
{% block content %} {% block content %}
<!-- Content Wrapper. Contains page content --> <!-- Content Wrapper. Contains page content -->
<!-- Main content --> <!-- Main content -->
<div id="timeLine" class="container floating-panel slidecontainer" style="position:absolute; display:block; bottom: 40px; left: 12%; width: 500px; z-index: 1000"> <div id="timeLine" class="container col-md-12 floating-panel slidecontainer"
<div class="range-control" id="rangecontrol"> style="position:absolute; display:block; bottom: 40px; width: 500px; z-index: 1000">
<div id="rangecontrol2"></div> <div id="set_Range_date" class="col-md-4 pull-left" style="margin-right: -15%">{{ labels|first|slice:"6:8" }}/{{ labels|first|slice:"4:6" }}/{{ labels|first|slice:"0:4" }}</div>
<div class="range-control col-md-8" id="rangecontrol">
<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;">
<datalist class="range__list" id="number"> <datalist class="range__list" id="number">
{% for label in labels %} {% for label in labels %}
<option class="range__opt" value="{{ label }}">{{ label|slice:"6:8" }}/{{ label|slice:"4:6" }}/{{label|slice:"0:4" }}</option> <option class="range__opt"
value="{{ label }}">{{ label|slice:"6:8" }}/{{ label|slice:"4:6" }}/{{ label|slice:"0:4" }}</option>
{% endfor %} {% endfor %}
</datalist> </datalist>
</div> </div>
</div> </div>
<div id="selectLeft" class="container floating-panel" <div id="selectLeft" class="container col-md-12 floating-panel"
style="position:absolute; display:none; bottom: 50px; left: 30%; width: 300px; z-index: 1000"> style="position:absolute; display:none; bottom: 50px; left: 30%; width: 300px; z-index: 1000">
<div class=""> <div id="set_Range_date2" class="col-md-4 pull-left">{{ labels|first|slice:"6:8" }}/{{ labels|first|slice:"4:6" }}/{{ labels|first|slice:"0:4" }}</div>
<div id="rangecontrol3"></div>
<div class="col-md-8">
<!--<select onchange="selectLeft(this.value)" id="selectLeftCompare"> <!--<select onchange="selectLeft(this.value)" id="selectLeftCompare">
{% for label in labels %} {% for label in labels %}
<option value="{{label}}" >{{ label|slice:"6:8" }}/{{ label|slice:"4:6" }}/{{label|slice:"0:4" }}</option> <option value="{{label}}" >{{ label|slice:"6:8" }}/{{ label|slice:"4:6" }}/{{label|slice:"0:4" }}</option>
...@@ -150,17 +153,18 @@ ...@@ -150,17 +153,18 @@
</div> </div>
</div> </div>
<div id="selectRight" class="container floating-panel" <div id="selectRight" class="container col-md-12 floating-panel"
style="position:absolute; display:none; bottom: 50px; left: 75%; width: 300px; z-index: 1000"> style="position:absolute; display:none; bottom: 50px; left: 75%; width: 300px; z-index: 1000">
<div> <div id="set_Range_date3" class="col-md-4 pull-left">{{ labels|last|slice:"6:8" }}/{{ labels|last|slice:"4:6" }}/{{ labels|last|slice:"0:4" }}</div>
<div id="rangecontrol4"></div>
<div class="col-md-8">
<!--<select onchange="selectRight(this.value)" id="selectRightCompare"> <!--<select onchange="selectRight(this.value)" id="selectRightCompare">
{% for label in labels %} {% for label in labels %}
<option value="{{label}}" >{{ label|slice:"6:8" }}/{{ label|slice:"4:6" }}/{{label|slice:"0:4" }}</option> <option value="{{label}}" >{{ label|slice:"6:8" }}/{{ label|slice:"4:6" }}/{{label|slice:"0:4" }}</option>
{% endfor %} {% endfor %}
</select>--> </select>-->
<input class="cross-range" id="selectRightCompare" type="range" min="0" max="{{ labels|length|add:'-1' }}" <input class="cross-range" id="selectRightCompare" type="range" min="0" max="{{ labels|length|add:'-1' }}"
step="1" value="0" data-thumbwidth="20" style="background: transparent;"> step="1" value="{{ labels|length|add:'-1' }}" data-thumbwidth="20" style="background: transparent;">
</div> </div>
</div> </div>
...@@ -209,14 +213,19 @@ ...@@ -209,14 +213,19 @@
</div> </div>
</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>
<section class="content"> <section class="content">
<a href="#" id="button_left" title="Previous" onclick="previus_report({{ request.path_info|slice:"9:" }})"><i class="fas fa-chevron-left"></i></a>
<a href="#" id="button_right" title="Next" onclick="next_report({{ request.path_info|slice:"9:" }})"><i class="fas fa-chevron-right"></i></a>
<div class="row col-lg-11 title"> <div class="row col-lg-11 title">
<div class="box box-success box-solid info"> <div class="box box-success box-solid info">
<div class="box-header with-border"> <div class="box-header with-border">
<h3>{{ searchInfo.title }}, {{ searchInfo.startDate }} to {{ searchInfo.endDate}}</h3> <h3>{{ searchInfo.title }}, {{ searchInfo.startDate }} to {{ searchInfo.endDate }}</h3>
<h6>{{ searchInfo.report_name }}</h6> <h6>{{ searchInfo.report_name }}</h6>
<!-- /.box-tools --> <!-- /.box-tools -->
</div> </div>
...@@ -377,8 +386,10 @@ ...@@ -377,8 +386,10 @@
$("#tooltiptext").empty(); $("#tooltiptext").empty();
$("#tooltiptext").append(fecha); $("#tooltiptext").append(fecha);
$("#rangecontrol2").empty(); $("#rangecontrol2").empty();
$("#rangecontrol2").append('<span class="arrow_box" id="tooltiptext">'+fecha+'</span>'); $("#set_Range_date").empty();
$('.arrow_box').css({'left':Math.round(pixelPostion-35) + 'px'}) //$("#rangecontrol2").append('<span class="arrow_box" id="tooltiptext">' + fecha + '</span>');
$("#set_Range_date").append(fecha);
$('.arrow_box').css({'left': Math.round(pixelPostion - 35) + 'px'})
}); });
$('input[id="selectLeftCompare"]').on('input', function () { $('input[id="selectLeftCompare"]').on('input', function () {
...@@ -400,13 +411,11 @@ ...@@ -400,13 +411,11 @@
var pixelPostion = slider3.clientWidth * sliderPos; var pixelPostion = slider3.clientWidth * sliderPos;
$("#tooltiptext2").empty(); $("#tooltiptext2").empty();
$("#tooltiptext2").append(fecha); $("#tooltiptext2").append(fecha);
$("#rangecontrol3").empty(); $("#set_Range_date2").empty();
$("#rangecontrol3").append('<span class="arrow_box_left" id="tooltiptext2">'+fecha+'</span>'); $("#set_Range_date2").append(fecha);
$('.arrow_box_left').css({'left':Math.round(pixelPostion-35) + 'px'}) $('.arrow_box_left').css({'left': Math.round(pixelPostion - 35) + 'px'})
}); });
...@@ -429,13 +438,11 @@ ...@@ -429,13 +438,11 @@
var pixelPostion = slider3.clientWidth * sliderPos; var pixelPostion = slider3.clientWidth * sliderPos;
$("#tooltiptext3").empty(); $("#tooltiptext3").empty();
$("#tooltiptext3").append(fecha); $("#tooltiptext3").append(fecha);
$("#rangecontrol4").empty(); $("#set_Range_date3").empty();
$("#rangecontrol4").append('<span class="arrow_box_right" id="tooltiptext3">'+fecha+'</span>'); $("#set_Range_date3").append(fecha);
$('.arrow_box_right').css({'left':Math.round(pixelPostion-35) + 'px'}) $('.arrow_box_right').css({'left': Math.round(pixelPostion - 35) + 'px'})
}); });
</script> </script>
...@@ -444,7 +451,7 @@ ...@@ -444,7 +451,7 @@
const legendOnClickHandler = function (e, legendItem) { const legendOnClickHandler = function (e, legendItem) {
const index = legendItem.datasetIndex; const index = legendItem.datasetIndex;
const ch = this.chart; const ch = this.chart;
const checkbox_id = '#sclcheck-'+legendItem.text.toLowerCase().replace(/\s/g, '-'); const checkbox_id = '#sclcheck-' + legendItem.text.toLowerCase().replace(/\s/g, '-');
// isDatasetVisible return the opposite status? // isDatasetVisible return the opposite status?
if (ch.getDatasetMeta(index).hidden === null) { if (ch.getDatasetMeta(index).hidden === null) {
...@@ -454,7 +461,7 @@ ...@@ -454,7 +461,7 @@
} }
ch.update(); ch.update();
const layerInput = $(checkbox_id+" :input"); const layerInput = $(checkbox_id + " :input");
layerInput.prop("checked", !ch.getDatasetMeta(index).hidden); layerInput.prop("checked", !ch.getDatasetMeta(index).hidden);
...@@ -472,10 +479,10 @@ ...@@ -472,10 +479,10 @@
return; return;
} }
datasets.forEach(function(data) { datasets.forEach(function (data) {
let checkbox_id = '#sclcheck-'+data.label.toLowerCase().replace(' ','-'); let checkbox_id = '#sclcheck-' + data.label.toLowerCase().replace(' ', '-');
$(checkbox_id).show(); $(checkbox_id).show();
$(checkbox_id+" :input").prop("checked", false); $(checkbox_id + " :input").prop("checked", false);
}); });
} }
...@@ -485,7 +492,9 @@ ...@@ -485,7 +492,9 @@
Object.keys(inputs).forEach(key => { Object.keys(inputs).forEach(key => {
let value = inputs[key].value; let value = inputs[key].value;
if (value) {values.push(value)} if (value) {
values.push(value)
}
}); });
return values; return values;
...@@ -498,12 +507,12 @@ ...@@ -498,12 +507,12 @@
return datasetsLabels.indexOf(id); return datasetsLabels.indexOf(id);
} }
$('input[name=layer_type]').on('click', function() { $('input[name=layer_type]').on('click', function () {
const input = $(this); const input = $(this);
const index = getChartDataIndex(input.parent().attr('id')); const index = getChartDataIndex(input.parent().attr('id'));
if (index > -1) { if (index > -1) {
myChart.getDatasetMeta(index).hidden=!input.prop("checked"); myChart.getDatasetMeta(index).hidden = !input.prop("checked");
myChart.update(); myChart.update();
} }
...@@ -530,6 +539,7 @@ ...@@ -530,6 +539,7 @@
let clouds = "{{ searchInfo.clouds }}"; let clouds = "{{ searchInfo.clouds }}";
let oldLabel = "{{defaultDataSet}}"; let oldLabel = "{{defaultDataSet}}";
let labels = {{labels}}; let labels = {{labels}};
let lista_productos = {{ lista }}
var config = {{graphData}}; var config = {{graphData}};
let polygon = "{{searchInfo.polygon}}" let polygon = "{{searchInfo.polygon}}"
...@@ -545,6 +555,34 @@ ...@@ -545,6 +555,34 @@
showSCLcheckboxes(config.data.datasets); showSCLcheckboxes(config.data.datasets);
{% endautoescape %} {% endautoescape %}
console.log(lista_productos);
function next_report(number) {
let index = lista_productos.indexOf(number);
console.log(index);
index++;
console.log(index);
if (index >= lista_productos.length)
index = 0;
console.log(lista_productos[index]);
window.location.replace("../reports/"+lista_productos[index]);
}
function previus_report(number) {
let index = lista_productos.indexOf(number);
console.log(index);
index--;
console.log(index);
if (index < 0)
index = lista_productos.length-1;
console.log(lista_productos[index]);
window.location.replace("../reports/"+lista_productos[index]);
}
</script> </script>
<script type="text/javascript" src="{% static 'reports/js/reportImg.js' %}"></script> <script type="text/javascript" src="{% static 'reports/js/reportImg.js' %}"></script>
<script type="text/javascript" src="{% static 'reports/js/reportPdf.js' %}"></script> <script type="text/javascript" src="{% static 'reports/js/reportPdf.js' %}"></script>
......
...@@ -47,6 +47,7 @@ def report_L2ASCL(request, purchase_id): ...@@ -47,6 +47,7 @@ def report_L2ASCL(request, purchase_id):
template = "sclData.html" template = "sclData.html"
reporteDir = 'mask' reporteDir = 'mask'
folders = "" folders = ""
productList = []
purchase = Purchase.objects.values('user__email', 'is_public', 'name', 'search__search_name', purchase = Purchase.objects.values('user__email', 'is_public', 'name', 'search__search_name',
'search__process_id__name','description','aggreg_date').get(pk=purchase_id) 'search__process_id__name','description','aggreg_date').get(pk=purchase_id)
email = purchase['user__email'] email = purchase['user__email']
...@@ -90,13 +91,34 @@ def report_L2ASCL(request, purchase_id): ...@@ -90,13 +91,34 @@ def report_L2ASCL(request, purchase_id):
#PDFGenerator(request, path, reporteDir, datasets,searchInfo) #PDFGenerator(request, path, reporteDir, datasets,searchInfo)
pass pass
if request.user.is_authenticated:
product_list = Purchase.objects.values('id').filter(
user_id__in=[request.user.id],
purchased=1,
progress=100
)
else:
product_list = Purchase.objects.values('id').filter(
is_public=True,
progress=100,
user__email= email
)
for producto in product_list:
if os.path.exists(USERS_PATH + email+'/'+str(producto['id'])+'/scl_data.json' ):
productList.append(
producto['id'],
)
print (product_list)
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,
'defaultDataSet': defaultDataset, "folders": folders, 'defaultDataSet': defaultDataset, "folders": folders,
"zone": reporteDir, "purchaseID": purchase_id, "zone": reporteDir, "purchaseID": purchase_id,
"labels": graphData['data']['labels'], "labels": graphData['data']['labels'],
"email": email}) "email": email,"lista":productList})
# -------------------------------------------------------------------------------def Reports(request): # -------------------------------------------------------------------------------def Reports(request):
...@@ -145,10 +167,11 @@ def Reports(request): ...@@ -145,10 +167,11 @@ def Reports(request):
progress = 60 progress = 60
if 'Finalizing...' in open(log_info).read(): if 'Finalizing...' in open(log_info).read():
progress = 100 progress = 100
# item = Purchase.objects.filter(pk=producto['id'])
# item = Purchase.objects.get(pk=producto['id']) #item = Purchase.objects.filter(pk=producto['id'])
# item.progress = progress item = Purchase.objects.get(pk=producto['id'])
# item.save() item.progress = progress
item.save()
with open(log_info, 'r') as myfile: with open(log_info, 'r') as myfile:
log = myfile.read().replace('\n', '') log = myfile.read().replace('\n', '')
......
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