Skip to content

Commit

Permalink
Merge branch 'dev' into feature/page-accessibilite
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbelval authored Oct 22, 2024
2 parents 8f4eb7e + 4fb6d14 commit 0d6fff5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
17 changes: 17 additions & 0 deletions templates/member/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,23 @@ <h3>{% trans 'Sanctions' %}</h3>
{% trans "Confirmer" %}
</button>
</form>
{% if provider_to_ban %}
<!-- if the user was banned and he was the first for his mail provider, propose quick access to ban provider -->
<a href="#ban-provider-{{ provider_to_ban.pk }}" class="open-modal tail">
<p>
{% trans "Bannir le fournisseur email" %}
</p>
</a>
<form method="post" action="{% url 'check-new-email-provider' provider_to_ban.pk %}" id="ban-provider-{{ provider_to_ban.pk }}" class="modal modal-flex">
<p>
{% blocktrans with provider=provider_to_ban.provider %}
Bannir le fournisseur email <code>{{ provider }}</code>&nbsp;?
{% endblocktrans %}
</p>
{% csrf_token %}
<button type="submit" name="ban" class="btn btn-submit">{% trans "Confirmer" %}</button>
</form>
{% endif %}
{% endif %}
</div>
{% endif %}
Expand Down
6 changes: 6 additions & 0 deletions zds/member/views/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,13 @@ def get_context_data(self, **kwargs):
context["alerts"] = profile.alerts_on_this_profile.all().order_by("-pubdate")
context["has_unsolved_alerts"] = profile.alerts_on_this_profile.filter(solved=False).exists()

if self.request.user.has_perm("user.change_bannedemailprovider"):
new_provider = NewEmailProvider.objects.filter(user=usr).first()
if new_provider is not None:
context["provider_to_ban"] = new_provider

context["summaries"] = self.get_summaries(profile, hide_forum_activity)

return context


Expand Down

0 comments on commit 0d6fff5

Please sign in to comment.