Skip to content

Commit

Permalink
Masquage des réactions au contenu et utilisation de member.change_pro…
Browse files Browse the repository at this point in the history
  • Loading branch information
Migwel committed May 22, 2022
1 parent 34c26ba commit 9095fbe
Show file tree
Hide file tree
Showing 2 changed files with 5 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 @@ -332,7 +332,7 @@ <h3>{% trans 'Liens' %}</h3>
</div>
{% endif %}

{% if public_tutos_count > 0 or articles_public_count > 0 or opinions_public_count > 0 or content_reactions_count > 0 %}
{% if public_tutos_count > 0 or articles_public_count > 0 or opinions_public_count > 0 or content_reactions_count > 0 and not hide_forum_activity %}
<div class="linkbox-item primary">
<div class="head">
<h3>{% trans 'Contenus' %}</h3>
Expand Down Expand Up @@ -373,7 +373,7 @@ <h3>{% trans 'Contenus' %}</h3>
</p>
</a>
{% endif %}
{% if content_reactions_count > 0 %}
{% if content_reactions_count > 0 and not hide_forum_activity %}
<a href="{% url "content:list-content-reactions" usr.pk %}" class="tail">
<p>
{% blocktrans count content_reactions_count=content_reactions_count %}
Expand Down Expand Up @@ -458,7 +458,7 @@ <h3>{% trans 'En bêta' %}</h3>
{% endif %}
{% endif %}

{% if not profile.hide_forum_activity or user.is_staff or profile.user == user %}
{% if not hide_forum_activity %}
{% if topics_count > 0 or messages_count > 0 or followed_topics_count > 0 and profile.user == user %}
<div class="linkbox-item primary">
<div class="head">
Expand Down Expand Up @@ -549,7 +549,7 @@ <h2 itemprop="name">
{% endif %}

{% if topics %}
{% if not profile.hide_forum_activity or user.is_staff or profile.user == user %}
{% if not hide_forum_activity %}
<section>
<h2 itemprop="name">
<span>{% trans 'Derniers sujets créés' %}</span>
Expand Down
1 change: 1 addition & 0 deletions zds/member/views/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ def get_context_data(self, **kwargs):
.count()
)
context["content_reactions_count"] = ContentReaction.objects.filter(author=usr).count()
context["hide_forum_activity"] = profile.hide_forum_activity and not self.request.user.has_perm("member.change_profile") and not profile.user == self.request.user

if self.request.user.has_perm("member.change_profile"):
sanctions = list(Ban.objects.filter(user=usr).select_related("moderator"))
Expand Down

0 comments on commit 9095fbe

Please sign in to comment.