Skip to content

Commit

Permalink
Autorise le staff à voir les données d'un membre banni (#6500)
Browse files Browse the repository at this point in the history
  • Loading branch information
Migwel authored May 27, 2023
1 parent cf48c6f commit ae25244
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions templates/member/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ <h3>{% trans "Présence" %}</h3>
{% if profile.biography or profile.sign or profile.user == user %}
<div class="profile-card bio-container">
<div class="message-content">
{% if not profile.end_ban_read and not profile.can_read %}
{% if hide_because_banned %}
<div class="no-bio">{% trans "La biographie de ce membre est masquée car il a été banni définitivement." %}</div>
{% elif profile.biography %}
{{ profile.biography|emarkdown }}
Expand All @@ -287,7 +287,7 @@ <h3>{% trans "Présence" %}</h3>
{% if profile.sign %}
<div class="message-bottom">
<div class="signature">
{% if not profile.end_ban_read and not profile.can_read %}
{% if hide_because_banned %}
<em>{% trans "La signature de ce membre est masquée car il a été banni définitivement." %}</em>
{% else %}
{{ profile.sign|emarkdown_inline }}
Expand All @@ -305,7 +305,7 @@ <h3>{% trans "Présence" %}</h3>
{% if profile.site or profile.show_email or public_tutos_count > 0 or articles_public_count > 0 or opinions_public_count > 0 or beta_tutos_count > 0 or beta_articles_count > 0 or topics_count > 0 or messages_count > 0 %}
<div class="activity">
<div class="content-linkbox-list {% if profile.biography or profile.sign or profile.user == user %}is-vertical{% endif %}">
{% if profile.end_ban_read or profile.can_read %}
{% if not hide_because_banned %}
{% if profile.site or profile.show_email %}
<div class="linkbox-item primary">
{% if not profile.biography and not profile.sign %}
Expand Down Expand Up @@ -417,7 +417,7 @@ <h3>{% trans 'Contributions' %}</h3>
</div>
{% endif %}

{% if profile.end_ban_read or profile.can_read %}
{% if not hide_because_banned %}
{% if beta_tutos_count > 0 or beta_articles_count > 0 %}
<div class="linkbox-item secondary">
<div class="head">
Expand Down
5 changes: 5 additions & 0 deletions zds/member/views/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ def get_context_data(self, **kwargs):
.distinct()
.count()
)
context["hide_because_banned"] = (
not profile.end_ban_read
and not profile.can_read
and not self.request.user.has_perm("member.change_profile")
)
context["content_reactions_count"] = ContentReaction.objects.filter(author=usr).count()
context["hide_forum_activity"] = (
profile.hide_forum_activity
Expand Down

0 comments on commit ae25244

Please sign in to comment.