Private
Public Access
1
0

added FB and Twitter share buttons

This commit is contained in:
Sander Roosendaal
2017-10-09 11:07:29 +02:00
parent 5b5c5c68a9
commit 1c137a6852
6 changed files with 76 additions and 4 deletions

View File

@@ -12,8 +12,23 @@
<meta property="og:image" content="http://rowsandall.com/{{ graph.filename |spacetohtml }}" />
{% endblock %}
{% block content %}
<h1>{{ workout.name }}</h1>
<h1>{{ workout.name }}</h1>
<div class="grid_12">
<div class="grid_1 alpha">
<div class="fb-share-button" data-href="https://rowsandall.com/rower/graph/{{ graph.id }}" data-layout="button" data-size="small" data-mobile-iframe="false">
<a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://rowsandall.com/rowers/graph/{{ graph.id }}&amp;src=sdkpreparse">Share</a></div>
</div>
<div class="grid_1">
<a class="twitter-share-button"
href="https://twitter.com/intent/tweet"
data-url="https://rowsandall.com/rowers/graph/{{ graph.id }}"
data-text="@rowsandall">Tweet</a>
</div>
</div>
<p>&nbsp;</p>
<div class="grid_12">
<div class="grid_2 alpha">
{% if user.is_authenticated and user == rower.user %}
<p>
@@ -34,7 +49,7 @@
<p>&nbsp;</p>
{% endif %}
</div>
</div>
<div class="grid_12">
<p>
<a href="/{{ graph.filename }}" download="myimage">

View File

@@ -2,6 +2,8 @@
{% load staticfiles %}
{% load rowerfilters %}
{% load tz %}
{% get_current_timezone as TIME_ZONE %}
{% block title %}{{ workout.name }}{% endblock %}
@@ -67,6 +69,20 @@
<td>
<a href="/rowers/workout/{{ workout.id }}">https://rowsandall.com/rowers/workout/{{ workout.id }}</a>
</td>
</tr><tr>
<th>Share to</th>
<td>
<div class="grid_1 alpha">
<div class="fb-share-button" data-href="https://rowsandall.com/rowers/workout/{{ workout.id }}" data-layout="button" data-size="small" data-mobile-iframe="false">
<a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://rowsandall.com/rowers/workout/{{ workout.id }}&amp;src=sdkpreparse">Share</a></div>
</div>
<div class="grid_1">
<a class="twitter-share-button"
href="https://twitter.com/intent/tweet"
data-url="https://rowsandall.com/rowers/workout/{{ workout.id }}"
data-text="@rowsandall">Tweet</a>
</div>
</td>
</tr><tr>
<th>Comments</th>
<td>

View File

@@ -28,6 +28,17 @@
<h1>{{ workout.name }}</h1>
<div class="grid_1 alpha">
<div class="fb-share-button" data-href="https://rowsandall.com/rowers/workout/{{ workout.id }}" data-layout="button" data-size="small" data-mobile-iframe="false">
<a class="fb-xfbml-parse-ignore" target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=https://rowsandall.com/rowers/workout/{{ workout.id }}&amp;src=sdkpreparse">Share</a></div>
</div>
<div class="grid_1">
<a class="twitter-share-button"
href="https://twitter.com/intent/tweet"
data-url="https://rowsandall.com/rowers/workout/{{ workout.id }}"
data-text="@rowsandall">Tweet</a>
</div>
<table width=100%>
<tr>
<th>Rower:</th><td>{{ first_name }} {{ last_name }}</td>

View File

@@ -64,6 +64,7 @@ INSTALLED_APPS = [
'cookielaw',
'django_extensions',
'tz_detect',
'django_social_share',
]
AUTHENTICATION_BACKENDS = (

View File

@@ -3,6 +3,8 @@
{% load rowerfilters %}
{% endblock %}
{% block teams %}
{% if user.is_authenticated and user|has_teams %}
<div class="grid_1 alpha dropdown">

View File

@@ -1,5 +1,6 @@
{% load leaflet_tags %}
{% load cookielaw_tags %}
{% load tz_detect %}
{% tz_detect %}
{% load analytical %}
@@ -42,8 +43,34 @@
{% block meta %} {% endblock %}
{% leaflet_js %}
{% leaflet_css %}
<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.async=true;
js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&version=v2.10&appId=694685920739849";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<link rel="stylesheet" href="https://webapiv2.navionics.com/dist/webapi/webapi.min.css" >
<script type="text/javascript" src="https://webapiv2.navionics.com/dist/webapi/webapi.min.no-dep.js"></script>
<script>window.twttr = (function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0],
t = window.twttr || {};
if (d.getElementById(id)) return t;
js = d.createElement(s);
js.id = id;
js.async=true;
js.src = "https://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
t._e = [];
t.ready = function(f) {
t._e.push(f);
};
return t;
}(document, "script", "twitter-wjs"));</script>
{% analytical_head_bottom %}
</head>
<body data-root="http://webapiv2.navionics.com/dist/webapi/images">