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
...@@ -318,4 +318,41 @@ select::-ms-expand { ...@@ -318,4 +318,41 @@ select::-ms-expand {
border-top-color: #ffa74f; border-top-color: #ffa74f;
border-width: 11px; border-width: 11px;
margin-left: -11px; margin-left: -11px;
} }
\ No newline at end of file
/*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 %}
...@@ -130,7 +127,7 @@ ...@@ -130,7 +127,7 @@
<br> <br>
<ul class="sidebar-menu" data-widget="tree"> <ul class="sidebar-menu" data-widget="tree">
<li> <li>
<a class="treeview " href="{% url 'map' %}"> <a class="treeview " href="{% url 'map' %}">
<i class="fa fa-map"></i> <i class="fa fa-map"></i>
<span>Home</span> <span>Home</span>
<span class="pull-right-container"> <span class="pull-right-container">
...@@ -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>
...@@ -310,15 +314,16 @@ ...@@ -310,15 +314,16 @@
<div id="map" class="map"></div> <div id="map" class="map"></div>
</div> </div>
<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>
......
This diff is collapsed.
...@@ -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