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
0081f439
Commit
0081f439
authored
Feb 26, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs en reports
parent
cc96be5e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
48 additions
and
33 deletions
+48
-33
users_table.html
administration/templates/users_table.html
+26
-24
views.py
administration/views.py
+12
-1
L2ASCL_data.html
reports/templates/L2ASCL_data.html
+9
-8
views.py
reports/views.py
+1
-0
No files found.
administration/templates/users_table.html
View file @
0081f439
...
...
@@ -106,8 +106,7 @@
{% endblock %}
{% block sidebar %}
{% include 'administration_aside.html' %}
<!-- form-group-->
{% include 'administration_aside.html' %}
{% endblock %}
{% block user %}
...
...
@@ -141,30 +140,33 @@
<td>
{{ user.first_name }}
</td>
<td>
{{ user.last_name }}
</td>
<td>
{{ user.email }}
</td>
<form
method=
"post"
action=
"../update/"
>
<form
method=
"post"
action=
"../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=
"is_active"
value=
"1"
{%
if
user
.
status =
=
True
%}
checked
{%
endif
%}
>
{% 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=
"is_active"
value=
"1"
{%
if
user
.
status =
=
True
%}
checked
{%
endif
%}
>
</td>
<td>
<input
type=
"checkbox"
name=
"is_staff"
value=
"1"
{%
if
user
.
staff =
=
True
%}
checked
{%
endif
%}
>
</td>
<td>
<input
type=
"checkbox"
name=
"is_superuser"
value=
"1"
{%
if
user
.
superuser =
=
True
%}
checked
{%
endif
%}
>
</td>
<td>
<button
title=
"save"
type=
"submit"
class=
"btn btn-success"
><i
class=
"fa fa-save"
></i></button>
<!--a href="#" class="btn btn-danger"><i class="fa fa-trash"></i></a-->
</td>
</form>
</tr>
</td>
<td>
<input
type=
"checkbox"
name=
"is_staff"
value=
"1"
{%
if
user
.
staff =
=
True
%}
checked
{%
endif
%}
>
</td>
<td>
<input
type=
"checkbox"
name=
"is_superuser"
value=
"1"
{%
if
user
.
superuser =
=
True
%}
checked
{%
endif
%}
>
</td>
<td>
<button
title=
"save"
type=
"submit"
class=
"btn btn-success"
><i
class=
"fa fa-save"
></i></button>
<a
href=
"#"
class=
"btn btn-info"
title=
"View profile"
><i
class=
"fa fa-user-circle"
></i></a>
</td>
</form>
</tr>
{% endfor %}
</tbody>
</table>
...
...
administration/views.py
View file @
0081f439
from
django.contrib
import
messages
from
django.contrib.auth.models
import
User
from
django.db.models
import
Count
from
django.shortcuts
import
render
,
redirect
import
json
from
django.http
import
HttpResponse
,
HttpResponseRedirect
,
HttpRequest
...
...
@@ -7,8 +8,18 @@ from PIL import Image
# Create your views here.
from
catalog.models
import
Purchase
def
Dashboard
(
request
):
return
render
(
request
,
'dashboard.html'
,
{
"Viewname"
:
"Dashboard"
})
data
=
[]
compras
=
Purchase
.
objects
.
filter
(
purchased
=
True
)
total
=
compras
.
count
()
data
.
append
({
"Total_compras"
:
total
,
})
print
(
total
)
return
render
(
request
,
'dashboard.html'
,
{
"Viewname"
:
"Dashboard"
,
"Datos"
:
data
})
# ----------------------------------------------------------
...
...
reports/templates/L2ASCL_data.html
View file @
0081f439
...
...
@@ -210,8 +210,7 @@
<div
class=
"col-lg-10 col-md-9 col-xs-10 col-lg-offset-1"
id=
"showImage"
>
<img
onclick=
"window.open(this.src)"
class=
"img-responsive"
id=
"satImage"
width=
"400"
height=
"400px"
src=
"../../static/reports/tmpImages/repsat_test_dev/
{{ IMAGE_PATH }}{{ dafaultLabel }}_TCI_60m.jpg"
height=
"400px"
src=
"../../static/reports/tmpImages/repsat_test_dev/{{ IMAGE_PATH }}{{ dafaultLabel }}_TCI_60m.jpg"
style=
"margin-left: auto; margin-right: auto; display: block;"
>
</div>
<div
class=
"col-lg-1 col-md-1 col-xs-1 next"
style=
"display: none"
>
...
...
@@ -289,6 +288,7 @@
maintainAspectRatio
:
false
,
// scales: { xAxes: [{ stacked: true }], yAxes: [{ stacked: true }] },
};
console
.
log
(
config
);
{
%
endautoescape
%
}
// Creamos una gráfica con los datos al macenados en config
var
ctx
=
document
.
getElementById
(
'myChart'
).
getContext
(
'2d'
);
...
...
@@ -329,12 +329,13 @@
// $(".next").hide();
// $(".prev").hide();
// $("#showImage").addClass('col-lg-offset-1');
playImages
=
setInterval
(()
=
>
{
next
();
},
4000
)
;
playImages
=
setInterval
(
function
(){
next
();
},
4000
);
{
#
playImages
=
setInterval
(()
=
>
{
#
}
{
#
next
();
#
}
{
#
},
#
}
{
#
4000
#
}
{
#
)
#
}
{
#
;
#
}
}
function
stop
()
{
...
...
reports/views.py
View file @
0081f439
...
...
@@ -33,6 +33,7 @@ def report_L2ASCL(request, report, purchase_id):
reporteDir
=
report
.
replace
(
'_sclData'
,
''
)
image_path
=
request
.
user
.
email
+
"/"
+
purchase_id
+
"/"
+
"out/"
+
reporteDir
+
"/TCI/thumbnails/"
print
(
image_path
)
absolute_path
=
USERS_PATH
+
request
.
user
.
email
+
"/"
+
purchase_id
+
"/out"
folders
=
os
.
listdir
(
path
=
absolute_path
)
json_route
=
USERS_PATH
+
request
.
user
.
email
+
"/"
+
purchase_id
+
"/"
...
...
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