From b928bc7f116e248da450f907083b9e13c49457e1 Mon Sep 17 00:00:00 2001 From: vincent porte Date: Tue, 18 Jul 2023 10:31:22 +0200 Subject: [PATCH] =?UTF-8?q?feat(Forum):=C2=A0share=20documentation=20forum?= =?UTF-8?q?=20on=20top=20+=20certification=20badge=20on=20updated=20at?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lacommunaute/forum/tests/tests_views.py | 11 +++++++++++ lacommunaute/templates/forum/forum_detail.html | 12 +++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/lacommunaute/forum/tests/tests_views.py b/lacommunaute/forum/tests/tests_views.py index 7eeaef259..ab16c1d6e 100644 --- a/lacommunaute/forum/tests/tests_views.py +++ b/lacommunaute/forum/tests/tests_views.py @@ -346,3 +346,14 @@ def test_next_url_in_context(self): response = self.client.get(self.url) self.assertEqual(response.status_code, 200) self.assertEqual(response.context_data["next_url"], self.url) + + def test_share_buttons(self): + forum = CategoryForumFactory(with_public_perms=True, with_child=True) + child_forum = forum.get_children().first() + url = reverse("forum_extension:forum", kwargs={"pk": child_forum.pk, "slug": child_forum.slug}) + + response = self.client.get(url) + self.assertEqual(response.status_code, 200) + self.assertContains( + response, 'div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuSocialShare">' + ) diff --git a/lacommunaute/templates/forum/forum_detail.html b/lacommunaute/templates/forum/forum_detail.html index 73c6c1316..1ed156b09 100644 --- a/lacommunaute/templates/forum/forum_detail.html +++ b/lacommunaute/templates/forum/forum_detail.html @@ -32,8 +32,18 @@

{% if forums %}
+
+
+ + + Certifié par la Plateforme de l'Inclusion le {{ forum.updated|date:"d/m/Y" }} + +
+
+ {% include "partials/social_share_buttons.html" with text=forum.name instance=forum %} +
+
{{forum.description.rendered|urlizetrunc_target_blank:30}} - dernière mise à jour le : {{ forum.updated|date:"d/m/Y" }}