Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Site Interludes
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
mediatek
Site Interludes
Commits
57d54c19
Commit
57d54c19
authored
4 years ago
by
Dorian Lesbre
Browse files
Options
Downloads
Patches
Plain Diff
More beautify profile page
parent
5c59c5f9
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
accounts/templates/profile.html
+35
-8
35 additions, 8 deletions
accounts/templates/profile.html
accounts/views.py
+9
-1
9 additions, 1 deletion
accounts/views.py
with
44 additions
and
9 deletions
accounts/templates/profile.html
+
35
−
8
View file @
57d54c19
...
@@ -20,7 +20,17 @@
...
@@ -20,7 +20,17 @@
<li>
{% if user.profile.mug %}Commande une tasse{% else %}Ne commande pas de tasse{% endif %}
</li>
<li>
{% if user.profile.mug %}Commande une tasse{% else %}Ne commande pas de tasse{% endif %}
</li>
<li>
Inscrit à {{ user.profile.nb_meals }} repas.
</li>
<li>
Inscrit à {{ user.profile.nb_meals }} repas.
</li>
{% if settings.activities_allocated %}
{% if settings.activities_allocated %}
{% if my_activities %}
<li>
Inscrit à {{ my_activities|length }} activités
:
<ul>
{% for activity in my_activities %}
<li>
{{ activity.activity }}
</li>
{% endfor %}
</ul>
</li>
{% else %}
<li>
Inscrit à aucune activité
</li>
{% endif %}
{% else %}
{% else %}
{% if my_activities %}
{% if my_activities %}
<li>
{{ my_activities|length }} activités souhaitées
:
<li>
{{ my_activities|length }} activités souhaitées
:
...
@@ -36,17 +46,34 @@
...
@@ -36,17 +46,34 @@
{% endif %}
{% endif %}
</ul>
</ul>
<div
class=
"flex"
>
{% else %}
<strong>
Vous n'êtes pas incrit à l'événement.
</strong>
<a
class=
"button"
href=
"{% url 'desinscription' %}"
>
Me désinscrire
</a>
{% if not settings.inscriptions_open %}
<a
class=
"button"
href=
"{% url 'inscription' %}"
>
Modifier mon inscription
</a>
<p>
Les inscriptions ne sont pas encore ouvertes ou ont été fermées.
</p>
{% endif %}
<br><br>
{% endif %}
{% else %}
<strong>
Vous n'êtes pas incrit à l'événement.
</strong><br><br>
<div
class=
"flex"
>
<div
class=
"flex"
>
{% if user.profile.is_registered %}
{% if settings.inscriptions_open %}
<a
class=
"button"
href=
"{% url 'desinscription' %}"
>
Me désinscrire
</a>
<a
class=
"button"
href=
"{% url 'inscription' %}"
>
Modifier mon inscription
</a>
{% else %}
<script
type=
"text/javascript"
>
function
clicked
()
{
if
(
confirm
(
'
Les inscriptions étant fermées, vous ne pourrez pas vous réinscrire.
\n
Voulez vous vraiment vous désinscrire?
'
))
window
.
location
=
"
{% url 'desinscription' %}
"
;
}
</script>
<button
class=
"button"
onclick=
"clicked();"
>
Me désinscrire
</button>
{% endif %}
{% elif settings.inscriptions_open %}
<a
class=
"button"
href=
"{% url 'inscription' %}"
>
S'inscrire
</a>
<a
class=
"button"
href=
"{% url 'inscription' %}"
>
S'inscrire
</a>
{% endif %}
{% endif %}
<a
class=
"button"
href=
"{% url 'accounts:update' %}"
>
Modifier mes informations
</a>
<a
class=
"button"
href=
"{% url 'accounts:update' %}"
>
Modifier mes informations
</a>
<a
class=
"button"
href=
"{% url 'accounts:logout' %}"
>
Déconnexion
</a>
<a
class=
"button"
href=
"{% url 'accounts:logout' %}"
>
Déconnexion
</a>
...
...
This diff is collapsed.
Click to expand it.
accounts/views.py
+
9
−
1
View file @
57d54c19
...
@@ -55,7 +55,15 @@ class ProfileView(LoginRequiredMixin, TemplateView):
...
@@ -55,7 +55,15 @@ class ProfileView(LoginRequiredMixin, TemplateView):
def
get_context_data
(
self
,
**
kwargs
):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
().
get_context_data
(
**
kwargs
)
context
=
super
().
get_context_data
(
**
kwargs
)
my_activities
=
ActivityList
.
objects
.
filter
(
participant
=
self
.
request
.
user
.
profile
)
settings
=
SiteSettings
.
load
()
if
settings
.
activities_allocated
:
my_activities
=
ActivityList
.
objects
.
filter
(
participant
=
self
.
request
.
user
.
profile
,
accepted
=
True
)
else
:
my_activities
=
ActivityList
.
objects
.
filter
(
participant
=
self
.
request
.
user
.
profile
)
context
[
"
my_activities
"
]
=
my_activities
context
[
"
my_activities
"
]
=
my_activities
return
context
return
context
...
...
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