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
809214d6
Commit
809214d6
authored
Nov 13, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slider de reportes
parent
9ae0f876
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
151 additions
and
68 deletions
+151
-68
scldata.css
reports/static/reports/css/scldata.css
+31
-1
sclData.html
reports/templates/sclData.html
+92
-62
views.py
reports/views.py
+28
-5
No files found.
reports/static/reports/css/scldata.css
View file @
809214d6
...
@@ -319,3 +319,33 @@ select::-ms-expand {
...
@@ -319,3 +319,33 @@ select::-ms-expand {
border-width
:
11px
;
border-width
:
11px
;
margin-left
:
-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.5
);
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.5
);
font-size
:
60px
;
z-index
:
100
;
}
\ No newline at end of file
reports/templates/sclData.html
View file @
809214d6
...
@@ -120,16 +120,19 @@
...
@@ -120,16 +120,19 @@
{% block content %}
{% block content %}
<!-- Content Wrapper. Contains page content -->
<!-- Content Wrapper. Contains page content -->
<!-- Main content -->
<!-- Main content -->
<div
id=
"timeLine"
class=
"container floating-panel slidecontainer"
style=
"position:absolute; display:block; bottom: 40px; left: 12%; width: 500px; z-index: 1000"
>
<div
id=
"timeLine"
class=
"container floating-panel slidecontainer"
style=
"position:absolute; display:block; bottom: 40px; left: 12%; width: 500px; z-index: 1000"
>
<div
class=
"range-control"
id=
"rangecontrol"
>
<div
class=
"range-control"
id=
"rangecontrol"
>
<div
id=
"rangecontrol2"
></div>
<div
id=
"rangecontrol2"
></div>
<input
class=
"cross-range"
id=
"inputRange"
type=
"range"
min=
"0"
max=
"{{ labels|length|add:'-1' }}"
step=
"1"
value=
"0"
data-thumbwidth=
"20"
style=
"background: transparent;"
>
<input
class=
"cross-range"
id=
"inputRange"
type=
"range"
min=
"0"
max=
"{{ labels|length|add:'-1' }}"
step=
"1"
value=
"0"
data-thumbwidth=
"20"
style=
"background: transparent;"
>
<datalist
class=
"range__list"
id=
"number"
>
<datalist
class=
"range__list"
id=
"number"
>
{% for label in labels %}
{% for label in labels %}
<option
class=
"range__opt"
value=
"{{ label }}"
>
{{ label|slice:"6:8" }}/{{ label|slice:"4:6" }}/{{label|slice:"0:4" }}
</option>
<option
class=
"range__opt"
value=
"{{ label }}"
>
{{ label|slice:"6:8" }}/{{ label|slice:"4:6" }}/{{ label|slice:"0:4" }}
</option>
{% endfor %}
{% endfor %}
</datalist>
</datalist>
...
@@ -209,14 +212,19 @@
...
@@ -209,14 +212,19 @@
</div>
</div>
</div>
</div>
<div
id=
"reportPage"
class=
"wrapper"
style=
"background-color: #ecf0f5"
>
<div
id=
"reportPage"
class=
"wrapper"
style=
"background-color: #ecf0f5"
>
<div
id=
"minimap"
class=
"minimap"
></div>
<div
id=
"minimap"
class=
"minimap"
></div>
<section
class=
"content"
>
<section
class=
"content"
>
<a
href=
"#"
id=
"button_left"
title=
"Previous"
onclick=
"previus_report({{ request.path_info|slice:"
9:
"
}})"
><i
class=
"fas fa-chevron-left"
></i></a>
<a
href=
"#"
id=
"button_right"
title=
"Next"
onclick=
"next_report({{ request.path_info|slice:"
9:
"
}})"
><i
class=
"fas fa-chevron-right"
></i></a>
<div
class=
"row col-lg-11 title"
>
<div
class=
"row col-lg-11 title"
>
<div
class=
"box box-success box-solid info"
>
<div
class=
"box box-success box-solid info"
>
<div
class=
"box-header with-border"
>
<div
class=
"box-header with-border"
>
<h3>
{{ searchInfo.title }}, {{ searchInfo.startDate }} to {{ searchInfo.endDate}}
</h3>
<h3>
{{ searchInfo.title }}, {{ searchInfo.startDate }} to {{ searchInfo.endDate
}}
</h3>
<h6>
{{ searchInfo.report_name }}
</h6>
<h6>
{{ searchInfo.report_name }}
</h6>
<!-- /.box-tools -->
<!-- /.box-tools -->
</div>
</div>
...
@@ -377,8 +385,8 @@
...
@@ -377,8 +385,8 @@
$
(
"#tooltiptext"
).
empty
();
$
(
"#tooltiptext"
).
empty
();
$
(
"#tooltiptext"
).
append
(
fecha
);
$
(
"#tooltiptext"
).
append
(
fecha
);
$
(
"#rangecontrol2"
).
empty
();
$
(
"#rangecontrol2"
).
empty
();
$
(
"#rangecontrol2"
).
append
(
'<span class="arrow_box" id="tooltiptext">'
+
fecha
+
'</span>'
);
$
(
"#rangecontrol2"
).
append
(
'<span class="arrow_box" id="tooltiptext">'
+
fecha
+
'</span>'
);
$
(
'.arrow_box'
).
css
({
'left'
:
Math
.
round
(
pixelPostion
-
35
)
+
'px'
})
$
(
'.arrow_box'
).
css
({
'left'
:
Math
.
round
(
pixelPostion
-
35
)
+
'px'
})
});
});
$
(
'input[id="selectLeftCompare"]'
).
on
(
'input'
,
function
()
{
$
(
'input[id="selectLeftCompare"]'
).
on
(
'input'
,
function
()
{
...
@@ -400,13 +408,11 @@
...
@@ -400,13 +408,11 @@
var
pixelPostion
=
slider3
.
clientWidth
*
sliderPos
;
var
pixelPostion
=
slider3
.
clientWidth
*
sliderPos
;
$
(
"#tooltiptext2"
).
empty
();
$
(
"#tooltiptext2"
).
empty
();
$
(
"#tooltiptext2"
).
append
(
fecha
);
$
(
"#tooltiptext2"
).
append
(
fecha
);
$
(
"#rangecontrol3"
).
empty
();
$
(
"#rangecontrol3"
).
empty
();
$
(
"#rangecontrol3"
).
append
(
'<span class="arrow_box_left" id="tooltiptext2">'
+
fecha
+
'</span>'
);
$
(
"#rangecontrol3"
).
append
(
'<span class="arrow_box_left" id="tooltiptext2">'
+
fecha
+
'</span>'
);
$
(
'.arrow_box_left'
).
css
({
'left'
:
Math
.
round
(
pixelPostion
-
35
)
+
'px'
})
$
(
'.arrow_box_left'
).
css
({
'left'
:
Math
.
round
(
pixelPostion
-
35
)
+
'px'
})
});
});
...
@@ -429,13 +435,11 @@
...
@@ -429,13 +435,11 @@
var
pixelPostion
=
slider3
.
clientWidth
*
sliderPos
;
var
pixelPostion
=
slider3
.
clientWidth
*
sliderPos
;
$
(
"#tooltiptext3"
).
empty
();
$
(
"#tooltiptext3"
).
empty
();
$
(
"#tooltiptext3"
).
append
(
fecha
);
$
(
"#tooltiptext3"
).
append
(
fecha
);
$
(
"#rangecontrol4"
).
empty
();
$
(
"#rangecontrol4"
).
empty
();
$
(
"#rangecontrol4"
).
append
(
'<span class="arrow_box_right" id="tooltiptext3">'
+
fecha
+
'</span>'
);
$
(
"#rangecontrol4"
).
append
(
'<span class="arrow_box_right" id="tooltiptext3">'
+
fecha
+
'</span>'
);
$
(
'.arrow_box_right'
).
css
({
'left'
:
Math
.
round
(
pixelPostion
-
35
)
+
'px'
})
$
(
'.arrow_box_right'
).
css
({
'left'
:
Math
.
round
(
pixelPostion
-
35
)
+
'px'
})
});
});
</script>
</script>
...
@@ -444,7 +448,7 @@
...
@@ -444,7 +448,7 @@
const
legendOnClickHandler
=
function
(
e
,
legendItem
)
{
const
legendOnClickHandler
=
function
(
e
,
legendItem
)
{
const
index
=
legendItem
.
datasetIndex
;
const
index
=
legendItem
.
datasetIndex
;
const
ch
=
this
.
chart
;
const
ch
=
this
.
chart
;
const
checkbox_id
=
'#sclcheck-'
+
legendItem
.
text
.
toLowerCase
().
replace
(
/
\s
/g
,
'-'
);
const
checkbox_id
=
'#sclcheck-'
+
legendItem
.
text
.
toLowerCase
().
replace
(
/
\s
/g
,
'-'
);
// isDatasetVisible return the opposite status?
// isDatasetVisible return the opposite status?
if
(
ch
.
getDatasetMeta
(
index
).
hidden
===
null
)
{
if
(
ch
.
getDatasetMeta
(
index
).
hidden
===
null
)
{
...
@@ -454,7 +458,7 @@
...
@@ -454,7 +458,7 @@
}
}
ch
.
update
();
ch
.
update
();
const
layerInput
=
$
(
checkbox_id
+
" :input"
);
const
layerInput
=
$
(
checkbox_id
+
" :input"
);
layerInput
.
prop
(
"checked"
,
!
ch
.
getDatasetMeta
(
index
).
hidden
);
layerInput
.
prop
(
"checked"
,
!
ch
.
getDatasetMeta
(
index
).
hidden
);
...
@@ -472,10 +476,10 @@
...
@@ -472,10 +476,10 @@
return
;
return
;
}
}
datasets
.
forEach
(
function
(
data
)
{
datasets
.
forEach
(
function
(
data
)
{
let
checkbox_id
=
'#sclcheck-'
+
data
.
label
.
toLowerCase
().
replace
(
' '
,
'-'
);
let
checkbox_id
=
'#sclcheck-'
+
data
.
label
.
toLowerCase
().
replace
(
' '
,
'-'
);
$
(
checkbox_id
).
show
();
$
(
checkbox_id
).
show
();
$
(
checkbox_id
+
" :input"
).
prop
(
"checked"
,
false
);
$
(
checkbox_id
+
" :input"
).
prop
(
"checked"
,
false
);
});
});
}
}
...
@@ -485,7 +489,9 @@
...
@@ -485,7 +489,9 @@
Object
.
keys
(
inputs
).
forEach
(
key
=>
{
Object
.
keys
(
inputs
).
forEach
(
key
=>
{
let
value
=
inputs
[
key
].
value
;
let
value
=
inputs
[
key
].
value
;
if
(
value
)
{
values
.
push
(
value
)}
if
(
value
)
{
values
.
push
(
value
)
}
});
});
return
values
;
return
values
;
...
@@ -498,12 +504,12 @@
...
@@ -498,12 +504,12 @@
return
datasetsLabels
.
indexOf
(
id
);
return
datasetsLabels
.
indexOf
(
id
);
}
}
$
(
'input[name=layer_type]'
).
on
(
'click'
,
function
()
{
$
(
'input[name=layer_type]'
).
on
(
'click'
,
function
()
{
const
input
=
$
(
this
);
const
input
=
$
(
this
);
const
index
=
getChartDataIndex
(
input
.
parent
().
attr
(
'id'
));
const
index
=
getChartDataIndex
(
input
.
parent
().
attr
(
'id'
));
if
(
index
>
-
1
)
{
if
(
index
>
-
1
)
{
myChart
.
getDatasetMeta
(
index
).
hidden
=
!
input
.
prop
(
"checked"
);
myChart
.
getDatasetMeta
(
index
).
hidden
=
!
input
.
prop
(
"checked"
);
myChart
.
update
();
myChart
.
update
();
}
}
...
@@ -530,6 +536,7 @@
...
@@ -530,6 +536,7 @@
let
clouds
=
"{{ searchInfo.clouds }}"
;
let
clouds
=
"{{ searchInfo.clouds }}"
;
let
oldLabel
=
"{{defaultDataSet}}"
;
let
oldLabel
=
"{{defaultDataSet}}"
;
let
labels
=
{{
labels
}};
let
labels
=
{{
labels
}};
let
lista_productos
=
{{
lista
}}
var
config
=
{{
graphData
}};
var
config
=
{{
graphData
}};
let
polygon
=
"{{searchInfo.polygon}}"
let
polygon
=
"{{searchInfo.polygon}}"
...
@@ -545,6 +552,29 @@
...
@@ -545,6 +552,29 @@
showSCLcheckboxes
(
config
.
data
.
datasets
);
showSCLcheckboxes
(
config
.
data
.
datasets
);
{
%
endautoescape
%
}
{
%
endautoescape
%
}
function
next_report
(
number
)
{
let
index
=
lista_productos
.
indexOf
(
number
);
index
++
;
if
(
index
>=
lista_productos
.
length
)
index
=
0
;
console
.
log
(
lista_productos
[
index
]);
window
.
location
.
replace
(
"../reports/"
+
lista_productos
[
index
]);
}
function
previus_report
(
number
)
{
let
index
=
lista_productos
.
indexOf
(
number
);
index
--
;
if
(
index
<=
lista_productos
.
length
)
index
=
0
;
console
.
log
(
lista_productos
[
index
]);
window
.
location
.
replace
(
"../reports/"
+
lista_productos
[
index
]);
}
</script>
</script>
<script
type=
"text/javascript"
src=
"{% static 'reports/js/reportImg.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'reports/js/reportImg.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'reports/js/reportPdf.js' %}"
></script>
<script
type=
"text/javascript"
src=
"{% static 'reports/js/reportPdf.js' %}"
></script>
...
...
reports/views.py
View file @
809214d6
...
@@ -47,6 +47,7 @@ def report_L2ASCL(request, purchase_id):
...
@@ -47,6 +47,7 @@ def report_L2ASCL(request, purchase_id):
template
=
"sclData.html"
template
=
"sclData.html"
reporteDir
=
'mask'
reporteDir
=
'mask'
folders
=
""
folders
=
""
productList
=
[]
purchase
=
Purchase
.
objects
.
values
(
'user__email'
,
'is_public'
,
'name'
,
'search__search_name'
,
purchase
=
Purchase
.
objects
.
values
(
'user__email'
,
'is_public'
,
'name'
,
'search__search_name'
,
'search__process_id__name'
,
'description'
,
'aggreg_date'
)
.
get
(
pk
=
purchase_id
)
'search__process_id__name'
,
'description'
,
'aggreg_date'
)
.
get
(
pk
=
purchase_id
)
email
=
purchase
[
'user__email'
]
email
=
purchase
[
'user__email'
]
...
@@ -90,13 +91,34 @@ def report_L2ASCL(request, purchase_id):
...
@@ -90,13 +91,34 @@ def report_L2ASCL(request, purchase_id):
#PDFGenerator(request, path, reporteDir, datasets,searchInfo)
#PDFGenerator(request, path, reporteDir, datasets,searchInfo)
pass
pass
if
request
.
user
.
is_authenticated
:
product_list
=
Purchase
.
objects
.
values
(
'id'
)
.
filter
(
user_id__in
=
[
request
.
user
.
id
],
purchased
=
1
,
is_public
=
True
,
progress
=
100
)
else
:
product_list
=
Purchase
.
objects
.
values
(
'id'
)
.
filter
(
is_public
=
True
,
progress
=
100
,
user__email
=
email
)
for
producto
in
product_list
:
productList
.
append
(
producto
[
'id'
],
)
print
(
product_list
)
return
render
(
request
,
template
,
{
"graphData"
:
json
.
dumps
(
graphData
),
return
render
(
request
,
template
,
{
"graphData"
:
json
.
dumps
(
graphData
),
"searchInfo"
:
searchInfo
,
"IMAGE_PATH"
:
image_path
,
"searchInfo"
:
searchInfo
,
"IMAGE_PATH"
:
image_path
,
"SCL_PATH"
:
SCL_path
,
'dafaultLabel'
:
defaultLabel
,
"SCL_PATH"
:
SCL_path
,
'dafaultLabel'
:
defaultLabel
,
'defaultDataSet'
:
defaultDataset
,
"folders"
:
folders
,
'defaultDataSet'
:
defaultDataset
,
"folders"
:
folders
,
"zone"
:
reporteDir
,
"purchaseID"
:
purchase_id
,
"zone"
:
reporteDir
,
"purchaseID"
:
purchase_id
,
"labels"
:
graphData
[
'data'
][
'labels'
],
"labels"
:
graphData
[
'data'
][
'labels'
],
"email"
:
email
})
"email"
:
email
,
"lista"
:
productList
})
# -------------------------------------------------------------------------------def Reports(request):
# -------------------------------------------------------------------------------def Reports(request):
...
@@ -145,10 +167,11 @@ def Reports(request):
...
@@ -145,10 +167,11 @@ def Reports(request):
progress
=
60
progress
=
60
if
'Finalizing...'
in
open
(
log_info
)
.
read
():
if
'Finalizing...'
in
open
(
log_info
)
.
read
():
progress
=
100
progress
=
100
# item = Purchase.objects.filter(pk=producto['id'])
# item = Purchase.objects.get(pk=producto['id'])
#item = Purchase.objects.filter(pk=producto['id'])
# item.progress = progress
item
=
Purchase
.
objects
.
get
(
pk
=
producto
[
'id'
])
# item.save()
item
.
progress
=
progress
item
.
save
()
with
open
(
log_info
,
'r'
)
as
myfile
:
with
open
(
log_info
,
'r'
)
as
myfile
:
log
=
myfile
.
read
()
.
replace
(
'
\n
'
,
''
)
log
=
myfile
.
read
()
.
replace
(
'
\n
'
,
''
)
...
...
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