Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

news: add fb/twitter share buttons #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions pyconbalkan/news/templates/post.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
{% extends "base.html" %}

{% block main_content %}
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = 'https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0';
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>

{# Post #}

Expand All @@ -14,6 +23,9 @@ <h1>{{ post.title }}</h1>
{{ post.text|safe }}
</p>
<h2>Posted by <a href="{% url 'organizer_detail' slug=organizer.slug %}">{{ organizer.user.first_name }} {{ organizer.user.last_name }}</a></h2>
<div class="fb-share-button" data-href="{% url 'post_detail' slug=post.slug %}" data-layout="button_count" data-size="large" data-mobile-iframe="true" style="padding-bottom: 10px"><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fdevelopers.facebook.com%2Fdocs%2Fplugins%2F&amp;src=sdkpreparse" class="fb-xfbml-parse-ignore">Share</a></div>
<div><a href="https://twitter.com/share?ref_src=twsrc%5Etfw" class="twitter-share-button" data-show-count="false" data-size="large" style="padding-bottom: 10px">Tweet</a></div>

</div>
</div>

Expand Down