Skip to content

Commit

Permalink
feat(Share): make social_share_buttons template more parametric
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentporte committed Jul 18, 2023
1 parent d3ac3a0 commit af2ab31
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ <h1>{{ topic.subject }}</h1>
{% include "forum_conversation/partials/topic_detail_actions.html" %}
</div>
<div class="col-12 col-sm-auto">
{% include "forum_conversation/partials/social_share_buttons.html" with topic=topic %}
{% include "partials/social_share_buttons.html" with text=topic.subject instance=topic %}
</div>
</div>
<div class="row mt-5 mb-5">
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/templates/forum_conversation/topic_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
{% include "forum_conversation/partials/topic_detail_actions.html" with posts_count=topic.posts_count %}
</div>
<div class="col-12 col-sm-auto">
{% include "forum_conversation/partials/social_share_buttons.html" with topic=topic %}
{% include "partials/social_share_buttons.html" with text=topic.subject instance=topic %}
</div>
</div>
{% empty %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</a>
</p>
<div>
{% include "forum_conversation/partials/social_share_buttons.html" with topic=topic %}
{% include "partials/social_share_buttons.html" with text=topic.subject instance=topic %}
</div>
</div>
<div class="card-body pt-0">
Expand Down
13 changes: 13 additions & 0 deletions lacommunaute/templates/partials/social_share_buttons.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{% load i18n %}
{% load social_share %}

<button class="btn btn-sm btn-ico-only btn-secondary" type="button" id="dropdownMenuSocialShare" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="ri-share-fill ri-lg" aria-label="{% trans "Share this topics on " %}"></i>
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuSocialShare">
{% post_to_facebook instance '<i class="ri-facebook-fill ri-lg"></i> Partager sur Facebook' %}
{% post_to_whatsapp instance '<i class="ri-whatsapp-line ri-lg"></i> Partager sur Whatsapp' %}
{% post_to_twitter text instance '<i class="ri-twitter-line ri-lg"></i> Partager sur Twitter' %}
{% send_email text "Ce lien peut t'intéresser :" instance '<i class="ri-mail-line ri-lg"></i> Partager par email' %}
{% post_to_linkedin instance %}
</div>

0 comments on commit af2ab31

Please sign in to comment.