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
f1909472
Commit
f1909472
authored
Nov 14, 2019
by
Luis Dominguez
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of gitlab.geoint.mx:mario.chirinos/GeoInt_SIDT into dev
parents
a02fb58a
79df01e2
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
311 additions
and
97 deletions
+311
-97
sidtMap.js
catalog/static/catalog/js/sidtMap.js
+17
-0
base_top.html
catalog/templates/base_top.html
+2
-1
map.html
catalog/templates/map.html
+1
-0
crossrange.css
reports/static/reports/css/crossrange.css
+93
-1
scldata.css
reports/static/reports/css/scldata.css
+38
-1
Reports.html
reports/templates/Reports.html
+22
-17
sclData.html
reports/templates/sclData.html
+110
-72
views.py
reports/views.py
+28
-5
No files found.
catalog/static/catalog/js/sidtMap.js
View file @
f1909472
...
@@ -182,6 +182,23 @@ sidtMap.prototype.changeInteraction = function() {
...
@@ -182,6 +182,23 @@ sidtMap.prototype.changeInteraction = function() {
this
.
map
.
addInteraction
(
this
.
interaction
);
this
.
map
.
addInteraction
(
this
.
interaction
);
}
}
// this shit is really hack hahahahah
sidtMap
.
prototype
.
listenShiftButton
=
function
()
{
inDown
=
(
evt
)
=>
{
if
(
evt
.
key
!=
"Shift"
||
evt
.
keyCode
!=
16
||
this
.
interaction
.
geometryFunction_
.
name
===
"r"
)
return
;
this
.
interaction
.
geometryFunction_
=
new
ol
.
interaction
.
Draw
.
createRegularPolygon
(
4
);
}
inUp
=
(
evt
)
=>
{
if
(
evt
.
key
!=
"Shift"
||
evt
.
keyCode
!=
16
||
this
.
interaction
.
geometryFunction_
.
name
===
"r"
)
return
;
this
.
interaction
.
geometryFunction_
=
new
ol
.
interaction
.
Draw
.
createRegularPolygon
(
4
,
Math
.
PI
/
4
);
};
document
.
addEventListener
(
'keydown'
,
inDown
);
document
.
addEventListener
(
'keyup'
,
inUp
);
}
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
sidtMap
.
prototype
.
onMousemove
=
function
(
e
)
sidtMap
.
prototype
.
onMousemove
=
function
(
e
)
{
{
...
...
catalog/templates/base_top.html
View file @
f1909472
...
@@ -33,7 +33,8 @@
...
@@ -33,7 +33,8 @@
<link
rel=
"stylesheet"
href=
"{% static 'catalog/adminlte/bower_components/guides-master/dist/guides.css' %}"
>
<link
rel=
"stylesheet"
href=
"{% static 'catalog/adminlte/bower_components/guides-master/dist/guides.css' %}"
>
</head>
</head>
<body
class=
"hold-transition skin-yellow sidebar-mini"
>
<body
style=
"overflow: hidden;"
class=
"hold-transition skin-yellow sidebar-mini"
>
<!-- <div id="map" class="map" tabindex="0"> </div>-->
<!-- <div id="map" class="map" tabindex="0"> </div>-->
<!-- <iframe id="catalogFrame" name="catalogFrame">my frame</iframe>-->
<!-- <iframe id="catalogFrame" name="catalogFrame">my frame</iframe>-->
...
...
catalog/templates/map.html
View file @
f1909472
...
@@ -368,6 +368,7 @@
...
@@ -368,6 +368,7 @@
var
osmap
=
new
sidtMap
(
"map"
,
-
89.63873079999999
,
21.0404457
,
7
);
var
osmap
=
new
sidtMap
(
"map"
,
-
89.63873079999999
,
21.0404457
,
7
);
osmap
.
geolocation
();
osmap
.
geolocation
();
osmap
.
addInteraction
();
osmap
.
addInteraction
();
osmap
.
listenShiftButton
();
var
req_url
=
"{% url 'search-submit' %}"
;
// url for requesting polygon data
var
req_url
=
"{% url 'search-submit' %}"
;
// url for requesting polygon data
var
prod_req_url
=
"{% url 'productList' %}"
;
// url for requesting product data
var
prod_req_url
=
"{% url 'productList' %}"
;
// url for requesting product data
...
...
reports/static/reports/css/crossrange.css
View file @
f1909472
.cross-range
{
input
[
type
=
range
]
{
height
:
6px
;
-webkit-appearance
:
none
;
margin
:
6px
0
;
width
:
100%
;
}
input
[
type
=
range
]
:focus
{
outline
:
none
;
}
input
[
type
=
range
]
::-webkit-slider-runnable-track
{
width
:
100%
;
height
:
14px
;
cursor
:
pointer
;
animate
:
0.2s
;
box-shadow
:
1px
1px
1px
#50555C
;
background
:
#50555C
;
border-radius
:
14px
;
border
:
0px
solid
#000000
;
}
input
[
type
=
range
]
::-webkit-slider-thumb
{
box-shadow
:
0px
0px
0px
#000000
;
border
:
0px
solid
#000000
;
height
:
20px
;
width
:
40px
;
border-radius
:
12px
;
background
:
#dc7828
;
cursor
:
pointer
;
-webkit-appearance
:
none
;
margin-top
:
-3px
;
}
input
[
type
=
range
]
:focus::-webkit-slider-runnable-track
{
background
:
#50555C
;
}
input
[
type
=
range
]
::-moz-range-track
{
width
:
100%
;
height
:
14px
;
cursor
:
pointer
;
animate
:
0.2s
;
box-shadow
:
1px
1px
1px
#50555C
;
background
:
#50555C
;
border-radius
:
14px
;
border
:
0px
solid
#000000
;
}
input
[
type
=
range
]
::-moz-range-thumb
{
box-shadow
:
0px
0px
0px
#000000
;
border
:
0px
solid
#000000
;
height
:
20px
;
width
:
40px
;
border-radius
:
12px
;
background
:
#529DE1
;
cursor
:
pointer
;
}
input
[
type
=
range
]
::-ms-track
{
width
:
100%
;
height
:
14px
;
cursor
:
pointer
;
animate
:
0.2s
;
background
:
transparent
;
border-color
:
transparent
;
color
:
transparent
;
}
input
[
type
=
range
]
::-ms-fill-lower
{
background
:
#50555C
;
border
:
0px
solid
#000000
;
border-radius
:
28px
;
box-shadow
:
1px
1px
1px
#50555C
;
}
input
[
type
=
range
]
::-ms-fill-upper
{
background
:
#50555C
;
border
:
0px
solid
#000000
;
border-radius
:
28px
;
box-shadow
:
1px
1px
1px
#50555C
;
}
input
[
type
=
range
]
::-ms-thumb
{
margin-top
:
1px
;
box-shadow
:
0px
0px
0px
#000000
;
border
:
0px
solid
#000000
;
height
:
20px
;
width
:
40px
;
border-radius
:
12px
;
background
:
#529DE1
;
cursor
:
pointer
;
}
input
[
type
=
range
]
:focus::-ms-fill-lower
{
background
:
#50555C
;
}
input
[
type
=
range
]
:focus::-ms-fill-upper
{
background
:
#50555C
;
}
/*.cross-range {
-webkit-appearance: none;
-webkit-appearance: none;
width: 100%;
width: 100%;
margin: 4.05px 0;
margin: 4.05px 0;
...
@@ -89,3 +180,4 @@
...
@@ -89,3 +180,4 @@
padding-left: 10px;
padding-left: 10px;
padding-right: 10px;
padding-right: 10px;
}
}
*/
\ No newline at end of file
reports/static/reports/css/scldata.css
View file @
f1909472
...
@@ -318,4 +318,41 @@ select::-ms-expand {
...
@@ -318,4 +318,41 @@ select::-ms-expand {
border-top-color
:
#ffa74f
;
border-top-color
:
#ffa74f
;
border-width
:
11px
;
border-width
:
11px
;
margin-left
:
-11px
;
margin-left
:
-11px
;
}
}
\ No newline at end of file
/*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.3
);
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.3
);
font-size
:
60px
;
z-index
:
100
;
}
.fas.fa-chevron-left
:hover
{
color
:
blue
;
}
.fas.fa-chevron-right
:hover
{
color
:
blue
;
}
\ No newline at end of file
reports/templates/Reports.html
View file @
f1909472
...
@@ -25,9 +25,6 @@
...
@@ -25,9 +25,6 @@
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
</script>
</script>
{% endblock %}
{% endblock %}
{% block messages %}
{% block messages %}
...
@@ -130,7 +127,7 @@
...
@@ -130,7 +127,7 @@
<br>
<br>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<li>
<li>
<a
class=
"treeview "
href=
"{%
url 'map' %}"
>
<a
class=
"treeview "
href=
"{% url 'map' %}"
>
<i
class=
"fa fa-map"
></i>
<i
class=
"fa fa-map"
></i>
<span>
Home
</span>
<span>
Home
</span>
<span
class=
"pull-right-container"
>
<span
class=
"pull-right-container"
>
...
@@ -189,11 +186,14 @@
...
@@ -189,11 +186,14 @@
{% for product in productList %}
{% for product in productList %}
<tr>
<tr>
<td>
<td>
<a
href=
"#"
id=
"title{{ product.purchase_id }}"
data-toggle=
"popover"
data-trigger=
"hover"
<a
href=
"#"
id=
"title{{ product.purchase_id }}"
data-toggle=
"popover"
data-content=
"{% if product.description %}{{ product.description }}{% else %}Without Description{% endif %}"
data-trigger=
"hover"
data-content=
"
{% if product.description %}{{ product.description }}{% else %}Without Description{% endif %}"
onclick=
"showMyModalSetTitle('{{ product.search_name }}','{{ product.polygon }}');"
>
{{ product.search_name }}
</a>
onclick=
"showMyModalSetTitle('{{ product.search_name }}','{{ product.polygon }}');"
>
{{ product.search_name }}
</a>
<a
href=
"#"
onclick=
"showEditModal('{{ product.search_name }}','{{ product.description }}','{{ product.purchase_id }}')"
><span
<a
href=
"#"
onclick=
"showEditModal('{{ product.search_name }}','{{ product.description }}','{{ product.purchase_id }}')"
><span
class=
"fas fa-pencil-alt"
class=
"fas fa-pencil-alt"
style=
"margin:3px 0 0 0"
></span></a>
style=
"margin:3px 0 0 0"
></span></a>
</td>
</td>
...
@@ -237,14 +237,18 @@
...
@@ -237,14 +237,18 @@
href=
"../../static/reports/tmpImages/repsat_test_dev/{{ request.user.email }}/{{ product.purchase_id }}/myzip.zip"
href=
"../../static/reports/tmpImages/repsat_test_dev/{{ request.user.email }}/{{ product.purchase_id }}/myzip.zip"
{%
else
%}
{%
else
%}
href=
"#"
href=
"#"
{%
endif
%}
class=
"btn btn-warning btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4"
>
{%
endif
%}
class=
"btn btn-warning btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4"
>
<i
class=
"fa fa-file-zip-o"
></i>
<i
class=
"fa fa-file-zip-o"
></i>
</a>
</a>
<a
title=
"Download PDF"
{%
if
product
.
progress =
=
100
%}
<a
title=
"Download PDF"
{%
if
product
.
progress =
=
100
%}
href=
"{% url 'PDF' product.purchase_id %}"
href=
"{% url 'PDF' product.purchase_id %}"
{%
else
%}
{%
else
%}
href=
"#"
href=
"#"
{%
endif
%}
class=
"btn btn-info btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4"
target=
"_blank"
download=
"{{ product.search_name }} ({{ product.purchase_date }}).pdf"
>
{%
endif
%}
class=
"btn btn-info btn-sm col-md-4 col-xs-4 col-sm-4 col-lg-4 col-xl-4"
target=
"_blank"
download=
"{{ product.search_name }} ({{ product.purchase_date }}).pdf"
>
<i
class=
"fa fa-file-pdf-o"
></i>
<i
class=
"fa fa-file-pdf-o"
></i>
</a>
</a>
<!--a title="View Log" href="#" class="btn btn-info"
<!--a title="View Log" href="#" class="btn btn-info"
...
@@ -263,7 +267,7 @@
...
@@ -263,7 +267,7 @@
<!-- /.content -->
<!-- /.content -->
</div>
</div>
<!-- Footer -->
<!-- Footer -->
<footer
class=
" page-footer font-small special-color-dark pt-5"
>
<footer
class=
" page-footer font-small special-color-dark pt-5"
>
<!-- Footer Elements -->
<!-- Footer Elements -->
<div
class=
"container"
>
<div
class=
"container"
>
</div>
</div>
...
@@ -310,15 +314,16 @@
...
@@ -310,15 +314,16 @@
<div
id=
"map"
class=
"map"
></div>
<div
id=
"map"
class=
"map"
></div>
</div>
</div>
<div
class=
"modal-footer"
>
<div
class=
"modal-footer"
>
<div
align =
"left"
>
<div
align=
"left"
>
<textarea
id
=
"polygonText"
readonly
rows=
"5"
style=
"width: 61em; resize:none; font-size: 7pt;"
>
<textarea
id=
"polygonText"
readonly
rows=
"5"
style=
"width: 61em; resize:none; font-size: 7pt;"
>
POLYGON
POLYGON
</textarea>
</textarea>
</div>
</div>
<button
style=
"float: left; type="
button
"
class=
"btn btn-default"
onclick=
"copyPolygonText()"
>
Copy polygon
</button>
<button
style=
"float: left; type="
button
"
class=
"btn btn-default"
onclick=
"copyPolygonText()"
>
Copy polygon
</button>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
</div>
</div>
</div>
</div>
...
...
reports/templates/sclData.html
View file @
f1909472
This diff is collapsed.
Click to expand it.
reports/views.py
View file @
f1909472
...
@@ -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
,
progress
=
100
)
else
:
product_list
=
Purchase
.
objects
.
values
(
'id'
)
.
filter
(
is_public
=
True
,
progress
=
100
,
user__email
=
email
)
for
producto
in
product_list
:
if
os
.
path
.
exists
(
USERS_PATH
+
email
+
'/'
+
str
(
producto
[
'id'
])
+
'/scl_data.json'
):
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