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
1c67b6da
Commit
1c67b6da
authored
Mar 06, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
users
parent
c47c0b63
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
874 additions
and
674 deletions
+874
-674
0013_auto_20190227_1926.py
catalog/migrations/0013_auto_20190227_1926.py
+23
-0
0014_auto_20190227_1943.py
catalog/migrations/0014_auto_20190227_1943.py
+18
-0
0015_auto_20190227_2140.py
catalog/migrations/0015_auto_20190227_2140.py
+18
-0
index.html
...r_components/bootstrap-daterangepicker/website/index.html
+749
-669
Reports_scripts.js
reports/static/reports/js/Reports_scripts.js
+1
-1
Reports.html
reports/templates/Reports.html
+62
-3
views.py
reports/views.py
+3
-1
No files found.
catalog/migrations/0013_auto_20190227_1926.py
0 → 100644
View file @
1c67b6da
# Generated by Django 2.1.5 on 2019-02-27 19:26
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'catalog'
,
'0012_search_process'
),
]
operations
=
[
migrations
.
AddField
(
model_name
=
'purchase'
,
name
=
'progress'
,
field
=
models
.
IntegerField
(
default
=
0
),
),
migrations
.
AddField
(
model_name
=
'search'
,
name
=
'search_name'
,
field
=
models
.
TextField
(
null
=
True
),
),
]
catalog/migrations/0014_auto_20190227_1943.py
0 → 100644
View file @
1c67b6da
# Generated by Django 2.1.5 on 2019-02-27 19:43
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'catalog'
,
'0013_auto_20190227_1926'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'search'
,
name
=
'search_name'
,
field
=
models
.
TextField
(
default
=
'Drawn polygon'
),
),
]
catalog/migrations/0015_auto_20190227_2140.py
0 → 100644
View file @
1c67b6da
# Generated by Django 2.1.5 on 2019-02-27 21:40
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'catalog'
,
'0014_auto_20190227_1943'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'search'
,
name
=
'search_name'
,
field
=
models
.
TextField
(
default
=
'Drawn polygon '
),
),
]
catalog/static/catalog/adminlte/bower_components/bootstrap-daterangepicker/website/index.html
View file @
1c67b6da
This diff is collapsed.
Click to expand it.
reports/static/reports/js/Reports_scripts.js
View file @
1c67b6da
...
...
@@ -11,7 +11,7 @@ function refresh() {
success
:
function
(
data
)
{
$
.
each
(
data
,
function
(
key
,
val
)
{
console
.
log
(
key
+
" purchase_id:"
+
val
.
purchase_id
+
", progress: "
+
val
.
progress
);
//
console.log(key+ " purchase_id:"+val.purchase_id+", progress: "+val.progress);
if
(
val
.
progress
!=
100
)
{
$
(
'#progress_bar'
+
val
.
purchase_id
).
attr
(
"aria-valuenow"
,
val
.
progress
);
$
(
'#progress_bar'
+
val
.
purchase_id
).
attr
(
'style'
,
'width:'
+
val
.
progress
+
'%'
);
...
...
reports/templates/Reports.html
View file @
1c67b6da
...
...
@@ -4,6 +4,16 @@
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"https://cdn.datatables.net/1.10.19/css/jquery.dataTables.min.css"
/>
<script
type=
"text/javascript"
src=
"https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"
></script>
<link
rel=
"stylesheet"
href=
"https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/css/ol.css"
type=
"text/css"
>
<style>
.map
{
height
:
400px
;
width
:
100%
;
}
</style>
<script
src=
"https://cdn.rawgit.com/openlayers/openlayers.github.io/master/en/v5.3.0/build/ol.js"
></script>
{% endblock %}
{% block messages %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
...
...
@@ -49,7 +59,7 @@
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-bell-o"
></i>
<span
class=
"label label-warning"
>
10
</span>
</a>
</a>
<ul
class=
"dropdown-menu"
>
<li
class=
"header"
>
You have 10 notifications
</li>
<li>
...
...
@@ -123,7 +133,7 @@
{% block content %}
<!-- Content Wrapper. Contains page content -->
<!-- Main content -->
<div
id=
"reportPage"
class=
"wrapper"
style=
"background-color: #ecf0f5;
display: none
"
>
<div
id=
"reportPage"
class=
"wrapper"
style=
"background-color: #ecf0f5;"
>
<!-- Content Wrapper. Contains page content -->
<!-- Main content -->
<section
class=
"content"
>
...
...
@@ -133,6 +143,7 @@
<table
data-toggle=
"table"
id=
"example"
class=
"table table-striped table-bordered"
style=
"width:100%"
>
<thead>
<th>
Zone
</th>
<th>
Process
</th>
<th>
Purchase date
</th>
<th>
Start Date
</th>
...
...
@@ -144,6 +155,9 @@
<tbody
id=
"table_body"
>
{% for product in productList %}
<tr>
<td><a
href=
"#"
onclick=
"showMyModalSetTitle('{{ product.search_name }}', 'Some body txt')"
>
{{ product.search_name }}
</a>
</td>
<td>
{{ product.process }}
</td>
<td>
{{ product.purchase_date }}
</td>
<td>
{{ product.startDate }}
</td>
...
...
@@ -228,9 +242,54 @@
</div>
</div>
<div
id=
"mapmodal"
class=
"modal fade"
tabindex=
"-1"
role=
"dialog"
aria-labelledby=
"myModalLabel"
aria-hidden=
"true"
>
<div
class=
"modal-dialog"
>
<div
class=
"modal-content"
>
<div
class=
"modal-header"
>
<button
type=
"button"
class=
"close"
data-dismiss=
"modal"
aria-hidden=
"true"
>
×
</button>
<h4
class=
"modal-title"
id=
"myModalTitle"
></h4>
</div>
<div
class=
"modal-body"
>
<div
id=
"map"
class=
"map"
></div>
</div>
<div
class=
"modal-footer"
>
<button
type=
"button"
class=
"btn btn-default"
data-dismiss=
"modal"
>
Close
</button>
</div>
</div>
</div>
</div>
<!-- /.modals -->
{% endblock %}
{% block scripts %}
<script
src=
"{% static 'reports/js/Reports_scripts.js' %}"
>
<script
src=
"{% static 'reports/js/Reports_scripts.js' %}"
></script>
<script
type=
"text/javascript"
>
function
showMyModalSetTitle
(
name
,
data
)
{
$
(
'#map'
).
empty
();
$
(
'#myModalTitle'
).
val
(
name
);
$
(
"#mapmodal"
).
modal
();
setTimeout
(
function
(){
createmap
();
},
1000
);
}
function
createmap
()
{
var
map
=
new
ol
.
Map
({
target
:
'map'
,
layers
:
[
new
ol
.
layer
.
Tile
({
source
:
new
ol
.
source
.
OSM
()
})
],
view
:
new
ol
.
View
({
center
:
ol
.
proj
.
fromLonLat
([
-
89.63873079999999
,
21.0404457
]),
zoom
:
5
})
});
}
</script>
{% endblock %}
reports/views.py
View file @
1c67b6da
...
...
@@ -119,7 +119,7 @@ def Reports(request):
folders
=
[]
zip
=
""
product_list
=
Purchase
.
objects
.
values
(
'id'
,
'productList'
,
'aggreg_date'
,
'search__clouds'
,
'search__startDate'
,
'search__endDate'
,
'search__process_id__name'
)
.
filter
(
'search__endDate'
,
'search__process_id__name'
,
'search__search_name'
)
.
filter
(
user_id
=
request
.
user
.
id
,
purchased
=
1
)
for
producto
in
product_list
:
log_info
=
USERS_PATH
+
request
.
user
.
email
+
"/"
+
str
(
producto
[
'id'
])
+
"/L2ASCL_AreaProcessing.log"
...
...
@@ -162,6 +162,7 @@ def Reports(request):
print
(
"folder out noes not exists"
)
else
:
folders
=
os
.
listdir
(
path
=
absolute_path
)
print
(
folders
)
if
len
(
folders
)
==
0
:
initial_folder
=
"../#"
else
:
...
...
@@ -178,6 +179,7 @@ def Reports(request):
zip
=
zip_path
+
"/"
+
file
print
(
zip
)
productList
.
append
({
"search_name"
:
producto
[
'search__search_name'
],
"process"
:
producto
[
'search__process_id__name'
],
"purchase_date"
:
producto
[
'aggreg_date'
],
"startDate"
:
producto
[
'search__startDate'
],
...
...
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