Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autorise le staff à voir la biographie d'un membre banni #6500

Merged
merged 2 commits into from
May 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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