users

parent c47c0b63
# Generated by Django 2.1.5 on 2019-02-27 19:26
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0012_search_process'),
]
operations = [
migrations.AddField(
model_name='purchase',
name='progress',
field=models.IntegerField(default=0),
),
migrations.AddField(
model_name='search',
name='search_name',
field=models.TextField(null=True),
),
]
# Generated by Django 2.1.5 on 2019-02-27 19:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0013_auto_20190227_1926'),
]
operations = [
migrations.AlterField(
model_name='search',
name='search_name',
field=models.TextField(default='Drawn polygon'),
),
]
# Generated by Django 2.1.5 on 2019-02-27 21:40
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0014_auto_20190227_1943'),
]
operations = [
migrations.AlterField(
model_name='search',
name='search_name',
field=models.TextField(default='Drawn polygon '),
),
]
...@@ -11,7 +11,7 @@ function refresh() { ...@@ -11,7 +11,7 @@ function refresh() {
success: function (data) { success: function (data) {
$.each(data, function (key, val) { $.each(data, function (key, val) {
console.log(key+ " purchase_id:"+val.purchase_id+", progress: "+val.progress); //console.log(key+ " purchase_id:"+val.purchase_id+", progress: "+val.progress);
if (val.progress != 100) { if (val.progress != 100) {
$('#progress_bar' + val.purchase_id).attr("aria-valuenow", val.progress); $('#progress_bar' + val.purchase_id).attr("aria-valuenow", val.progress);
$('#progress_bar' + val.purchase_id).attr('style', 'width:' + val.progress + '%'); $('#progress_bar' + val.purchase_id).attr('style', 'width:' + val.progress + '%');
......
...@@ -4,6 +4,16 @@ ...@@ -4,6 +4,16 @@
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> <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"/> <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="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.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">
<style>
.map {
height: 400px;
width: 100%;
}
</style>
<script src="https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"></script>
{% endblock %} {% endblock %}
{% block messages %} {% block messages %}
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
...@@ -49,7 +59,7 @@ ...@@ -49,7 +59,7 @@
<a href="#" class="dropdown-toggle" data-toggle="dropdown"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">
<i class="fa fa-bell-o"></i> <i class="fa fa-bell-o"></i>
<span class="label label-warning">10</span> <span class="label label-warning">10</span>
</a> </a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li class="header">You have 10 notifications</li> <li class="header">You have 10 notifications</li>
<li> <li>
...@@ -123,7 +133,7 @@ ...@@ -123,7 +133,7 @@
{% block content %} {% block content %}
<!-- Content Wrapper. Contains page content --> <!-- Content Wrapper. Contains page content -->
<!-- Main content --> <!-- Main content -->
<div id="reportPage" class="wrapper" style="background-color: #ecf0f5; display: none"> <div id="reportPage" class="wrapper" style="background-color: #ecf0f5;">
<!-- Content Wrapper. Contains page content --> <!-- Content Wrapper. Contains page content -->
<!-- Main content --> <!-- Main content -->
<section class="content"> <section class="content">
...@@ -133,6 +143,7 @@ ...@@ -133,6 +143,7 @@
<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>
<th>Zone</th>
<th>Process</th> <th>Process</th>
<th>Purchase date</th> <th>Purchase date</th>
<th>Start Date</th> <th>Start Date</th>
...@@ -144,6 +155,9 @@ ...@@ -144,6 +155,9 @@
<tbody id="table_body"> <tbody id="table_body">
{% for product in productList %} {% for product in productList %}
<tr> <tr>
<td><a href="#"
onclick="showMyModalSetTitle('{{ product.search_name }}', 'Some body txt')"> {{ product.search_name }}</a>
</td>
<td>{{ product.process }}</td> <td>{{ product.process }}</td>
<td>{{ product.purchase_date }}</td> <td>{{ product.purchase_date }}</td>
<td>{{ product.startDate }}</td> <td>{{ product.startDate }}</td>
...@@ -228,9 +242,54 @@ ...@@ -228,9 +242,54 @@
</div> </div>
</div> </div>
<div id="mapmodal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalTitle"></h4>
</div>
<div class="modal-body">
<div id="map" class="map"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>
<!-- /.modals --> <!-- /.modals -->
{% endblock %} {% endblock %}
{% block scripts %} {% block scripts %}
<script src="{% static 'reports/js/Reports_scripts.js' %}"> <script src="{% static 'reports/js/Reports_scripts.js' %}"></script>
<script type="text/javascript">
function showMyModalSetTitle(name,data) {
$('#map').empty();
$('#myModalTitle').val(name);
$("#mapmodal").modal();
setTimeout(function(){ createmap(); }, 1000);
}
function createmap() {
var map = new ol.Map({
target: 'map',
layers: [
new ol.layer.Tile({
source: new ol.source.OSM()
})
],
view: new ol.View({
center: ol.proj.fromLonLat([-89.63873079999999,21.0404457]),
zoom: 5
})
});
}
</script> </script>
{% endblock %} {% endblock %}
...@@ -119,7 +119,7 @@ def Reports(request): ...@@ -119,7 +119,7 @@ def Reports(request):
folders=[] folders=[]
zip ="" zip =""
product_list = Purchase.objects.values('id', 'productList', 'aggreg_date', 'search__clouds', 'search__startDate', product_list = Purchase.objects.values('id', 'productList', 'aggreg_date', 'search__clouds', 'search__startDate',
'search__endDate', 'search__process_id__name').filter( 'search__endDate', 'search__process_id__name', 'search__search_name').filter(
user_id=request.user.id, purchased=1) user_id=request.user.id, purchased=1)
for producto in product_list: for producto in product_list:
log_info = USERS_PATH + request.user.email + "/" + str(producto['id']) + "/L2ASCL_AreaProcessing.log" log_info = USERS_PATH + request.user.email + "/" + str(producto['id']) + "/L2ASCL_AreaProcessing.log"
...@@ -162,6 +162,7 @@ def Reports(request): ...@@ -162,6 +162,7 @@ def Reports(request):
print("folder out noes not exists") print("folder out noes not exists")
else: else:
folders = os.listdir(path=absolute_path) folders = os.listdir(path=absolute_path)
print(folders)
if len(folders)==0: if len(folders)==0:
initial_folder="../#" initial_folder="../#"
else: else:
...@@ -178,6 +179,7 @@ def Reports(request): ...@@ -178,6 +179,7 @@ def Reports(request):
zip = zip_path+"/"+file zip = zip_path+"/"+file
print(zip) print(zip)
productList.append({ productList.append({
"search_name": producto['search__search_name'],
"process": producto['search__process_id__name'], "process": producto['search__process_id__name'],
"purchase_date": producto['aggreg_date'], "purchase_date": producto['aggreg_date'],
"startDate": producto['search__startDate'], "startDate": producto['search__startDate'],
......
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