Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
224374f5
Commit
224374f5
authored
Oct 19, 2016
by
Sli
Browse files
More readable user_account
parent
029bc7cc
Pipeline
#310
failed with stage
in 6 minutes and 35 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
core/templates/core/user_account.jinja
View file @
224374f5
...
...
@@ -12,13 +12,13 @@
</thead>
<tbody>
{%
for
array
in
obj
%}
{%
for
tuple
in
array
%}
{%
if
tuple
[
0
]
!=
0
%}
{%
set
link
=
url
(
'core:user_account_detail'
,
user_id
=
profile.id
,
year
=
tuple
[
1
]
.
year
,
month
=
tuple
[
1
]
.
month
)
%}
{%
for
dict
in
array
%}
{%
if
dict
[
'sum'
]
!=
0
%}
{%
set
link
=
url
(
'core:user_account_detail'
,
user_id
=
profile.id
,
year
=
dict
[
'date'
]
.
year
,
month
=
dict
[
'date'
]
.
month
)
%}
<tr>
<td><a
href=
"
{{
link
}}
"
>
{{
tuple
[
1
]
.
year
}}
</a></td>
<td><a
href=
"
{{
link
}}
"
>
{{
tuple
[
1
]
|
date
(
"E"
)
}}
</a></td>
<td><a
href=
"
{{
link
}}
"
>
{{
tuple
[
0
]
}}
€
</a></td>
<td><a
href=
"
{{
link
}}
"
>
{{
dict
[
'date'
]
.
year
}}
</a></td>
<td><a
href=
"
{{
link
}}
"
>
{{
dict
[
'date'
]
|
date
(
"E"
)
}}
</a></td>
<td><a
href=
"
{{
link
}}
"
>
{{
dict
[
'sum'
]
}}
€
</a></td>
</tr>
{%
endif
%}
{%
endfor
%}
...
...
core/views/user.py
View file @
224374f5
...
...
@@ -427,10 +427,10 @@ class UserAccountView(UserAccountBase):
date__year
=
month
.
year
,
date__month
=
month
.
month
)
stats
[
i
].
append
(
(
sum
([
calc
(
p
)
for
p
in
q
]),
month
)
)
stats
[
i
].
append
(
{
'sum'
:
sum
([
calc
(
p
)
for
p
in
q
]),
'date'
:
month
}
)
i
+=
1
return
stats
...
...
counter/views.py
View file @
224374f5
...
...
@@ -1025,7 +1025,6 @@ class EticketPDFView(CanViewMixin, DetailView):
self
.
object
=
self
.
get_object
()
eticket
=
self
.
object
.
product
.
eticket
user
=
self
.
object
.
customer
.
user
print
(
self
.
object
)
code
=
"%s %s %s %s"
%
(
self
.
object
.
customer
.
user
.
id
,
self
.
object
.
product
.
id
,
self
.
object
.
id
,
self
.
object
.
quantity
)
code
+=
" "
+
eticket
.
get_hash
(
code
)[:
8
].
upper
()
response
=
HttpResponse
(
content_type
=
'application/pdf'
)
...
...
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