Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
nk20
Manage
Activity
Members
Labels
Plan
Issues
31
Issue boards
Milestones
Wiki
Code
Merge requests
5
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BDE
nk20
Commits
be8f2dc3
Commit
be8f2dc3
authored
5 years ago
by
Pierre-antoine Comby
Browse files
Options
Downloads
Patches
Plain Diff
use accordion + history table for profil view
parent
a8403140
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apps/member/views.py
+9
-5
9 additions, 5 deletions
apps/member/views.py
templates/member/profile_detail.html
+37
-3
37 additions, 3 deletions
templates/member/profile_detail.html
with
46 additions
and
8 deletions
apps/member/views.py
+
9
−
5
View file @
be8f2dc3
...
...
@@ -47,13 +47,17 @@ class UserCreateView(CreateView):
class
UserDetailView
(
LoginRequiredMixin
,
DetailView
):
model
=
Profile
context_object_name
=
"
profile
"
def
get_context_data
(
slef
,
**
kwargs
):
context
=
super
().
get_context_data
(
**
kwargs
)
user
=
context
[
'
object
'
].
user
.
note
user_transactions
=
\
Transaction
.
objects
.
all
().
filter
(
Q
(
source
=
user
)
|
Q
(
destination
=
user
))
context
[
'
history_list
'
]
=
user_transactions
user
=
context
[
'
profile
'
].
user
history_list
=
\
Transaction
.
objects
.
all
().
filter
(
Q
(
source
=
user
.
note
)
|
Q
(
destination
=
user
.
note
))
context
[
'
history_list
'
]
=
HistoryTable
(
history_list
)
club_list
=
\
Membership
.
objects
.
all
().
filter
(
user
=
user
).
only
(
"
club
"
)
context
[
'
club_list
'
]
=
ClubTable
(
club_list
)
return
context
...
...
This diff is collapsed.
Click to expand it.
templates/member/profile_detail.html
+
37
−
3
View file @
be8f2dc3
...
...
@@ -23,7 +23,41 @@
<dd
class=
"col-6 col-md-3"
>
{{ object.user.note.balance | pretty_money }}
</dd>
</dl>
<a
href=
"{% url
"
password_change
"
%}"
>
{% trans 'Change password' %}
</a>
<a
class=
"btn btn-primary"
href=
"{% url
'
password_change
'
%}"
>
{% trans 'Change password' %}
</a>
{% render_table history_list %}
{% endblock %}
<div
class=
"accordion"
id=
"accordionExample"
>
<div
class=
"card"
>
<div
class=
"card-header"
id=
"headingOne"
>
<h5
class=
"mb-0"
>
<button
class=
"btn btn-link"
type=
"button"
data-toggle=
"collapse"
data-target=
"#collapseOne"
aria-expanded=
"true"
aria-controls=
"collapseOne"
>
<i
class=
"fa fa-users"
></i>
{% trans "View my memberships" %}
</button>
</h5>
</div>
<div
id=
"collapseOne"
class=
"collapse show"
aria-labelledby=
"headingOne"
data-parent=
"#accordionExample"
>
<div
class=
"card-body"
>
{% render_table club_list %}
</div>
</div>
</div>
<div
class=
"card"
>
<div
class=
"card-header"
id=
"headingTwo"
>
<h5
class=
"mb-0"
>
<button
class=
"btn btn-link collapsed"
type=
"button"
data-toggle=
"collapse"
data-target=
"#collapseTwo"
aria-expanded=
"false"
aria-controls=
"collapseTwo"
>
<i
class=
"fa fa-euro"
></i>
Historique des transactions
</button>
</h5>
</div>
<div
id=
"collapseTwo"
class=
"collapse"
aria-labelledby=
"headingTwo"
data-parent=
"#accordionExample"
>
<div
class=
"card-body"
>
{% render_table history_list %}
</div>
</div>
</div>
</div>
{% endblock %}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment