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() {
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)
{
......
......@@ -33,7 +33,8 @@
<link rel="stylesheet" href="{% static 'catalog/adminlte/bower_components/guides-master/dist/guides.css' %}">
</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>-->
<!-- <iframe id="catalogFrame" name="catalogFrame">my frame</iframe>-->
......
......@@ -368,6 +368,7 @@
var osmap = new sidtMap("map", -89.63873079999999, 21.0404457, 7);
osmap.geolocation();
osmap.addInteraction();
osmap.listenShiftButton();
var req_url = "{% url 'search-submit' %}"; // url for requesting polygon 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;
width: 100%;
margin: 4.05px 0;
......@@ -89,3 +180,4 @@
padding-left: 10px;
padding-right: 10px;
}
*/
\ No newline at end of file
......@@ -319,3 +319,40 @@ select::-ms-expand {
border-width: 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 @@
<script type="text/javascript">
</script>
{% endblock %}
{% block messages %}
......@@ -189,11 +186,14 @@
{% for product in productList %}
<tr>
<td>
<a href="#" id="title{{ product.purchase_id }}" data-toggle="popover" data-trigger="hover"
data-content="{% if product.description %}{{ product.description }}{% else %}Without Description{% endif %}"
<a href="#" id="title{{ product.purchase_id }}" data-toggle="popover"
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>
<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"
style="margin:3px 0 0 0"></span></a>
</td>
......@@ -237,14 +237,18 @@
href="../../static/reports/tmpImages/repsat_test_dev/{{ request.user.email }}/{{ product.purchase_id }}/myzip.zip"
{% else %}
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>
</a>
<a title="Download PDF" {% if product.progress == 100 %}
href="{% url 'PDF' product.purchase_id %}"
{% else %}
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>
</a>
<!--a title="View Log" href="#" class="btn btn-info"
......@@ -263,7 +267,7 @@
<!-- /.content -->
</div>
<!-- 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 -->
<div class="container">
</div>
......@@ -313,12 +317,13 @@
<div class="modal-footer">
<div align = "left">
<textarea id ="polygonText" readonly rows="5" style="width: 61em; resize:none; font-size: 7pt;">
<div align="left">
<textarea id="polygonText" readonly rows="5" style="width: 61em; resize:none; font-size: 7pt;">
POLYGON
</textarea>
</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>
</div>
</div>
......
This diff is collapsed.
......@@ -47,6 +47,7 @@ def report_L2ASCL(request, purchase_id):
template = "sclData.html"
reporteDir = 'mask'
folders = ""
productList = []
purchase = Purchase.objects.values('user__email', 'is_public', 'name', 'search__search_name',
'search__process_id__name','description','aggreg_date').get(pk=purchase_id)
email = purchase['user__email']
......@@ -90,13 +91,34 @@ def report_L2ASCL(request, purchase_id):
#PDFGenerator(request, path, reporteDir, datasets,searchInfo)
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),
"searchInfo": searchInfo, "IMAGE_PATH": image_path,
"SCL_PATH": SCL_path, 'dafaultLabel': defaultLabel,
'defaultDataSet': defaultDataset, "folders": folders,
"zone": reporteDir, "purchaseID": purchase_id,
"labels": graphData['data']['labels'],
"email": email})
"email": email,"lista":productList})
# -------------------------------------------------------------------------------def Reports(request):
......@@ -145,10 +167,11 @@ def Reports(request):
progress = 60
if 'Finalizing...' in open(log_info).read():
progress = 100
# item = Purchase.objects.filter(pk=producto['id'])
# item = Purchase.objects.get(pk=producto['id'])
# item.progress = progress
# item.save()
#item = Purchase.objects.filter(pk=producto['id'])
item = Purchase.objects.get(pk=producto['id'])
item.progress = progress
item.save()
with open(log_info, 'r') as myfile:
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