Skip to content

Commit

Permalink
feat(Forum): share documentation forum on top + certification badge o…
Browse files Browse the repository at this point in the history
…n updated at
  • Loading branch information
vincentporte committed Jul 18, 2023
1 parent cf10853 commit cd01291
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
11 changes: 11 additions & 0 deletions lacommunaute/forum/tests/tests_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -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">'
)
12 changes: 11 additions & 1 deletion lacommunaute/templates/forum/forum_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,18 @@ <h2 class="mt-3">
{% if forums %}
<div class="s-section__row row">
<div class="col-12 col-lg-9">
<div class="row align-items-sm-center mb-3">
<div class="col-12 col-sm">
<span class="badge badge-xs badge-pill bg-communaute text-white text-decoration-none">
<i class="ri-checkbox-circle-fill"></i>
Certifié par la Plateforme de l'Inclusion le {{ forum.updated|date:"d/m/Y" }}
</span>
</div>
<div class="col-12 col-sm-auto">
{% include "partials/social_share_buttons.html" with text=forum.name instance=forum %}
</div>
</div>
{{forum.description.rendered|urlizetrunc_target_blank:30}}
<small>dernière mise à jour le : {{ forum.updated|date:"d/m/Y" }}</small>
</div>
<div class="col-12 col-lg-3">
<a href="{% url 'forum_extension:forum' parent_forum.slug parent_forum.id %}"
Expand Down

0 comments on commit cd01291

Please sign in to comment.