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
21a0421e
Commit
21a0421e
authored
Apr 08, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
descripcion reportes
parent
6ef5c08f
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
120 additions
and
111 deletions
+120
-111
dashboard.html
administration/templates/dashboard.html
+10
-15
base_top.html
catalog/templates/base_top.html
+93
-79
views.py
users/views.py
+17
-17
No files found.
administration/templates/dashboard.html
View file @
21a0421e
...
...
@@ -405,7 +405,14 @@
<!-- /.content -->
</div>
<footer
class=
" page-footer font-small special-color-dark pt-5"
style=
"bottom: 0; position: absolute"
>
{% endblock %}
{% block footer %}
<footer
class=
" page-footer font-small special-color-dark pt-5"
style=
"bottom: 0; position: absolute"
>
<!-- Footer Elements -->
<div
class=
"container"
>
<!-- Social buttons
...
...
@@ -450,18 +457,6 @@
</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 %}
...
...
@@ -546,7 +541,7 @@
"<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>"
+
...
...
@@ -558,7 +553,7 @@
"<td>"
+
val
[
'username'
]
+
"</td>"
+
"<td>"
+
val
[
'email'
]
+
"</td>"
+
"<td>"
+
val
[
'purchases'
]
+
"</td>"
+
"<td>"
+
val
[
'storage'
]
+
"</td>"
+
//
"
<
td
>
"+val['storage']+"
<
/td>"
+
"<td>"
+
val
[
'in_process'
]
+
"</td>"
+
"</tr>"
);
...
...
catalog/templates/base_top.html
View file @
21a0421e
This diff is collapsed.
Click to expand it.
users/views.py
View file @
21a0421e
...
...
@@ -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
(
...
...
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