Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
AE
Sith
Commits
5897318c
Commit
5897318c
authored
Feb 23, 2017
by
Skia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix user picture view with Jinja update
parent
d3514e85
Pipeline
#760
passed with stage
in 3 minutes and 24 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
16 deletions
+8
-16
core/templates/core/user_pictures.jinja
core/templates/core/user_pictures.jinja
+6
-14
core/views/user.py
core/views/user.py
+2
-2
No files found.
core/templates/core/user_pictures.jinja
View file @
5897318c
...
@@ -5,27 +5,19 @@
...
@@ -5,27 +5,19 @@
{%
endblock
%}
{%
endblock
%}
{%
block
content
%}
{%
block
content
%}
{%
set
album
=
None
%}
{%
set
picture_qs
=
profile.pictures.exclude
(
picture
=
None
)
.
order_by
(
'-picture__parent__id'
,
'id'
)
.
select_related
(
'picture__parent__parent__name'
)
%}
{%
set
new_album
=
True
%}
{%
for
a
in
picture_qs.distinct
(
'picture__parent'
)
%}
{%
for
r
in
profile.pictures.exclude
(
picture
=
None
)
.
order_by
(
'-picture__parent__id'
,
'id'
)
-
%}
{%
-
if
album
!=
r.picture.parent
%}
{%
-
if
album
%}
</div>
{%
endif
-
%}
{%
set
new_album
=
True
%}
{%
set
album
=
r.picture.parent
%}
<div
style=
"padding: 10px"
>
<div
style=
"padding: 10px"
>
<h4>
{{
a
lbum
.name
}}
</h4>
<h4>
{{
a
.picture.parent
.name
}}
</h4>
<hr>
<hr>
{%
else
%}
{%
for
r
in
picture_qs.
filter
(
picture__parent
=
a.picture.parent
)
-
%}
{%
set
new_album
=
False
%}
{%
-
endif
%}
<div
class=
"picture"
>
<div
class=
"picture"
>
<a
href=
"
{{
url
(
"sas:picture"
,
picture_id
=
r.picture.id
)
}}
#pict"
>
<a
href=
"
{{
url
(
"sas:picture"
,
picture_id
=
r.picture.id
)
}}
#pict"
>
<img
src=
"
{{
r.picture.get_download_thumb_url
()
}}
"
alt=
"
{{
r.picture.get_display_name
()
}}
"
style=
"max-width: 100%"
/>
<img
src=
"
{{
r.picture.get_download_thumb_url
()
}}
"
alt=
"
{{
r.picture.get_display_name
()
}}
"
style=
"max-width: 100%"
/>
</a>
</a>
</div>
</div>
{%
-
endfor
%}
{%
endfor
%}
</div>
</div>
{%
endfor
%}
{%
endblock
%}
{%
endblock
%}
core/views/user.py
View file @
5897318c
...
@@ -502,8 +502,8 @@ class UserAccountView(UserAccountBase):
...
@@ -502,8 +502,8 @@ class UserAccountView(UserAccountBase):
(
lambda
q
:
q
.
amount
)
(
lambda
q
:
q
.
amount
)
)
)
kwargs
[
'etickets'
]
=
self
.
object
.
customer
.
buyings
.
exclude
(
product__eticket
=
None
).
all
()
kwargs
[
'etickets'
]
=
self
.
object
.
customer
.
buyings
.
exclude
(
product__eticket
=
None
).
all
()
except
:
except
Exception
as
e
:
p
ass
p
rint
(
repr
(
e
))
return
kwargs
return
kwargs
class
UserAccountDetailView
(
UserAccountBase
,
YearMixin
,
MonthMixin
):
class
UserAccountDetailView
(
UserAccountBase
,
YearMixin
,
MonthMixin
):
...
...
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