Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add Tweet and +1 buttons to reply threads

  • Loading branch information...
commit f97284dd66ae288213eba0c8391ad99f8d75ec61 1 parent cbb86c6
@ginatrapani ginatrapani authored
Showing with 27 additions and 1 deletion.
  1. +5 −1 webapp/_lib/view/_header.tpl
  2. +22 −0 webapp/_lib/view/post.index.tpl
View
6 webapp/_lib/view/_header.tpl
@@ -1,5 +1,5 @@
<!DOCTYPE html>
-<html lang="en">
+<html lang="en" itemscope itemtype="http://schema.org/Article">
<head>
<meta charset="utf-8">
<title>{if $controller_title}{$controller_title} | {/if}{$app_title}</title>
@@ -83,5 +83,9 @@
</script>
{/literal}
+{if $post->post_text}
+<meta itemprop="name" content="{$post->network|ucwords} post by {$post->author_username} on ThinkUp">
+<meta itemprop="description" content="{$post->post_text}">
+{/if}
</head>
<body>
View
22 webapp/_lib/view/post.index.tpl
@@ -68,6 +68,28 @@ thisfield.value = defaulttext;
<h3>{if $post->reply_count_cache eq 1}reply{else}replies{/if}
in {$post->adj_pub_date|relative_datetime}</h3>
+
+{if !$post->is_protected}
+<script src="//platform.twitter.com/widgets.js" type="text/javascript"></script>
+
+ <a href="https://twitter.com/share" class="twitter-share-button"
+ data-via="thinkupapp"
+ data-text="{$post->post_text}"
+ data-related="anywhere:The Javascript API"
+ data-count="none">Tweet</a>
+{literal}
+
+<script type="text/javascript">
+ (function() {
+ var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
+ po.src = 'https://apis.google.com/js/plusone.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
+ })();
+</script>
+
+<g:plusone size="medium" annotation="none"></g:plusone>
+{/literal}
+{/if}
</div>
</div>
</div> <!-- /.clearfix -->
Please sign in to comment.
Something went wrong with that request. Please try again.