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
0d413ed0
Commit
0d413ed0
authored
Apr 16, 2019
by
Emmanuel René Huchim Puc
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of gitlab.geoint.mx:mario.chirinos/GeoInt_SIDT into multi-select
parents
06c7c471
a62942d0
Changes
23
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
835 additions
and
539 deletions
+835
-539
Platform.html
administration/templates/Platform.html
+276
-0
Process.html
administration/templates/Process.html
+218
-0
administration_aside.html
administration/templates/administration_aside.html
+22
-4
dashboard.html
administration/templates/dashboard.html
+29
-55
users_table.html
administration/templates/users_table.html
+1
-45
urls.py
administration/urls.py
+4
-2
views.py
administration/views.py
+30
-2
forms.py
catalog/forms.py
+1
-1
models.py
catalog/models.py
+2
-0
map.css
catalog/static/catalog/css/map.css
+4
-0
L2ASCL_data (copy).html
catalog/templates/L2ASCL_data (copy).html
+0
-197
base_top.html
catalog/templates/base_top.html
+96
-79
show_cart.html
catalog/templates/show_cart.html
+8
-8
user_button.html
catalog/templates/user_button.html
+3
-3
views.py
catalog/views.py
+4
-71
Reports.html
reports/templates/Reports.html
+10
-3
aside.html
reports/templates/aside.html
+10
-8
sclData.html
reports/templates/sclData.html
+4
-4
urls.py
reports/urls.py
+1
-0
views.py
reports/views.py
+89
-35
User_profile.html
users/templates/User_profile.html
+3
-2
users_aside.html
users/templates/users_aside.html
+1
-1
views.py
users/views.py
+19
-19
No files found.
administration/templates/Platform.html
0 → 100644
View file @
0d413ed0
This diff is collapsed.
Click to expand it.
administration/templates/Process.html
0 → 100644
View file @
0d413ed0
{% extends "base_top.html" %}
{% load staticfiles %}
{% block headMedia %}
<link
rel=
"stylesheet"
href=
"{% static 'catalog/css/body.css' %}"
type=
"text/css"
>
<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>
{% endblock %}
{% block messages %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-envelope-o"
></i>
<span
class=
"label label-success"
>
4
</span>
</a>
<ul
class=
"dropdown-menu"
>
<li
class=
"header"
>
You have 4 messages
</li>
<li>
<!-- inner menu: contains the actual data -->
<ul
class=
"menu"
>
<li>
<!-- start message -->
<a
href=
"#"
>
<div
class=
"pull-left"
>
<img
src=
"dist/img/user2-160x160.jpg"
class=
"img-circle"
alt=
"User Image"
>
</div>
<h4>
Support Team
<small><i
class=
"fa fa-clock-o"
></i>
5 mins
</small>
</h4>
<p>
Why not buy a new awesome theme?
</p>
</a>
</li>
<!-- end message -->
<li>
<a
href=
"#"
>
<div
class=
"pull-left"
>
<img
src=
"dist/img/user3-128x128.jpg"
class=
"img-circle"
alt=
"User Image"
>
</div>
<h4>
AdminLTE Design Team
<small><i
class=
"fa fa-clock-o"
></i>
2 hours
</small>
</h4>
<p>
Why not buy a new awesome theme?
</p>
</a>
</li>
</ul>
</li>
<li
class=
"footer"
><a
href=
"#"
>
See All Messages
</a></li>
</ul>
{% endblock %}
{% block notifications %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-bell-o"
></i>
<span
class=
"label label-warning"
>
10
</span>
</a>
<ul
class=
"dropdown-menu"
>
<li
class=
"header"
>
You have 10 notifications
</li>
<li>
<!-- inner menu: contains the actual data -->
<ul
class=
"menu"
>
<li>
<a
href=
"#"
>
<i
class=
"fa fa-users text-aqua"
></i>
5 new members joined today
</a>
</li>
</li>
</ul>
</li>
<li
class=
"footer"
><a
href=
"#"
>
View all
</a></li>
</ul>
{% endblock %}
{% block tasks %}
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"fa fa-flag-o"
></i>
<span
class=
"label label-danger"
>
9
</span>
</a>
<ul
c
{%
load
static
%}
lass=
"dropdown-menu"
>
<li
class=
"header"
>
You have 9 tasks
</li>
<li>
<!-- inner menu: contains the actual data -->
<ul
class=
"menu"
>
<li>
<!-- Task item -->
<a
href=
"#"
>
<h3>
Design some buttons
<small
class=
"pull-right"
>
20%
</small>
</h3>
<div
class=
"progress xs"
>
<div
class=
"progress-bar progress-bar-aqua"
style=
"width: 20%"
role=
"progressbar"
aria-valuenow=
"20"
aria-valuemin=
"0"
aria-valuemax=
"100"
>
<span
class=
"sr-only"
>
20% Complete
</span>
</div>
</div>
</a>
</li>
<!-- end task item -->
</ul>
</li>
<li
class=
"footer"
>
<a
href=
"#"
>
View all tasks
</a>
</li>
</ul>
{% endblock %}
{% block sidebar %}
{% include 'administration_aside.html' %}
{% endblock %}
{% block user %}
{% include "user_button.html" %}
{% endblock %}
{% block content %}
<div
class=
"wrapper"
style=
"background-color: #ecf0f5;"
>
<!-- Content Wrapper. Contains page content -->
<!-- Main content -->
<section
class=
"content"
>
<div
class=
"panel panel-default"
>
<div
class=
"panel-heading"
>
{{ Viewname }}
</div>
<div
class=
"panel-body text-center"
>
<table
data-toggle=
"table"
id=
"example"
class=
"table table-striped table-bordered"
style=
"width:100%"
>
<thead>
<th>
ID
</th>
<th>
Name
</th>
<th>
Platform
</th>
<th>
Product Level
</th>
<th>
Status
</th>
<th>
Actions
</th>
</thead>
<tbody>
{% for process in process %}
<tr>
<td>
{{ process.id }}
</td>
<td>
{{ process.name }}
</td>
<td>
{{ process.platform_id }}
</td>
<td>
{{ process.product_level }}
</td>
<form
method=
"post"
action=
"{% url 'update' %}"
>
{% csrf_token %}
<input
type=
"hidden"
name=
"request_path"
value=
"{{ request.path }}"
>
<input
type=
"hidden"
name=
"user_id"
value=
"{{ user.user_id }}"
>
<td>
<input
type=
"checkbox"
name=
"status"
value=
"1"
{%
if
not
request
.
user
.
is_superuser
%}
disabled
{%
endif
%}
{%
if
process
.
status =
=
True
%}
checked
{%
endif
%}
>
</td>
<td>
<button
{%
if
not
request
.
user
.
is_superuser
%}
disabled
{%
endif
%}
title=
"save"
type=
"submit"
class=
"btn btn-success"
><i
class=
"fa fa-save"
></i></button>
</td>
</form>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</section>
<!-- /.content -->
</div>
<footer
class=
" page-footer font-small special-color-dark pt-5"
style=
"bottom: 0; position: absolute"
>
<!-- Footer Elements -->
<div
class=
"container"
>
<!-- Social buttons
<ul class="list-unstyled list-inline text-center">
<li class="list-inline-item">
<a class="btn-floating btn-fb mx-1">
<i class="fa fa-faceboo"> </i>
</a>
</li>
<li class="list-inline-item">
<a class="btn-floating btn-tw mx-1">
<i class="fa fa-twitter"> </i>
</a>
</li>
<li class="list-inline-item">
<a class="btn-floating btn-gplus mx-1">
<i class="fa fa-google-plus"> </i>
</a>
</li>
<li class="list-inline-item">
<a class="btn-floating btn-li mx-1">
<i class="fa fa-linkedin"> </i>
</a>
</li>
<li class="list-inline-item">
<a class="btn-floating btn-dribbble mx-1">
<i class="fa fa-dribbble"> </i>
</a>
</li>
</ul>
<!-- Social buttons -->
</div>
<!-- Footer Elements -->
<!-- Copyright -->
<div
class=
"footer-copyright text-center py-3"
>
© 2019 Copyright:
<a
href=
"http://geoint.mx/"
>
Centro de Investigación en Ciencias de Información Geoespacial.
</a>
</div>
<!-- Copyright -->
</footer>
{% endblock %}
{% block templates %}{% include "templates.html" %}{% endblock %}
{% block scripts %}
<script>
$
(
document
).
ready
(
function
()
{
$
(
'#example'
).
DataTable
();
});
</script>
{% endblock %}
\ No newline at end of file
administration/templates/administration_aside.html
View file @
0d413ed0
...
...
@@ -2,7 +2,7 @@
<br>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<li>
<a
class=
"treeview "
href=
"{
{ BASE_URL }}/administration
"
>
<a
class=
"treeview "
href=
"{
% url 'Dashboard' %}
"
>
<i
class=
"fa fa-home"
></i>
<span>
Dashboard
</span>
<span
class=
"pull-right-container"
>
...
...
@@ -11,7 +11,7 @@
</a>
</li>
<li>
<a
class=
"treeview "
href=
"
../../administration/request
"
>
<a
class=
"treeview "
href=
"
{% url 'request' %}
"
>
<i
class=
"fa fa-user-plus"
></i>
<span>
Request
</span>
<span
class=
"pull-right-container"
>
...
...
@@ -20,7 +20,7 @@
</a>
</li>
<li>
<a
class=
"treeview "
href=
"
../../administration/users
"
>
<a
class=
"treeview "
href=
"
{% url 'active_users' %}
"
>
<i
class=
"fa fa-users"
></i>
<span>
Active users
</span>
<span
class=
"pull-right-container"
>
...
...
@@ -29,6 +29,24 @@
</a>
</li>
<li>
<a
class=
"treeview "
href=
"{% url 'all_process' %}"
>
<i
class=
"fa fa-sync-alt"
></i>
<span>
Catalog of Process
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
</li>
<li>
<a
class=
"treeview "
href=
"{% url 'all_platform' %}"
>
<i
class=
"fa fa-satellite"
></i>
<span>
Catalog of Platforms
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
</li>
<!--li>
<a class="treeview " href="#" onclick="window.history.back();">
<i class="fa fa-backward"></i>
<span>Back</span>
...
...
@@ -36,6 +54,6 @@
<span class="label label-primary pull-right"></span>
</span>
</a>
</li>
</li
--
>
</ul>
</div>
\ No newline at end of file
administration/templates/dashboard.html
View file @
0d413ed0
...
...
@@ -8,7 +8,8 @@
<script
src=
"{% static 'js/Chart.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://use.fontawesome.com/releases/v5.7.2/css/all.css"
integrity=
"sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
crossorigin=
"anonymous"
>
<link
rel=
"stylesheet"
href=
"https://use.fontawesome.com/releases/v5.7.2/css/all.css"
integrity=
"sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
crossorigin=
"anonymous"
>
{% endblock %}
{% block messages %}
...
...
@@ -146,7 +147,7 @@
<span
class=
"info-box-text"
>
Active Users
</span>
<span
class=
"info-box-number"
>
{{ Usuarios }}
</span>
<span
class=
"info-box-more pull-right"
>
<a
href=
"
../../administration/users
"
class=
"small-box-footer"
>
<a
href=
"
{% url 'active_users' %}
"
class=
"small-box-footer"
>
More info
<i
class=
"fa fa-arrow-circle-right"
></i>
</a>
</span>
...
...
@@ -168,7 +169,7 @@
<span
class=
"info-box-text"
>
User Registrations
</span>
<span
class=
"info-box-number"
>
{{ Solicitud }}
</span>
<span
class=
"info-box-more pull-right"
>
<a
href=
"
../../administration/request
"
class=
"small-box-footer"
>
<a
href=
"
{% url 'request' %}
"
class=
"small-box-footer"
>
More info
<i
class=
"fa fa-arrow-circle-right"
></i>
</a>
</span>
...
...
@@ -186,9 +187,7 @@
<span
class=
"info-box-text"
>
Processing
</span>
<span
class=
"info-box-number"
>
{{ Descargando }}
</span>
<span
class=
"info-box-more pull-right"
>
<a
href=
"#"
class=
"small-box-footer"
>
More info
<i
class=
"fa fa-arrow-circle-right"
></i>
</a>
</span>
</div>
<!-- /.info-box-content -->
...
...
@@ -204,9 +203,6 @@
<span
class=
"info-box-text"
>
Repsat Storage
</span>
<span
class=
"info-box-number"
>
{{ size_repsat }}
</span>
<span
class=
"info-box-more pull-right"
>
<a
href=
"#"
class=
"small-box-footer"
>
More info
<i
class=
"fa fa-arrow-circle-right"
></i>
</a>
</span>
</div>
<!-- /.info-box-content -->
...
...
@@ -222,9 +218,6 @@
<span
class=
"info-box-text"
>
Sentinel Storage
</span>
<span
class=
"info-box-number"
>
{{ size_sentinel }}
</span>
<span
class=
"info-box-more pull-right"
>
<a
href=
"#"
class=
"small-box-footer"
>
More info
<i
class=
"fa fa-arrow-circle-right"
></i>
</a>
</span>
</div>
<!-- /.info-box-content -->
...
...
@@ -248,15 +241,14 @@
<!-- /.box-header -->
<div
class=
"box-body"
>
<div
class=
"row"
>
<div
class=
"col-md-8"
>
<div
class=
"col-md-8
col-xs-12 col-sm-12
"
>
<p
class=
"text-center"
>
<strong>
Today {% now "jS F Y" %}
</strong>
</p>
<div
class=
"chart"
>
<div
class=
"chart
"
>
<!-- Sales Chart Canvas -->
<canvas
id=
"salesChart"
style=
"height: 142px; width: 814px;"
width=
"814"
height=
"142"
></canvas>
<canvas
id=
"salesChart"
style=
"height: 142px; width: 814px;"
width=
"814"
height=
"170"
></canvas>
</div>
<!-- /.chart-responsive -->
</div>
...
...
@@ -405,6 +397,13 @@
<!-- /.content -->
</div>
{% endblock %}
{% block footer %}
<footer
class=
" page-footer font-small special-color-dark pt-5"
style=
"bottom: 0; position: absolute"
>
<!-- Footer Elements -->
<div
class=
"container"
>
...
...
@@ -447,21 +446,7 @@
<!-- Copyright -->
</footer>
{% if messages %}
<div
class=
"container col-md-2 col-lg-2 col-xs-2 col-sm-2"
style=
"bottom: 0; right: 0;position: absolute"
>
{% for message in messages %}
<div
{%
if
message
.
tags
%}
class=
"fade in alert alert-dismissible alert-{{ message.tags }}"
{%
endif
%}
>
<a
href=
"#"
class=
"close"
data-dismiss=
"alert"
aria-label=
"close"
>
×
</a>
<strong>
{{ message.tags }}!
</strong>
{{ message }}.
</div>
{% endfor %}
</div>
{% endif %}
<div
id=
"ol"
></div>
{% endblock %}
{% block templates %}
...
...
@@ -488,20 +473,11 @@
{
%
endfor
%
}
],
backgroundColor
:
[
'rgba(255, 99, 132, 0.2)'
,
'rgba(54, 162, 235, 0.2)'
,
'rgba(255, 206, 86, 0.2)'
,
'rgba(75, 192, 192, 0.2)'
,
'rgba(153, 102, 255, 0.2)'
,
'rgba(255, 159, 64, 0.2)'
'rgba(222, 130, 50, 0.2)'
],
borderColor
:
[
'rgba(255,99,132,1)'
,
'rgba(54, 162, 235, 1)'
,
'rgba(255, 206, 86, 1)'
,
'rgba(75, 192, 192, 1)'
,
'rgba(153, 102, 255, 1)'
,
'rgba(255, 159, 64, 1)'
'rgba(222, 130, 50,1)'
,
],
borderWidth
:
1
}]
...
...
@@ -518,7 +494,6 @@
});
// mostrar imagen al dar click en los puntos
document
.
getElementById
(
"salesChart"
).
onclick
=
function
(
evt
)
{
// activePoints = myChart.getElementsAtEvent(evt);
...
...
@@ -539,35 +514,34 @@
console
.
log
(
"hola"
);
$
(
'#mostrar'
).
empty
();
$
(
'#mostrar'
).
append
(
"<table class=
\"
table table-hover
\"
id=
\"
example
\"
>"
+
$
(
'#mostrar'
).
append
(
"<table class=
\"
table table-hover
\"
id=
\"
example
\"
>"
+
"<thead>"
+
"<tr>"
+
"<th class=
\"
text-center
\"
>User ID</th>"
+
"<th class=
\"
text-center
\"
>User</th>"
+
"<th class=
\"
text-center
\"
>E-Mail</th>"
+
"<th class=
\"
text-center
\"
>Purchases</th>"
+
"<th class=
\"
text-center
\"
>Storage</th>"
+
//
"
<
th
class
=
\
"text-center
\"
>Storage</th>"
+
"<th class=
\"
text-center
\"
>Downloads in process</th>"
+
"</tr>"
+
"</thead>"
+
"<tbody id=
\"
tbody
\"
class=
\"
text-center
\"
>"
);
$
.
each
(
data
,
function
(
key
,
val
)
{
$
(
"#tbody"
).
append
(
"<tr>"
+
"<td>"
+
val
[
'user_id'
]
+
"</td>"
+
"<td>"
+
val
[
'username'
]
+
"</td>"
+
"<td>"
+
val
[
'email'
]
+
"</td>"
+
"<td>"
+
val
[
'purchases'
]
+
"</td>"
+
"<td>"
+
val
[
'storage'
]
+
"</td>"
+
"<td>"
+
val
[
'in_process'
]
+
"</td>"
+
$
(
"#tbody"
).
append
(
"<tr>"
+
"<td>"
+
val
[
'user_id'
]
+
"</td>"
+
"<td>"
+
val
[
'username'
]
+
"</td>"
+
"<td>"
+
val
[
'email'
]
+
"</td>"
+
"<td>"
+
val
[
'purchases'
]
+
"</td>"
+
//
"
<
td
>
"+val['storage']+"
<
/td>"
+
"<td>"
+
val
[
'in_process'
]
+
"</td>"
+
"</tr>"
);
});
$
(
'#mostrar'
).
append
(
"</tbody>"
+
"</table>"
);
$
(
'#example'
).
DataTable
({
});
$
(
'#example'
).
DataTable
({});
}
});
...
...
administration/templates/users_table.html
View file @
0d413ed0
...
...
@@ -238,51 +238,7 @@
{% block scripts %}
<script>
$
(
document
).
ready
(
function
()
{
$
(
'#example'
).
DataTable
({
language
:
{
"sProcessing"
:
"Procesando..."
,
"sLengthMenu"
:
"Mostrar _MENU_ registros"
,
"sZeroRecords"
:
"No se encontraron resultados"
,
"sEmptyTable"
:
"Ningún dato disponible en esta tabla"
,
"sInfo"
:
"Mostrando registros del _START_ al _END_ de un total de _TOTAL_ registros"
,
"sInfoEmpty"
:
"Mostrando registros del 0 al 0 de un total de 0 registros"
,
"sInfoFiltered"
:
"(filtrado de un total de _MAX_ registros)"
,
"sInfoPostFix"
:
""
,
"sSearch"
:
"Buscar:"
,
"sUrl"
:
""
,
"sInfoThousands"
:
","
,
"sLoadingRecords"
:
"Cargando..."
,
"oPaginate"
:
{
"sFirst"
:
"Primero"
,
"sLast"
:
"Último"
,
"sNext"
:
"Siguiente"
,
"sPrevious"
:
"Anterior"
},
"oAria"
:
{
"sSortAscending"
:
": Activar para ordenar la columna de manera ascendente"
,
"sSortDescending"
:
": Activar para ordenar la columna de manera descendente"
}
},
responsive
:
{
details
:
{
type
:
'column'
,
target
:
'tr'
}
},
columnDefs
:
[{
className
:
'control'
,
orderable
:
false
,
targets
:
0
}],
order
:
[
1
,
'asc'
]
});
$
(
'#example'
).
DataTable
();
});
</script>
{% endblock %}
\ No newline at end of file
administration/urls.py
View file @
0d413ed0
...
...
@@ -4,8 +4,10 @@ from . import views
urlpatterns
=
[
url
(
r'^$'
,
views
.
Dashboard
,
name
=
'Dashboard'
),
url
(
r'^request/$'
,
views
.
Request_users
,
name
=
'
R
equest'
),
url
(
r'^request/$'
,
views
.
Request_users
,
name
=
'
r
equest'
),
url
(
r'^update/$'
,
views
.
update_user
,
name
=
'update'
),
url
(
r'^users/$'
,
views
.
active_users
,
name
=
'users'
),
url
(
r'^users/$'
,
views
.
active_users
,
name
=
'active_users'
),
url
(
r'^platform/$'
,
views
.
all_Platform
,
name
=
'all_platform'
),
url
(
r'^process/$'
,
views
.
all_Process
,
name
=
'all_process'
),
url
(
r'^ws/report_table$'
,
views
.
wsPurchasesPM
,
name
=
'wsPurchasesPM'
),
]
\ No newline at end of file
administration/views.py
View file @
0d413ed0
...
...
@@ -13,7 +13,7 @@ from django.http import HttpResponse, HttpResponseRedirect, HttpRequest, Http404
# Create your views here.
from
django.views.decorators.csrf
import
csrf_exempt
from
catalog.models
import
Purchase
,
Search
from
catalog.models
import
Purchase
,
Search
,
Platform
,
Process
from
catalog.views
import
config
USERS_PATH
=
config
[
'PATHS'
][
'PATH_NAS'
]
...
...
@@ -250,4 +250,32 @@ def best_unit_size(bytes_size):
return
str
(
round
(
bu_size
,
2
))
+
" "
+
unit
#------------------------------------------------
def
all_Platform
(
request
):
platforms
=
Platform
.
objects
.
all
()
platforms_list
=
[]
for
platform
in
platforms
:
platforms_list
.
append
({
"id"
:
platform
.
id
,
"name"
:
platform
.
name
,
"acronym"
:
platform
.
acronym
,
"status"
:
platform
.
status
,
})
return
render
(
request
,
"Platform.html"
,{
'platforms'
:
platforms_list
})
#------------------------------------------------
def
all_Process
(
request
):
process
=
Process
.
objects
.
values
(
'id'
,
'name'
,
'status'
,
'platform__name'
,
'productLevel'
)
process_list
=
[]
for
process
in
process
:
process_list
.
append
({
"id"
:
process
[
'id'
],
"name"
:
process
[
'name'
],
"platform_id"
:
process
[
'platform__name'
],
"product_level"
:
process
[
'productLevel'
],
"status"
:
process
[
'status'
],
})
return
render
(
request
,
"Process.html"
,
{
'process'
:
process_list
})
catalog/forms.py
View file @
0d413ed0
...
...
@@ -9,7 +9,7 @@ from catalog.models import Process
#from django.contrib.auth.models import User
#from buscador.models import Investigador, Reto
all_process
=
Process
.
objects
.
all
(
)
all_process
=
Process
.
objects
.
filter
(
status
=
True
)
platforms
=
[
]
...
...
catalog/models.py
View file @
0d413ed0
...
...
@@ -10,6 +10,7 @@ from django.db import models
class
Platform
(
models
.
Model
):
name
=
models
.
CharField
(
max_length
=
64
)
acronym
=
models
.
CharField
(
max_length
=
16
)
status
=
models
.
BooleanField
(
default
=
True
)
class
Polygon
(
models
.
Model
):
...
...
@@ -53,6 +54,7 @@ class Process(models.Model):
name
=
models
.
CharField
(
max_length
=
50
)
platform
=
models
.
ForeignKey
(
Platform
,
on_delete
=
models
.
CASCADE
,
default
=
''
)
productLevel
=
models
.
CharField
(
max_length
=
8
,
default
=
''
)
status
=
models
.
BooleanField
(
default
=
True
)
class
Search
(
models
.
Model
):
...
...
catalog/static/catalog/css/map.css
View file @
0d413ed0
...
...
@@ -33,3 +33,7 @@ html, body
text-decoration
:
none
;
color
:
black
;
}
#cloudPercentageSelector
{
background
:
transparent
;
}
catalog/templates/L2ASCL_data (copy).html
deleted
100644 → 0
View file @
06c7c471
{% extends "data_top.html" %}
{% load static %}
{% block content %}
<div
class=
"wrapper"
>
<!-- Content Wrapper. Contains page content -->
<!-- Main content -->
<section
class=
"content"
>
<div
class=
"row"
>
<div
class=
"col-md-6"
>
<!-- AREA CHART -->
<div
class=
"box box-primary"
>
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
>
Area Km²
</h3>
<div
class=
"box-tools pull-right"
>
<button
type=
"button"
class=
"btn btn-box-tool"
data-widget=
"collapse"
><i
class=
"fa fa-minus"
></i>
</button>
<button
type=
"button"
class=
"btn btn-box-tool"
data-widget=
"remove"
><i
class=
"fa fa-times"
></i></button>
</div>
</div>
<div
class=
"box-body"
>
<div
class=
"chart"
>
<canvas
id=
"areaChart"
style=
"height:250px"
></canvas>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
<!-- DONUT CHART -->
<div
class=
"box box-danger"
>
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
>
Donut Chart
</h3>
<div
class=
"box-tools pull-right"
>
<button
type=
"button"
class=
"btn btn-box-tool"
data-widget=
"collapse"
><i
class=
"fa fa-minus"
></i>
</button>
<button
type=
"button"
class=
"btn btn-box-tool"
data-widget=
"remove"
><i
class=
"fa fa-times"
></i></button>
</div>
</div>
<div
class=
"box-body"
>
<canvas
id=
"pieChart"
style=
"height:250px"
></canvas>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col (LEFT) -->
<div
class=
"col-md-6"
>
<!-- LINE CHART -->
<!-- BAR CHART -->
<div
class=
"box box-success"
>
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
>
Bar Chart
</h3>
<div
class=
"box-tools pull-right"
>
<button
type=
"button"
class=
"btn btn-box-tool"
data-widget=
"collapse"
><i
class=
"fa fa-minus"
></i>
</button>
<button
type=
"button"
class=
"btn btn-box-tool"
data-widget=
"remove"
><i
class=
"fa fa-times"
></i></button>
</div>
</div>
<div
class=
"box-body"
>
<div
class=
"chart"
>
<canvas
id=
"barChart"
style=
"height:230px"
></canvas>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
<div
class=
"box box-info"
>
<div
class=
"box-header with-border"
>
<h3
class=
"box-title"
>
MAP
</h3>
<div
class=
"box-tools pull-right"
>
<button
type=
"button"
class=
"btn btn-box-tool"
data-widget=
"collapsexite"
><i
class=
"fa fa-minus"
></i>
</button>
<button
type=
"button"
class=
"btn btn-box-tool"
data-widget=
"remove"
><i
class=
"fa fa-times"
></i></button>
</div>
</div>
<div
class=
"box-body"
>
<div
class=
"chart"
>
<img
id=
"satImage"
src=
"{% static 'tmpImages/20180219_TCI_60m.jpg' %}"
height=
"512px"
/>
</div>
</div>
<!-- /.box-body -->
</div>
<!-- /.box -->
</div>
<!-- /.col (RIGHT) -->
</div>
<!-- /.row -->
</section>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<footer
class=
"main-footer"
>
<div
class=
"pull-right hidden-xs"
>
<b>
Version
</b>
2.4.0
</div>
<strong>
Copyright
©
2014-2016
<a
href=
"https://adminlte.io"
>
Almsaeed Studio
</a>
.
</strong>
All rights
reserved.
</footer>
{% endblock %}
{% block scripts %}
<!-- page script -->
<script>
var
ctx
=
document
.
getElementById
(
"areaChart"
).
getContext
(
'2d'
);
var
myChart
=
new
Chart
(
ctx
,
{
type
:
'Line'
,
data
:
{
labels
:
[{{
labels
}}],
datasets
:
[{
label
:
'Vegetacion (4)'
,
data
:
{{
vegetation
}},
backgroundColor
:
[
'rgba(0, 250, 132, 0.5)'
,
'rgba(54, 162, 235, 0.2)'
,
'rgba(255, 206, 86, 0.2)'
,
'rgba(75, 192, 192, 0.2)'
,
'rgba(153, 102, 255, 0.2)'
,
'rgba(255, 159, 64, 0.2)'
],
borderColor
:
[
'rgba(255,99,132,1)'
,
'rgba(54, 162, 235, 1)'
,
'rgba(255, 206, 86, 1)'
,
'rgba(75, 192, 192, 1)'
,
'rgba(153, 102, 255, 1)'
,
'rgba(255, 159, 64, 1)'
],
borderWidth
:
1
},
{
label
:
'No Vegetacion (5)'
,
data
:
{{
novegetation
}},
backgroundColor
:
[
'rgba(155, 250, 0, 0.5)'
,
'rgba(54, 162, 235, 0.2)'
,
'rgba(255, 206, 86, 0.2)'
,
'rgba(75, 192, 192, 0.2)'
,
'rgba(153, 102, 255, 0.2)'
,
'rgba(255, 159, 64, 0.2)'
],
borderColor
:
[
'rgba(255,99,132,1)'
,
'rgba(54, 162, 235, 1)'
,
'rgba(255, 206, 86, 1)'
,
'rgba(75, 192, 192, 1)'
,
'rgba(153, 102, 255, 1)'
,
'rgba(255, 159, 64, 1)'
],
borderWidth
:
1
}]
},
options
:
{
events
:
[
'click'
],
onClick
:
areaChartonClick
,
scales
:
{
yAxes
:
[{
ticks
:
{
beginAtZero
:
true
}
}]
}
}
});
function
areaChartonClick
(
e
,
element
)
{
console
.
log
(
e
);
console
.
log
(
element
);
console
.
log
(
element
[
0
].
_index
);
console
.
log
(
myChart
);
console
.
log
(
myChart
.
config
.
data
.
labels
[
element
[
0
].
_index
]);
document
.
getElementById
(
"satImage"
).
src
=
"../../static/tmpImages/"
+
myChart
.
config
.
data
.
labels
[
element
[
0
].
_index
]
+
"_TCI_60m.jpg"
};
</script>
{% endblock %}
catalog/templates/base_top.html
View file @
0d413ed0
...
...
@@ -22,6 +22,9 @@
<!-- jsPDF -->
<script
src=
'https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.3.3/jspdf.debug.js'
></script>
<link
rel=
"stylesheet"
href=
"https://use.fontawesome.com/releases/v5.7.2/css/all.css"
integrity=
"sha384-fnmOCqbTlWIlj8LyTjo7mOUStjsKC4pOpQbqyi7RrhN7udi9RwhKkMHpvLbHG9Sr"
crossorigin=
"anonymous"
>
{% block headMedia %}{% endblock %}
</head>
<body
class=
"hold-transition skin-yellow sidebar-mini"
>
...
...
@@ -31,7 +34,8 @@
<div
class=
"wrmapper"
>
<header
class=
"main-header"
>
<!-- Logo -->
<a
{%
if
request
.
user
.
is_authenticated
%}
href=
"{{ BASE_URL }}/catalog"
{%
else
%}
href=
"../../../"
{%
endif
%}
class=
"logo"
>
<a
{%
if
request
.
user
.
is_authenticated
%}
href=
"{{ BASE_URL }}/catalog"
{%
else
%}
href=
"../../../"
{%
endif
%}
class=
"logo"
>
<!-- mini logo for sidebar mini 50x50 pixels -->
<span
class=
"logo-mini"
><b>
G
</b>
eo
</span>
<!-- logo for regular state and mobile devices -->
...
...
@@ -113,8 +117,10 @@
<aside
class=
"control-sidebar control-sidebar-dark"
>
<!-- Create the tabs -->
<ul
class=
"nav nav-tabs nav-justified control-sidebar-tabs"
>
<li
id=
"globe"
class=
"active"
><a
href=
"#control-sidebar-home-tab"
data-toggle=
"tab"
><i
class=
"fa fa-globe"
></i></a></li>
<li
id=
"cart"
><a
href=
"#control-sidebar-settings-tab"
onclick=
"updateCart()"
data-toggle=
"tab"
><i
class=
"fa fa-shopping-cart"
></i></a>
<li
id=
"globe"
class=
"active"
><a
href=
"#control-sidebar-home-tab"
data-toggle=
"tab"
><i
class=
"fa fa-globe"
></i></a></li>
<li
id=
"cart"
><a
href=
"#control-sidebar-settings-tab"
onclick=
"updateCart()"
data-toggle=
"tab"
><i
class=
"fa fa-shopping-cart"
></i></a>
</li>
</ul>
<!-- Tab panes -->
...
...
@@ -202,6 +208,17 @@
{% block footer %}{% endblock %}
{% block scripts %}{% endblock %}
<div
id=
"ol"
></div>
{% if messages %}
<div
class=
"container col-md-2 col-lg-2 col-xs-2 col-sm-2"
style=
"bottom: 0; right: 0;position: absolute"
>
{% for message in messages %}
<div
{%
if
message
.
tags
%}
class=
"fade in alert alert-dismissible alert-{{ message.tags }}"
{%
endif
%}
>
<a
href=
"#"
class=
"close"
data-dismiss=
"alert"
aria-label=
"close"
>
×
</a>
<strong>
{{ message.tags }}!
</strong>
{{ message }}.
</div>
{% endfor %}
</div>
{% endif %}
</body>
</html>
catalog/templates/show_cart.html
View file @
0d413ed0
...
...
@@ -219,18 +219,18 @@
</tfoot>
</table>
<div
class=
"text-center"
>
<a
href=
"../pay"
>
<input
type=
"image"
<a
href=
"../pay"
class=
"btn btn-danger"
>
PAY
<
!--
input type="image"
src="https://www.sandbox.paypal.com/es_XC/MX/i/btn/btn_buynowCC_LG.gif"
border="0" name="submit"
alt="PayPal, la forma más segura y rápida de pagar en línea.">
<img alt="" border="0"
src="https://www.sandbox.paypal.com/es_XC/i/scr/pixel.gif" width="1"
height=
"1"
>
height="1"
--
>
</a>
<
!--
form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<form
action=
"https://www.sandbox.paypal.com/cgi-bin/webscr"
method=
"post"
>
<input
type=
"hidden"
name=
"cmd"
value=
"_cart"
>
<input
type=
"hidden"
name=
"upload"
value=
"1"
>
<input
type=
"hidden"
name=
"business"
...
...
@@ -247,9 +247,9 @@
{% endfor %}
<input
type=
'hidden'
name=
'cancel_return'
value='
../reports
'>
value=
'
http://repsat.geoint.mx/catalog/cart/
'
>
<input
type=
'hidden'
name=
'return'
value='
../catalog/cart
'>
value=
'
http://repsat.geoint.mx/catalog/cart/
'
>
<input
type=
"hidden"
name=
"notify_url"
value=
"http://repsat.geoint.mx/catalog/ipn/"
>
<input
type=
"image"
src=
"https://www.sandbox.paypal.com/es_XC/MX/i/btn/btn_buynowCC_LG.gif"
...
...
@@ -260,7 +260,7 @@
height=
"1"
>
</form>
<
!--
form method="post" action="http://repsat.geoint.mx/catalog/ipn/">
<form
method=
"post"
action=
"http://repsat.geoint.mx/catalog/ipn/"
>
<input
type=
"text"
name=
"nombre"
value=
""
>
<input
type=
"submit"
>
</form>
...
...
@@ -268,7 +268,7 @@
<form
method=
"post"
action=
"../ipn/"
>
<input
type=
"text"
name=
"nombre"
value=
""
>
<input
type=
"submit"
>
</form
--
>
</form>
</div>
...
...
catalog/templates/user_button.html
View file @
0d413ed0
...
...
@@ -15,7 +15,7 @@
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<!-- History element -->
<li>
<a
class=
"treeview "
href=
"
../../../users
"
>
<a
class=
"treeview "
href=
"
{% url 'users' %}
"
>
<i
class=
"fa fa-user-circle"
></i>
<span>
Profile
</span>
<span
class=
"pull-right-container"
>
...
...
@@ -26,7 +26,7 @@
<!-- End History element -->
<!-- History element -->
<li>
<a
class=
"treeview "
href=
"{
{ BASE_URL }}/reports
"
>
<a
class=
"treeview "
href=
"{
% url 'reports' %}
"
>
<i
class=
"fa fa-history"
></i>
<span>
Shopping History
</span>
<span
class=
"pull-right-container"
>
...
...
@@ -35,7 +35,7 @@
</a>
</li>
<li>
<a
class=
"treeview "
href=
"{
{ BASE_URL }}/catalog/cart
"
>
<a
class=
"treeview "
href=
"{
% url 'show-cart' %}
"
>
<i
class=
"fa fa-shopping-cart"
></i>
<span>
View shopping cart
</span>
<span
class=
"pull-right-container"
>
...
...
catalog/views.py
View file @
0d413ed0
...
...
@@ -293,40 +293,6 @@ def delFromCart(request):
product_list
=
Purchase
.
objects
.
filter
(
user
=
user
,
id
=
request
.
POST
[
'id'
])
.
delete
()
return
HttpResponse
(
status
=
204
)
##-------------------------------------------------------------------------------
# def L2ASCL_data(request):
# with open("/home/mario/NAS_MarioCh/mario_repsat_test/T15QZD_sclData.json") as f:
# json_data = OrderedDict(json.load(f))
# graphData = dict()
# graphData['type']="line"
# data=dict()
# data['labels'] = [ k for k,v in sorted(json_data.items()) ]
# data['datasets'] = list()
# labels = set()
# for d in json_data:
# labels |= set(json_data[d].keys())
# labels.remove('date')
# labelNames = ["No Data", "Saturated", "Shadows", "Cloud Shadows", "Vegetation",
# "Not-Vegetated", "Whater", "Unclassified", "Cloud Medium Probablilty", "Cloud Hight Probablilty", "Thin Cirrus", "Snow"]
# colors = ["Black", "Red", "DarkGray", "Brown", "Green", "Yellow", "Blue", "Grey", "LightGray", "White", "Aqua", "Pink"]
# for l in labels:
# item = dict()
# item['label'] = labelNames[int(l)]
# if l == "0":
# item['hidden'] = "true"
# item['data'] = [ v[l] * 60*60/1000000. for k,v in sorted(json_data.items()) if l in v]
# item['backgroundColor']=colors[int(l)]
# data['datasets'].append(item)
# graphData['data']=data
## graphData['options']['responsive']=True
## graphData['options']['maintainAspectRatio']=False
# print( json.dumps(graphData).encode("utf-8"))
# return render(request, 'L2ASCL_data.html', {"graphData":json.dumps(graphData).encode("utf-8")})
# -------------------------------------------------------------------------------
def
wsReportImages
(
request
):
print
(
request
.
GET
)
...
...
@@ -618,10 +584,12 @@ def IPN(request):
PATH_USERS
=
config
[
'PATHS'
][
'PATH_USERS'
]
f
=
open
(
PATH_USERS
+
"myfile.txt"
,
"w"
)
x
=
request
.
POST
.
dict
()
f
.
write
(
'variables'
)
f
.
write
(
'variables
\n
'
)
#f.write(request.META['HTTP_REFERER']+'\n')
for
key
,
value
in
x
.
items
():
f
.
write
(
key
+
": "
+
value
+
'
\n
'
)
return
redirect
(
'../../'
)
#return redirect('../../')
return
HttpResponseRedirect
(
reverse
(
'map'
))
#print("content-type: text/html\r\n\r\n")
#if request.POST.get['payment_status'] == 'Completed':
...
...
@@ -657,41 +625,6 @@ def IPN(request):
# f.write("\n")
# f.close()
# -----------------------------------------------------------------------
# def Pay3(request):
# VERIFY_URL_PROD = 'https://ipnpb.paypal.com/cgi-bin/webscr'
# VERIFY_URL_TEST = 'https://ipnpb.sandbox.paypal.com/cgi-bin/webscr'
#
# # Switch as appropriate
# VERIFY_URL = VERIFY_URL_TEST
#
# # CGI preamble
# print('content-type: text/plain')
# print()
#
# # Read and parse query string
# param_str = sys.stdin.readline().strip()
# params = urllib.parse.parse_qsl(param_str)
#
# # Add '_notify-validate' parameter
# params.append(('cmd', '_notify-validate'))
#
# # Post back to PayPal for validation
#
# headers = {'content-type': 'application/x-www-form-urlencoded',
# 'user-agent': 'Python-IPN-Verification-Script'}
# r = requests.post(VERIFY_URL, params=params, headers=headers, verify=True)
# r.raise_for_status()
#
# # Check return message and take action as needed
# if r.text == 'VERIFIED':
# pass
# elif r.text == 'INVALID':
# pass
# else:
# pass
# return redirect("https://google.com.mx")
# ------------------------------------------------------
def
Registration
(
request
):
#user = User.objects.filter(email=request.POST['email'])
...
...
reports/templates/Reports.html
View file @
0d413ed0
...
...
@@ -130,7 +130,7 @@
<br>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<li>
<a
class=
"treeview "
href=
"{
{ BASE_URL }}/catalog
"
>
<a
class=
"treeview "
href=
"{
% url 'map' %}
"
>
<i
class=
"fa fa-map"
></i>
<span>
Home
</span>
<span
class=
"pull-right-container"
>
...
...
@@ -226,15 +226,22 @@
{%
if
product
.
initial_folder
%}
href=
"../reports/{{ product.purchase_id }}"
{%
endif
%}
class=
"btn btn-success btn-sm col-md-
6 col-xs-6 col-sm-6 col-lg-6 col-xl-6
"
>
class=
"btn btn-success btn-sm col-md-
4 col-xs-4 col-sm-4 col-lg-4 col-xl-4
"
>
<i
class=
"fa fa-eye"
></i>
</a>
<a
title=
"Download zip"
{%
if
product
.
progress =
=
100
%}
href=
"../../static/reports/tmpImages/repsat_test_dev/{{ request.user.email }}/{{ product.purchase_id }}/myzip.zip"
{%
else
%}
href=
"#"
{%
endif
%}
class=
"btn btn-warning btn-sm col-md-
6 col-xs-6 col-sm-6 col-lg-6 col-xl-6
"
>
{%
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>
</a>
<a
title=
"Download PDF"
{%
if
product
.
progress =
=
100
%}
href=
"{% url 'PDF' product.purchase_id %}"
{%
else
%}
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"
>
<i
class=
"fa fa-file-pdf-o"
></i>
</a>
<!--a title="View Log" href="#" class="btn btn-info"
onclick="openmodal('{{ product.log_info }}')">
...
...
reports/templates/aside.html
View file @
0d413ed0
...
...
@@ -160,27 +160,29 @@
</a>
<ul
class=
"treeview-menu sidebar-form"
>
<li>
<a
class=
"treeview submenu"
href=
"#
"
>
<i
class=
"fa fa-file-
code
-o"
></i>
<span>
Export to
JSON
</span>
<a
class=
"treeview submenu"
href=
"../../static/reports/tmpImages/repsat_test_dev/{{ email }}/{{ purchaseID }}/myzip.zip
"
>
<i
class=
"fa fa-file-
zip
-o"
></i>
<span>
Export to
Zip
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
</li>
<li>
<a
class=
"treeview submenu"
href=
"#"
id=
"downloadPdf"
>
<i
class=
"fa fa-file-
pdf
-o"
></i>
<span>
Export to
PDF
</span>
<a
class=
"treeview submenu"
href=
"#"
>
<i
class=
"fa fa-file-
code
-o"
></i>
<span>
Export to
JSON
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
</a>
</li>
<li>
<a
class=
"treeview submenu"
href=
"
../../static/reports/tmpImages/repsat_test_dev/{{ email }}/{{ purchaseID }}/{{ zone }}.pdf"
id=
"downloadPdf"
target=
"_blank
"
>
<a
class=
"treeview submenu"
href=
"
{% url 'PDF' purchaseID %}"
target=
"_blank"
download=
"{{ searchInfo.title }} ({{ searchInfo.purchase_date }}).pdf
"
>
<i
class=
"fa fa-file-pdf-o"
></i>
<span>
Export to PDF
v2
</span>
<span>
Export to PDF
</span>
<span
class=
"pull-right-container"
>
<span
class=
"label label-primary pull-right"
></span>
</span>
...
...
reports/templates/sclData.html
View file @
0d413ed0
reports/urls.py
View file @
0d413ed0
...
...
@@ -16,4 +16,5 @@ urlpatterns = [
url
(
r'^ws/process_progress$'
,
views
.
wsProcessProgress
,
name
=
'wsProcessProgress'
),
url
(
r'^ws/is_public'
,
views
.
wsIs_Public
,
name
=
'wsIs_Public'
),
url
(
r'^ws/wsEditTitle'
,
views
.
wsEditTitle
,
name
=
'wsEditTitle'
),
url
(
r'^ws/PDF/(?P<purchase_id>(\d+))$'
,
views
.
PDFGenerator
,
name
=
'PDF'
),
]
reports/views.py
View file @
0d413ed0
This diff is collapsed.
Click to expand it.
users/templates/User_profile.html
View file @
0d413ed0
...
...
@@ -122,7 +122,7 @@
User Profile
</h1>
<ol
class=
"breadcrumb"
>
<li><a
href=
"
../
"
><i
class=
"fa fa-home"
></i>
Home
</a></li>
<li><a
href=
"
{% url 'map' %}
"
><i
class=
"fa fa-home"
></i>
Home
</a></li>
<li
class=
"active"
>
User profile
</li>
</ol>
</section>
...
...
@@ -368,7 +368,8 @@
type
:
'POST'
,
dataType
:
"json"
,
data
:
{
'title'
:
label
,
"user_id"
:
$
(
'#user_id'
).
val
()},
url
:
'../../users/ws/report_table'
,
//url: '../../users/ws/report_table',
url
:
'{% url "wsPurchasesPM" %}'
,
success
:
function
(
data
)
{
console
.
log
(
data
);
$
(
'#mostrar'
).
empty
();
...
...
users/templates/users_aside.html
View file @
0d413ed0
...
...
@@ -2,7 +2,7 @@
<br>
<ul
class=
"sidebar-menu"
data-widget=
"tree"
>
<li>
<a
class=
"treeview "
href=
"{
{ BASE_URL }}/reports
"
>
<a
class=
"treeview "
href=
"{
% url 'reports' %}
"
>
<i
class=
"fa fa-files-o"
></i>
<span>
Reports
</span>
<span
class=
"pull-right-container"
>
...
...
users/views.py
View file @
0d413ed0
...
...
@@ -35,14 +35,14 @@ def Users(request):
purchases
=
Purchase
.
objects
.
filter
(
user_id
=
user
.
id
)
in_process
=
Purchase
.
objects
.
filter
(
user_id
=
user
.
id
)
.
exclude
(
progress
=
100
)
bytes_size
=
0
for
path
,
directories
,
files
in
os
.
walk
(
USERS_PATH
+
"repsat_test_dev/"
+
user
.
email
):
for
filename
in
files
:
bytes_size
+=
os
.
lstat
(
os
.
path
.
join
(
path
,
filename
))
.
st_size
for
directory
in
directories
:
bytes_size
+=
os
.
lstat
(
os
.
path
.
join
(
path
,
directory
))
.
st_size
bytes_size
+=
os
.
path
.
getsize
(
USERS_PATH
+
"repsat_test_dev/"
+
user
.
email
)
size_repsat
=
best_unit_size
(
bytes_size
)
#
bytes_size = 0
#
for path, directories, files in os.walk(USERS_PATH + "repsat_test_dev/" + user.email):
#
for filename in files:
#
bytes_size += os.lstat(os.path.join(path, filename)).st_size
#
for directory in directories:
#
bytes_size += os.lstat(os.path.join(path, directory)).st_size
#
bytes_size += os.path.getsize(USERS_PATH + "repsat_test_dev/" + user.email)
#
size_repsat = best_unit_size(bytes_size)
user_data
.
append
({
"user_id"
:
user
.
id
,
...
...
@@ -50,7 +50,7 @@ def Users(request):
"searches"
:
searches
.
count
(),
"purchases"
:
purchases
.
count
(),
"in_process"
:
in_process
.
count
(),
"size"
:
size_repsat
,
#
"size": size_repsat,
})
for
search
in
Search
.
objects
.
values
(
'search_name'
)
.
filter
(
user_id
=
user
.
id
)
.
annotate
(
...
...
@@ -155,13 +155,13 @@ def User_id(request, user_id):
in_process
=
Purchase
.
objects
.
filter
(
user_id
=
user
.
id
)
.
exclude
(
progress
=
100
)
bytes_size
=
0
for
path
,
directories
,
files
in
os
.
walk
(
USERS_PATH
+
"repsat_test_dev/"
+
user
.
email
):
for
filename
in
files
:
bytes_size
+=
os
.
lstat
(
os
.
path
.
join
(
path
,
filename
))
.
st_size
for
directory
in
directories
:
bytes_size
+=
os
.
lstat
(
os
.
path
.
join
(
path
,
directory
))
.
st_size
bytes_size
+=
os
.
path
.
getsize
(
USERS_PATH
+
"repsat_test_dev/"
+
user
.
email
)
size_repsat
=
best_unit_size
(
bytes_size
)
#
for path, directories, files in os.walk(USERS_PATH + "repsat_test_dev/"+user.email):
#
for filename in files:
#
bytes_size += os.lstat(os.path.join(path, filename)).st_size
#
for directory in directories:
#
bytes_size += os.lstat(os.path.join(path, directory)).st_size
#
bytes_size += os.path.getsize(USERS_PATH + "repsat_test_dev/"+user.email)
#
size_repsat = best_unit_size(bytes_size)
user_data
.
append
({
"user_id"
:
user
.
id
,
...
...
@@ -169,7 +169,7 @@ def User_id(request, user_id):
"searches"
:
searches
.
count
(),
"purchases"
:
purchases
.
count
(),
"in_process"
:
in_process
.
count
(),
"size"
:
size_repsat
,
#
"size": size_repsat,
})
for
search
in
Search
.
objects
.
values
(
'search_name'
)
.
filter
(
user_id
=
user
.
id
)
.
annotate
(
...
...
@@ -269,13 +269,13 @@ def wsPurchasesPM(request):
table_data
=
[]
data
=
Purchase
.
objects
.
values
(
'user_id'
,
'search__endDate'
,
'search__startDate'
,
'aggreg_date'
,
'search__process_id__name'
,
'
search__search_
name'
)
.
filter
(
'search__process_id__name'
,
'name'
)
.
filter
(
user_id
=
request
.
POST
.
get
(
'user_id'
),
purchased
=
True
,
aggreg_date__month
=
to_if
(
request
.
POST
.
get
(
'title'
)))
.
order_by
(
'aggreg_date'
)
for
producto
in
data
:
table_data
.
append
({
"search_name"
:
producto
[
'
search__search_
name'
],
"search_name"
:
producto
[
'name'
],
"process"
:
producto
[
'search__process_id__name'
],
"purchase_date"
:
str
(
producto
[
'aggreg_date'
])[:
10
],
"startDate"
:
str
(
producto
[
'search__startDate'
])[:
10
],
...
...
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