G+ and reddit buttons #209
authorCharles Connell <charles@connells.org>
Sun, 22 Dec 2013 04:22:24 +0000 (23:22 -0500)
committerCharles Connell <charles@connells.org>
Sun, 22 Dec 2013 04:22:24 +0000 (23:22 -0500)
karmaworld/assets/css/global.css
karmaworld/templates/base.html
karmaworld/templates/notes/note_detail.html

index 355ab0167b578856f8327fa0cd1d64364f08c272..7fcd52a96aee6dba4eca566b0d49ac6ff91ffa73 100644 (file)
@@ -833,3 +833,9 @@ legend
 .inline-form {
   border-bottom: 1px dashed #666;
 }
+
+/* Social buttons */
+.social-button {
+  margin: 10px 5px 10px 5px;
+  float: right;
+}
\ No newline at end of file
index 74f330b80cc4f82128f2a913e45c567701780f47..79451fdf467465854ff5b6588d2d5ec1b130cbbd 100644 (file)
 </head>
 <body>
 
-<!-- block bodyscripts -->
-{% block bodyscripts %}
-{% endblock %}
-<!-- end block bodyscripts -->
-
 <!-- include header -->
 {% include 'header.html' %}
 <!-- end include header -->
 <!-- Conditionally include opentip -->
 {% endblock opentip %}
 
+<!-- block bodyscripts -->
+{% block bodyscripts %}
+{% endblock %}
+<!-- end block bodyscripts -->
 
 </body>
 </html>
index 0f1951acbdd220199de78002cbb71de9b8c076e1..7584ab86ae379ef4fd40f008838bc23b1376b817 100644 (file)
@@ -9,17 +9,6 @@
   <script src="{{ STATIC_URL }}js/note-iframe.js" ></script>
 {% endblock %}
 
-{% block bodyscripts %}
-  <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 = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=271212543025990";
-    fjs.parentNode.insertBefore(js, fjs);
-  }(document, 'script', 'facebook-jssdk'));</script>
-{% endblock %}
-
 {% block content %}
   <section id="note_content">
 
 
   </section><!--/note_content-->
 
-    <!--{% url 'note_detail' note.course.school.slug note.course.slug note.slug %}-->
-
-  <div id="facebook" style="position: fixed; right: 10px; bottom: 10px;">
-    <div class="fb-like" data-href="https://karmanotes.org{% url 'note_detail' note.course.school.slug note.course.slug note.slug %}" data-width="25" data-layout="box_count" data-action="recommend" data-show-faces="false" data-share="true"></div>
+  <div id="social-buttons" class="show-for-medium-up" style="position: fixed; right: 0px; bottom: 0px;">
+    <div class="social-button">
+      <script type="text/javascript" src="http://www.reddit.com/static/button/button2.js"></script>
+    </div>
+    <div class="social-button">
+      <div class="g-plusone"
+           data-href="https://karmanotes.org{% url 'note_detail' note.course.school.slug note.course.slug note.slug %}"
+           data-size="tall"
+           data-annotation="bubble"
+           data-width="25"
+           data-align="left"
+           expandTo="left"></div>
+      </div>
+    <div class="social-button">
+      <div class="fb-like"
+           data-href="https://karmanotes.org{% url 'note_detail' note.course.school.slug note.course.slug note.slug %}"
+           data-width="12"
+           data-layout="box_count"
+           data-action="recommend"
+           data-show-faces="false"
+           data-share="true"></div>
+    </div>
   </div>
 {% endblock %}
+
+
+{% block bodyscripts %}
+  <!-- for facebook button -->
+  <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 = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=271212543025990";
+    fjs.parentNode.insertBefore(js, fjs);
+  }(document, 'script', 'facebook-jssdk'));</script>
+
+  <!-- for Google Plus button -->
+  <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?onload=onLoadCallback';
+      var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
+    })();
+  </script>
+{% endblock %}
\ No newline at end of file