Commit c65082e0 authored by Renán Sosa Guillen's avatar Renán Sosa Guillen

left bar menu updated

parent 90d4d639
......@@ -3,7 +3,11 @@ from django import forms
#from django.contrib.auth.forms import UserCreationForm
#from django.contrib.auth.models import User
#from buscador.models import Investigador, Reto
platforms = [("ALOS","ALOS"),("A3","A3"),("AIRSAR","AIRSAR")]
platforms = [
("vegIndex","Vegetation index"),
("waterBodies","Water bodies"),
("urbanSprawl","Urban sprawl")
]
#ALOS, A3, AIRSAR, AS, ERS-1, E1, ERS-2, E2, JERS-1, J1, RADARSAT-1, R1, SEASAT, SS, Sentinel-1A, SA, Sentinel-1B, SB, SMAP, SP, UAVSAR, UA.
class ASFSearchForm(forms.Form):
polygon = forms.CharField(widget=forms.TextInput(attrs={'class':"form-control"}))
......
......@@ -25,13 +25,11 @@ body
/*--------option list classes--------*/
#option-list {
margin-top: 3px;
margin-top: 8px;
display: none;
position: absolute;
border-radius: 3px;
background-color: white;
/*width: 208px;*/
/*max-height: 173px;*/
width: 400px;
max-height: 541px;
overflow: auto;
......
......@@ -48,7 +48,7 @@ var makeRequest = function (value) {
$.ajax({
type: "POST",
url: "http://localhost:8080/catalog/searchsubmit/",
url: req_url,
data: {
'csrfmiddlewaretoken': document.getElementsByName('csrfmiddlewaretoken')[0].value,
'value': value
......
......@@ -10,6 +10,7 @@
<link rel="stylesheet" href="{% static 'adminlte/bower_components/bootstrap/dist/css/bootstrap.min.css' %}">
<!-- Font Awesome -->
<link rel="stylesheet" href="{% static 'adminlte/bower_components/font-awesome/css/font-awesome.min.css' %}">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
<!-- Theme style -->
<link rel="stylesheet" href="{% static 'adminlte/dist/css/AdminLTE.css' %}">
<!-- AdminLTE Skins. Choose a skin from the css/skins folder instead of downloading all of them to reduce the load. -->
......
......@@ -118,16 +118,11 @@
{% endblock %}
{% block sidebar %}
<div class="form-group ">
<!-- search form -->
<form role="form" action="{% url 'search-submit' %}" method="post" class="sidebar-form">
{% csrf_token %}
<div class="input-group">
<input type="text" id="ajax-input" list="polygon-list" name="value" class="form-control" placeholder="Search...">
{# <datalist id="polygon-list">#}
{# <option value="merida">#}
{# <option value="otro">#}
{# </datalist>#}
<span class="input-group-btn">
<button type="submit" name="search" id="search-btn" class="btn btn-flat"><i class="fa fa-search"></i>
</button>
......@@ -141,13 +136,13 @@
</form>
<!-- /search form -->
<!-- sidebar menu: : style can be found in sidebar.less -->
<form role="form" target="catalogFrame" action="{% url 'productList' %}">
<form role="form" target="catalogFrame" action="{% url 'productList' %}" method="post">
{% csrf_token %}
<ul class="sidebar-menu" data-widget="tree">
<!-- <li class="header">Filters</li>-->
<li class="active treeview">
<a href="#">
<i class="fa fa-rocket"></i>
<span>Mission</span>
<i class="fa fa-sync-alt"></i>
<span>Process</span>
<span class="pull-right-container">
<span class="label label-primary pull-right"></span>
</span>
......@@ -158,7 +153,7 @@
</li>
<li class="treeview">
<a href="#">
<i class="fa fa-calendar"></i>
<i class="fa fa-calendar-alt"></i>
<span>Date Range</span>
<span class="pull-right-container">
<span class="label label-primary pull-right"></span>
......@@ -171,7 +166,7 @@
</li>
<li class="treeview ">
<a href="#">
<i class="fa fa-map-o"></i>
<i class="fa fa-map"></i>
<span>Polygon</span>
<span class="pull-right-container">
<span class="label label-primary pull-right"></span>
......@@ -181,22 +176,32 @@
<li>{{searchForm.polygon}}</li>
</ul>
</li>
<li><a href="#"><i class="fa fa-search"></i>
<li class="treeview ">
<a href="#">
<i class="fa fa-cloud"></i>
<span>Cloud percentage</span>
<span class="pull-right-container">
<span class="label label-primary pull-right"></span>
</span>
</a>
<input class="treeview-menu sidebar-form" type="text" name="cloudPercentage">
</ul>
</li>
<li>
<a href="#"><i class="fa fa-search"></i>
<span>
<button type="submit" name="search" id="search-btn" class="btn btn-primary">Search</button>
</span>
</a></li>
</a>
</li>
<li>
<iframe id="catalogFrame" name="catalogFrame">my frame</iframe>
</li>
</ul>
</form>
</div><!-- form-group-->
</div>
<!-- form-group-->
{% endblock %}
{% block user %}
......@@ -250,5 +255,6 @@
var osmap = new sidtMap("map", -89.63873079999999,21.0404457, 7);
osmap.geolocation();
osmap.addInteraction();
var req_url = "{% url 'search-submit' %}"; // url for requesting polygon data
</script>
{% endblock %}
......@@ -38,10 +38,11 @@ def productList(request):
View function for home page of site.
"""
r2 = dict(request.POST)
print r2
r2.pop('csrfmiddlewaretoken', None)
url = 'https://api.daac.asf.alaska.edu/services/search/param?'+urlencode(r2, 'utf-8')+"&output=JSON"
print url
# print url
# response = requests.get(url)
......@@ -106,7 +107,7 @@ class SearchSubmitView(View):
}
# rendered_template = template.render(context, request)
print("DATA:", data)
# print("DATA:", data)
# return HttpResponse(rendered_template, content_type='application/json')
# return HttpResponse(json.dumps(data, ensure_ascii=True), content_type='application/json')
return JsonResponse(data)
......
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