Skip to content

Commit

Permalink
feat(Forum): share documentation forum on bottom + certification badg…
Browse files Browse the repository at this point in the history
…e on updated at
  • Loading branch information
vincentporte committed Jul 19, 2023
1 parent af2ab31 commit d19b7bf
Show file tree
Hide file tree
Showing 2 changed files with 26 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">'
)
16 changes: 15 additions & 1 deletion lacommunaute/templates/forum/forum_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,22 @@ <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>
{{forum.description.rendered|urlizetrunc_target_blank:30}}
<small>dernière mise à jour le : {{ forum.updated|date:"d/m/Y" }}</small>
<div class="row align-items-sm-center mb-3">
<div class="col-12 col-sm">
</div>
<div class="col-12 col-sm-auto">
{% include "partials/social_share_buttons.html" with text=forum.name instance=forum %}
</div>
</div>
</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 d19b7bf

Please sign in to comment.