Commit 850c28fc authored by Sergio Adrian Gongora Euan's avatar Sergio Adrian Gongora Euan

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

parents cb01ab71 8398c0b8
......@@ -16,9 +16,17 @@ class AuthRequiredMiddleware(object):
# if request.path_info == reverse('ws-news-list2'):
# return response
if not request.user.is_authenticated and request.path_info != reverse('login') and not request.user.is_active:
if request.path_info ==reverse('ipn'):
print(request.path_info)
elif not request.user.is_authenticated and request.path_info != reverse('login') and not request.user.is_active:
return HttpResponseRedirect(reverse('login'))
#if not request.user.is_authenticated and request.path_info != reverse('login') and not request.user.is_active:
#if not request.user.is_authenticated or not request.user.is_active:
# return HttpResponseRedirect(reverse('login'))
# Code to be executed for each request/response after
# the view is called.
......
......@@ -227,7 +227,7 @@
value='../reports'>
<input type='hidden' name='return'
value='../catalog/cart'>
<input type="hidden" name="notify_url" value="../catalog/ipn">
<input type="hidden" name="notify_url" value="http://repsat.geoint.mx/catalog/ipn/">
<input type="image"
src="https://www.sandbox.paypal.com/es_XC/MX/i/btn/btn_buynowCC_LG.gif"
border="0" name="submit"
......@@ -236,6 +236,18 @@
src="https://www.sandbox.paypal.com/es_XC/i/scr/pixel.gif" width="1"
height="1">
</form>
<form method="post" action="http://repsat.geoint.mx/catalog/ipn/">
<input type="text" name="nombre" value="">
<input type="submit">
</form>
<form method="post" action="../ipn/">
<input type="text" name="nombre" value="">
<input type="submit">
</form>
</td>
</tr>
</tfoot>
......
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render, redirect
from django.views.decorators.csrf import csrf_exempt
from GeoInt_SIDT.settings import BASE_URL
from catalog.forms import ASFSearchForm
......@@ -581,14 +582,22 @@ def Pay(request):
# -----------------------------------------------------------------
@csrf_exempt
def IPN(request):
print("content-type: text/html\r\n\r\n")
if request.POST['payment_status'] == 'Completed':
Purchase.objects.filter(user_id=request.user.id, purchased=0).update(purchased=True)
return redirect('../../reports')
else:
return redirect('../cart')
PATH_USERS = config['PATHS']['PATH_USERS']
print()
f = open(PATH_USERS+"myfile.txt", "w")
x = request.POST.dict()
for key, value in x.items():
f.write(key+": "+value+'\n')
return redirect('../../')
#print("content-type: text/html\r\n\r\n")
#if request.POST.get['payment_status'] == 'Completed':
# Purchase.objects.filter(user_id=request.user.id, purchased=0).update(purchased=True)
# return redirect('../../reports')
#else:
# return redirect('../cart')
# f.write(request.GET)
# f.close()
......
body
{
background-color:White;
body {
background-color: White;
}
.next{
padding: 0px;
padding-top: 50%;
cursor: pointer;
font-size: 20px;
.next {
padding: 0px;
padding-top: 50%;
cursor: pointer;
font-size: 20px;
}
.prev{
padding-left: 20px;
padding-top: 50%;
cursor: pointer;
font-size: 20px;
.prev {
padding-left: 20px;
padding-top: 50%;
cursor: pointer;
font-size: 20px;
}
.submenu{
padding-right: 140px !important;
.submenu {
padding-right: 140px !important;
}
.img-comp-container {
position: relative;
height: 550px; /*should be the same height as the images*/
position: relative;
height: 550px; /*should be the same height as the images*/
}
.listImg{
z-index: 4;
.listImg {
z-index: 4;
}
.listImg ul{
list-style: none;
padding: 0px;
margin: 0px;
cursor: pointer;
.listImg ul {
list-style: none;
padding: 0px;
margin: 0px;
cursor: pointer;
}
.listImg ul li:hover{
background: #87CEFA;
.listImg ul li:hover {
background: #87CEFA;
}
.listImg ul .active{
color:red
.listImg ul .active {
color: red
}
.list {
max-height: 220px;
overflow: auto;
max-height: 220px;
overflow: auto;
}
.img-comp-img {
position: absolute;
width: auto;
height: auto;
overflow:hidden;
z-index: 2;
position: absolute;
width: auto;
height: auto;
overflow: hidden;
z-index: 2;
}
.img-comp-img img {
display: block;
vertical-align: middle;
display: block;
vertical-align: middle;
}
.img-comp-slider {
position: absolute;
z-index:9;
cursor: ew-resize;
/*set the appearance of the slider:*/
width: 40px;
height: 40px;
background-color: #2196F3;
opacity: 0.7;
border-radius: 50%;
position: absolute;
z-index: 9;
cursor: ew-resize;
/*set the appearance of the slider:*/
width: 40px;
height: 40px;
background-color: #2196F3;
opacity: 0.7;
border-radius: 50%;
}
.draggable {
......@@ -87,22 +86,23 @@ body
}
.draggable:hover {
opacity: 1;
opacity: 1;
}
.title{
/*position: absolute; */
top: 2%;
left: 6%;
/*width:100%;
height: 100%; */
.title {
/*position: absolute; */
top: 2%;
left: 6%;
/*width:100%;
height: 100%; */
}
.title .info {
opacity: 0.5;
opacity: 0.5;
}
.title .info:hover{
opacity: 1;
.title .info:hover {
opacity: 1;
}
.minimap{
......@@ -124,3 +124,40 @@ body
height: 940px !important;
}
#rangecontrol:hover > #slidertitle {
display: block;
}
.range-control {
position: relative;
}
input[type=range] {
display: block;
width: 100%;
margin: 0;
-webkit-appearance: none;
outline: none;
}
input[type=range]::-webkit-slider-runnable-track {
position: relative;
height: 12px;
border: 1px solid #b2b2b2;
border-radius: 5px;
background-color: #e2e2e2;
box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.1);
}
input[type=range]::-webkit-slider-thumb {
position: relative;
top: 0px;
width: 10px;
height: 10px;
border: 1px solid #999;
-webkit-appearance: none;
background-color: green;
box-shadow: inset 0 -1px 2px 0 rgba(0, 0, 0, 0.25);
border-radius: 100%;
cursor: pointer;
}
\ No newline at end of file
......@@ -5,7 +5,8 @@
<link rel="stylesheet" href="{% static 'catalog/css/body.css' %}" type="text/css">
<link rel="stylesheet" href="{% static 'reports/css/scldata.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">
<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>
......@@ -116,7 +117,29 @@
<!-- Content Wrapper. Contains page content -->
<!-- Main content -->
<div id="reportPage" class="wrapper" style="background-color: #ecf0f5">
<div id="minimap" class="minimap"></div>
<div class="container floating-panel"
style="position:absolute;bottom: 40px;width: 500px;z-index: 1000">
<div class="range-control" id="rangecontrol">
<span id="tooltiptext">No Data</span>
<input id="inputRange" type="range" min="0" max="{{ labels|length }}"
step="1" value="0"
data-thumbwidth="20">
<datalist class="range__list" id="number">
<option>No Data</option>
{% for label in labels %}
<option class="range__opt"
value="{{ label }}">{{ label|slice:"6:8" }}/{{ label|slice:"4:6" }}/{{ label|slice:"0:4" }}</option>
{% endfor %}
</datalist>
</div>
</div>
<div id="minimap"></div>
<section class="content">
<div class="row col-lg-11 title">
......@@ -231,6 +254,52 @@
<!-- /.content -->
{% endblock %}
{% block scripts %}
<script id="rendered-js">
$('input[type="range"]').on('input', function () {
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;
slider2.addEventListener('mousemove', function (event) {
var currentMouseXPos = (event.clientX + window.pageXOffset) - sliderOffsetX;
var sliderValAtPos = Math.round(currentMouseXPos / sliderWidth * {{ labels|length }}+1);
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 defaultLegendClickHandler = Chart.defaults.global.legend.onClick;
......@@ -245,7 +314,7 @@
console.log(meta.hidden)
var layer = legendItem.text.toLowerCase();
//layer = layer.replace(" ", "_");
layer = layer.replace(/\s/g,'_'); //reeemplaza los espacios con guion bajo
layer = layer.replace(/\s/g, '_'); //reeemplaza los espacios con guion bajo
console.log(layer)
var activePoint = ch.getElementAtEvent(e);
......@@ -264,10 +333,10 @@
// document.getElementById("scl_"+layer).src = ""
// }
//if (index > 1) {
// Do the original logic
//console.log("wooooo")
//defaultLegendClickHandler(e, legendItem);
defaultLegendClickHandler.call(this, e, legendItem);
// Do the original logic
//console.log("wooooo")
//defaultLegendClickHandler(e, legendItem);
defaultLegendClickHandler.call(this, e, legendItem);
//} else {
// console.log("holaaaa")
//}
......@@ -284,7 +353,7 @@
let productLevel = "{{ productLevel }}";
let startDate = "{{ startDate }}";
let endDate = "{{ endDate }}";
let clouds= "{{ clouds }}";
let clouds = "{{ clouds }}";
let oldLabel = "{{defaultDataSet}}";
let labels = {{labels}};
var config = {{graphData}};
......@@ -294,7 +363,7 @@
maintainAspectRatio: false,
// scales: { xAxes: [{ stacked: true }], yAxes: [{ stacked: true }] },
legend: {
display:true,
display: true,
onClick: newLegendClickHandler,
}
};
......
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