Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GeoInt_SIDT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mario Chirinos Colunga
GeoInt_SIDT
Commits
09251807
Commit
09251807
authored
May 23, 2018
by
Renán Sosa Guillen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prueba
parent
9f18a1d6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
66 additions
and
17 deletions
+66
-17
settings.py
GeoInt_SIDT/settings.py
+3
-0
settings.pyc
GeoInt_SIDT/settings.pyc
+0
-0
dataRetrieval.js
catalog/static/js/dataRetrieval.js
+42
-0
base_top.html
catalog/templates/base_top.html
+1
-1
map.html
catalog/templates/map.html
+18
-14
views.py
catalog/views.py
+2
-2
views.pyc
catalog/views.pyc
+0
-0
No files found.
GeoInt_SIDT/settings.py
View file @
09251807
...
@@ -121,6 +121,9 @@ USE_TZ = True
...
@@ -121,6 +121,9 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/1.10/howto/static-files/
# https://docs.djangoproject.com/en/1.10/howto/static-files/
STATICFILES_DIRS
=
[
os
.
path
.
join
(
BASE_DIR
,
"static"
),
]
STATIC_URL
=
'/static/'
STATIC_URL
=
'/static/'
# Redirect to home URL after login (Default redirects to /accounts/profile/)
# Redirect to home URL after login (Default redirects to /accounts/profile/)
...
...
GeoInt_SIDT/settings.pyc
View file @
09251807
No preview for this file type
catalog/static/js/dataRetrieval.js
0 → 100644
View file @
09251807
// Get the <datalist> and <input> elements.
var
input
=
document
.
getElementById
(
'ajax-input'
);
var
value
=
input
;
var
dataList
=
document
.
getElementById
(
'polygon-list'
);
console
.
log
(
input
);
// Create a new XMLHttpRequest.
var
request
=
new
XMLHttpRequest
();
// Handle state changes for the request.
request
.
onreadystatechange
=
function
(
response
)
{
if
(
request
.
readyState
===
4
)
{
if
(
request
.
status
===
200
)
{
// Parse the JSON
var
jsonOptions
=
JSON
.
parse
(
request
.
responseText
);
// Loop over the JSON array.
jsonOptions
.
forEach
(
function
(
item
)
{
// Create a new <option> element.
var
option
=
document
.
createElement
(
'option'
);
// Set the value using the item in the JSON array.
option
.
value
=
item
;
// Add the <option> element to the <datalist>.
dataList
.
appendChild
(
option
);
});
// Update the placeholder text.
input
.
placeholder
=
"Search..."
;
}
else
{
// An error occured :(
input
.
placeholder
=
"Couldn't load datalist options :("
;
}
}
};
// Update the placeholder text.
input
.
placeholder
=
"Loading options..."
;
// Set up and make the request.
request
.
open
(
'POST'
,
'http://localhost:8080/catalog/searchsubmit/'
,
true
);
request
.
send
({
value
:
value
});
\ No newline at end of file
catalog/templates/base_top.html
View file @
09251807
...
@@ -195,7 +195,7 @@
...
@@ -195,7 +195,7 @@
<script
src=
"{% static 'adminlte/dist/js/adminlte.min.js' %}"
></script>
<script
src=
"{% static 'adminlte/dist/js/adminlte.min.js' %}"
></script>
{% block scripts %}{% endblock %}
{% block scripts %}{% endblock %}
<script
src=
"{% static 'js/dataRetrieval.js' %}"
type=
"text/javascript"
></script>
</body>
</body>
</html>
</html>
catalog/templates/map.html
View file @
09251807
{% extends "base_top.html" %}
{% extends "base_top.html" %}
{% load static %}
{% load static
files
%}
{% block headMedia %}
{% block headMedia %}
<link
rel=
"stylesheet"
href=
"{% static 'css/map.css'%}"
type=
"text/css"
>
<link
rel=
"stylesheet"
href=
"{% static 'css/map.css'%}"
type=
"text/css"
>
...
@@ -119,19 +119,23 @@
...
@@ -119,19 +119,23 @@
{% block sidebar %}
{% block sidebar %}
<div
class=
"form-group "
>
<div
class=
"form-group "
>
<!-- search form -->
<!-- search form -->
<form
role=
"form"
action=
"{% url 'search-submit' %}"
method=
"post"
class=
"sidebar-form"
>
<form
role=
"form"
action=
"{% url 'search-submit' %}"
method=
"post"
class=
"sidebar-form"
>
{% csrf_token %}
{% csrf_token %}
<div
class=
"input-group"
>
<div
class=
"input-group"
>
<input
type=
"text"
name=
"value"
class=
"form-control"
placeholder=
"Search..."
>
<input
type=
"text"
id=
"ajax-input"
list=
"polygon-list"
name=
"value"
class=
"form-control"
placeholder=
"Search..."
>
<span
class=
"input-group-btn"
>
<datalist
id=
"polygon-list"
>
<button
type=
"submit"
name=
"search"
id=
"search-btn"
class=
"btn btn-flat"
><i
class=
"fa fa-search"
></i>
<option
value=
"merida"
>
</button>
<option
value=
"otro"
>
</span>
</datalist>
</div>
<span
class=
"input-group-btn"
>
</form>
<button
type=
"submit"
name=
"search"
id=
"search-btn"
class=
"btn btn-flat"
><i
class=
"fa fa-search"
></i>
<!-- /.search form -->
</button>
<!-- sidebar menu: : style can be found in sidebar.less -->
</span>
</div>
</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' %}"
>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<!-- <li class="header">Filters</li>-->
<!-- <li class="header">Filters</li>-->
...
...
catalog/views.py
View file @
09251807
...
@@ -51,8 +51,8 @@ def productList(request):
...
@@ -51,8 +51,8 @@ def productList(request):
#-------------------------------------------------------------------------------
#-------------------------------------------------------------------------------
class
SearchSubmitView
(
View
):
class
SearchSubmitView
(
View
):
#
template = 'map.html'
template
=
'map.html'
template
=
'search_submit.html'
#
template = 'search_submit.html'
state_parser
=
{
'31'
:
"Yucatán"
}
state_parser
=
{
'31'
:
"Yucatán"
}
def
post
(
self
,
request
):
def
post
(
self
,
request
):
...
...
catalog/views.pyc
View file @
09251807
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment