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
cc9460ea
Commit
cc9460ea
authored
May 03, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab.geoint.mx/mario.chirinos/GeoInt_SIDT
into dev
parents
865fc95e
ce282281
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
14 deletions
+69
-14
forms.py
catalog/forms.py
+9
-2
base_top.html
catalog/templates/base_top.html
+5
-1
fengyuanchen_datepicker.html
catalog/templates/fengyuanchen_datepicker.html
+10
-0
map.html
catalog/templates/map.html
+19
-10
widgets.py
catalog/widgets.py
+4
-0
reportImg.js
reports/static/reports/js/reportImg.js
+22
-1
No files found.
catalog/forms.py
View file @
cc9460ea
...
...
@@ -8,6 +8,7 @@ from catalog.models import Process
#from django.contrib.auth.forms import UserCreationForm
#from django.contrib.auth.models import User
#from buscador.models import Investigador, Reto
from
.widgets
import
FengyuanChenDatePickerInput
all_process
=
Process
.
objects
.
filter
(
status
=
True
)
...
...
@@ -21,7 +22,13 @@ for each_process in all_process:
class
ASFSearchForm
(
forms
.
Form
):
polygon
=
forms
.
CharField
(
widget
=
forms
.
TextInput
(
attrs
=
{
'class'
:
"form-control"
}))
platform
=
forms
.
ChoiceField
(
choices
=
platforms
,
widget
=
forms
.
Select
(
attrs
=
{
'class'
:
"form-control"
}))
start
=
forms
.
DateField
(
widget
=
forms
.
DateInput
(
attrs
=
{
'type'
:
'date'
}),
required
=
True
)
end
=
forms
.
DateField
(
initial
=
datetime
.
date
.
today
,
widget
=
forms
.
DateInput
(
attrs
=
{
'type'
:
'date'
}),
required
=
True
)
start
=
forms
.
DateField
(
widget
=
FengyuanChenDatePickerInput
(),
required
=
True
)
end
=
forms
.
DateField
(
widget
=
FengyuanChenDatePickerInput
(),
required
=
True
)
maxResults
=
forms
.
IntegerField
()
catalog/templates/base_top.html
View file @
cc9460ea
...
...
@@ -25,6 +25,9 @@
<link
rel=
"stylesheet"
href=
"https://use.fontawesome.com/releases/v5.7.2/css/all.css"
integrity=
"sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
crossorigin=
"anonymous"
>
<!-- Fengyuan Chen's Datepicker -->
<link
rel=
"stylesheet"
href=
"https://cdnjs.cloudflare.com/ajax/libs/datepicker/0.6.5/datepicker.min.css"
integrity=
"sha256-b88RdwbRJEzRx95nCuuva+hO5ExvXXnpX+78h8DjyOE="
crossorigin=
"anonymous"
/>
{% block headMedia %}{% endblock %}
</head>
<body
class=
"hold-transition skin-yellow sidebar-mini"
>
...
...
@@ -205,7 +208,8 @@
<script
src=
"{% static 'catalog/js/dataRetrieval.js' %}"
type=
"text/javascript"
></script>
<!-- Chartsjs -->
<script
src=
"{% static 'catalog/js/Chart.min.js' %}"
type=
"text/javascript"
></script>
<!-- Fengyuan Chen's Datepicker -->
<script
src=
"https://cdnjs.cloudflare.com/ajax/libs/datepicker/0.6.5/datepicker.min.js"
integrity=
"sha256-/7FLTdzP6CfC1VBAj/rsp3Rinuuu9leMRGd354hvk0k="
crossorigin=
"anonymous"
></script>
{% block footer %}{% endblock %}
{% block scripts %}{% endblock %}
<div
id=
"ol"
></div>
...
...
catalog/templates/fengyuanchen_datepicker.html
0 → 100644
View file @
cc9460ea
{% include "django/forms/widgets/input.html" %}
<script>
$
(
function
()
{
$
(
"input[name='{{ widget.name }}']"
).
datepicker
({
format
:
'yyyy-mm-dd'
,
autoHide
:
true
});
});
</script>
\ No newline at end of file
catalog/templates/map.html
View file @
cc9460ea
...
...
@@ -187,16 +187,24 @@
<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>
<ul
class=
"treeview-menu sidebar-form"
>
<li>
<input
class=
"form-text"
id=
"clouds"
value=
"5"
oninput=
"setCloudPercentageSlider(this.value)"
name=
"cloudPercentage"
disabled
>
<input
class=
"cross-range"
type=
"range"
min=
"0"
max=
"100"
step=
"1"
value=
"5"
oninput=
"setCloudPercentage(this.value)"
id=
"cloudPercentageSelector"
name=
cloudPercentage
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
<ul
class=
"treeview-menu sidebar-form"
>
<li>
<div
class=
"row"
>
<div
class=
"col-lg-9"
style=
"padding-top: 5px;"
>
<input
class=
"cross-range"
type=
"range"
min=
"0"
max=
"100"
step=
"1"
value=
"5"
oninput=
"setCloudPercentage(this.value)"
id=
"cloudPercentageSelector"
name=
"cloudPercentage"
>
</div>
<div
class=
"col-lg-3"
style=
"padding-left:0px;padding-top: 5px;"
>
<!-- <input class="form-text" id="clouds" value="5" oninput="setCloudPercentageSlider(this.value)" name="cloudPercentage" disabled> -->
<span
id=
"clouds"
>
5
</span>
</div>
</div>
</li>
</ul>
</li>
</ul>
</li>
<li>
<a
href=
"#"
><div
class=
"modal"
>
<!-- Place at bottom of page -->
</div>
<span>
...
...
@@ -328,7 +336,8 @@
function
setCloudPercentage
(
clouds
)
{
//console.log(clouds)
document
.
getElementById
(
"clouds"
).
value
=
clouds
;
//document.getElementById("clouds").value = clouds;
document
.
getElementById
(
"clouds"
).
innerHTML
=
clouds
;
}
function
setCloudPercentageSlider
(
clouds
)
{
//console.log(clouds)
...
...
catalog/widgets.py
0 → 100644
View file @
cc9460ea
from
django.forms
import
DateInput
class
FengyuanChenDatePickerInput
(
DateInput
):
template_name
=
'fengyuanchen_datepicker.html'
\ No newline at end of file
reports/static/reports/js/reportImg.js
View file @
cc9460ea
...
...
@@ -145,11 +145,32 @@ function change(newType) {
// Remove the old chart and all its event handles
if
(
myChart
)
{
myChart
.
destroy
();
}
// Chart.js modifies the object you pass in. Pass a copy of the object so we can use the original object later
// -------------- set last values when the chart was destroyed ------
let
selectedLayers
=
getSelectedLayersName
().
map
(
layerName
=>
{
const
layerCheckbox
=
$
(
':checkbox[value='
+
layerName
+
']'
);
return
layerCheckbox
.
parent
().
attr
(
'id'
)
});
selectedLayers
=
selectedLayers
.
filter
(
layerId
=>
layerId
!=
null
);
selectedLayers
=
selectedLayers
.
map
(
layerId
=>
layerId
.
replace
(
'sclcheck-'
,
''
).
replace
(
'-'
,
' '
));
config
.
data
.
datasets
.
forEach
(
data
=>
{
const
label
=
data
.
label
.
toLowerCase
().
replace
(
'-'
,
' '
);
data
.
hidden
=
true
;
if
(
selectedLayers
.
includes
(
label
))
{
data
.
hidden
=
false
;
}
})
// -------------------------------------------------------------------
var
temp
=
jQuery
.
extend
(
true
,
{},
config
);
if
(
newType
==
"stackedBar"
){
temp
.
type
=
"bar"
;
...
...
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