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
41d6e247
Commit
41d6e247
authored
Mar 06, 2019
by
Ulises Morales Ramírez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mapa en modal
parent
8d41936c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
11 deletions
+30
-11
views.py
reports/views.py
+4
-4
profile.html
users/templates/profile.html
+7
-6
views.py
users/views.py
+19
-1
No files found.
reports/views.py
View file @
41d6e247
...
@@ -235,10 +235,10 @@ def wsProcessProgress(request):
...
@@ -235,10 +235,10 @@ def wsProcessProgress(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
.
get
(
pk
=
producto
[
'id'
])
#
item = Purchase.objects.get(pk=producto['id'])
item
.
progress
=
progress
#
item.progress = progress
item
.
save
()
#
item.save()
productList2
.
append
({
productList2
.
append
({
"purchase_id"
:
producto
[
'id'
],
"purchase_id"
:
producto
[
'id'
],
...
...
users/templates/profile.html
View file @
41d6e247
{% load staticfiles %}
{% load staticfiles %}
{% for data in user_data %}
<div
class=
"col-md-3"
>
<div
class=
"col-md-3"
>
<!-- Profile Image -->
<!-- Profile Image -->
<div
class=
"box box-primary"
>
<div
class=
"box box-primary"
>
<div
class=
"box-body box-profile"
>
<div
class=
"box-body box-profile"
>
<img
class=
"profile-user-img img-responsive img-circle"
src=
"{% static 'users/images/user_default.png' %}"
<img
class=
"profile-user-img img-responsive img-circle"
src=
"{% static 'users/images/user_default.png' %}"
alt=
"User profile picture"
>
alt=
"User profile picture"
>
<h3
class=
"profile-username text-center"
>
{{ data.user_fullname }}
</h3>
<h3
class=
"profile-username text-center"
>
{{ user.get_full_name }}
</h3>
<p
class=
"text-muted text-center"
>
Software Engineer
</p>
<p
class=
"text-muted text-center"
>
Software Engineer
</p>
<ul
class=
"list-group list-group-unbordered"
>
<ul
class=
"list-group list-group-unbordered"
>
<li
class=
"list-group-item"
>
<li
class=
"list-group-item"
>
<b>
Searches
</b>
<a
class=
"pull-right"
>
1,322
</a>
<b>
Searches
</b>
<a
class=
"pull-right"
>
{{ data.searches }}
</a>
</li>
</li>
<li
class=
"list-group-item"
>
<li
class=
"list-group-item"
>
<b>
Purchases
</b>
<a
class=
"pull-right"
>
543
</a>
<b>
Purchases
</b>
<a
class=
"pull-right"
>
{{ data.purchases }}
</a>
</li>
</li>
<li
class=
"list-group-item"
>
<li
class=
"list-group-item"
>
<b>
In Process
</b>
<a
class=
"pull-right"
>
13,287
</a>
<b>
In Process
</b>
<a
class=
"pull-right"
>
{{ data.in_process }}
</a>
</li>
</li>
</ul>
</ul>
...
@@ -70,4 +70,5 @@
...
@@ -70,4 +70,5 @@
<!-- /.box-body -->
<!-- /.box-body -->
</div>
</div>
<!-- /.box -->
<!-- /.box -->
</div>
</div>
\ No newline at end of file
{% endfor %}
\ No newline at end of file
users/views.py
View file @
41d6e247
from
django.contrib.auth.models
import
User
from
django.shortcuts
import
render
from
django.shortcuts
import
render
# Create your views here.
# Create your views here.
from
catalog.models
import
Search
,
Purchase
def
Users
(
request
):
def
Users
(
request
):
user_data
=
[]
user
=
User
.
objects
.
get
(
pk
=
request
.
user
.
id
)
searches
=
Search
.
objects
.
filter
(
user_id
=
user
.
id
)
purchases
=
Purchase
.
objects
.
filter
(
user_id
=
user
.
id
)
in_process
=
Purchase
.
objects
.
filter
(
user_id
=
user
.
id
)
.
exclude
(
progress
=
100
)
print
(
searches
.
count
())
user_data
.
append
({
"user_fullname"
:
user
.
first_name
+
" "
+
user
.
last_name
,
"searches"
:
searches
.
count
(),
"purchases"
:
purchases
.
count
(),
"in_process"
:
in_process
.
count
(),
})
return
render
(
request
,
'User_profile.html'
)
return
render
(
request
,
'User_profile.html'
,{
"user_data"
:
user_data
}
)
\ No newline at end of file
\ No newline at end of file
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