changeset 10:bd8e75de187a

use the simple_comments plugin instead of juvia now
author Dirk Olmes <dirk@xanthippe.ping.de>
date Mon, 15 Jul 2013 11:43:18 +0200
parents 6e2bcaecf3ec
children bb1f035109da
files pelicanconf.py themes/tuxlite_tbs/templates/article.html themes/tuxlite_tbs/templates/juvia.html themes/tuxlite_tbs/templates/simple_comments.html
diffstat 4 files changed, 37 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/pelicanconf.py	Mon Jul 01 04:09:23 2013 +0200
+++ b/pelicanconf.py	Mon Jul 15 11:43:18 2013 +0200
@@ -10,6 +10,9 @@
 TIMEZONE = 'Europe/Berlin'
 TYPOGRIFY = True
 
+PLUGIN_PATH = '../simple_comments'
+PLUGINS = [ 'simple_comments' ]
+
 # this theme looks ok but has some downsides:
 # - tag list at the bottom only
 # - html validation errors
@@ -26,8 +29,7 @@
 CATEGORY_FEED_ATOM = None
 TRANSLATION_FEED_ATOM = None
 
-JUVIA_URL = 'http://xanthippe.dyndns.org/juvia'
-JUVIA_SITE_KEY='5i1fkpmzhyot9d54c9aurbplte82q5j'
+COMMENT_PATH = 'comments'
 
 # Blogroll
 LINKS =  () #('Pelican', 'http://getpelican.com/'),
--- a/themes/tuxlite_tbs/templates/article.html	Mon Jul 01 04:09:23 2013 +0200
+++ b/themes/tuxlite_tbs/templates/article.html	Mon Jul 15 11:43:18 2013 +0200
@@ -13,6 +13,6 @@
         <h2>Comments</h2>
     {% include "twitter.html" %}
     {% include 'disqus.html' %}
-    {% include 'juvia.html' %}
+    {% include 'simple_comments.html' %}
     </div>
 {% endblock %}
--- a/themes/tuxlite_tbs/templates/juvia.html	Mon Jul 01 04:09:23 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-{% if JUVIA_SITE_KEY %}
-<div id="juvia_comments"></div>
-<script type="text/javascript" class="juvia">
-(function() {
-    var options = {
-        container   : '#juvia_comments',
-        site_key    : '{{ JUVIA_SITE_KEY }}',
-        topic_key   : location.pathname,
-        topic_url   : location.href,
-        topic_title : document.title || location.href,
-        include_base: !window.Juvia,
-        include_css : !window.Juvia
-    };
-
-    function makeQueryString(options) {
-        var key, params = [];
-        for (key in options) {
-            params.push(
-                encodeURIComponent(key) +
-                '=' +
-                encodeURIComponent(options[key]));
-        }
-        return params.join('&');
-    }
-
-    function makeApiUrl(options) {
-        // Makes sure that each call generates a unique URL, otherwise
-        // the browser may not actually perform the request.
-        if (!('_juviaRequestCounter' in window)) {
-            window._juviaRequestCounter = 0;
-        }
-
-        var result =
-            '{{ JUVIA_URL }}/api/show_topic.js' +
-            '?_c=' + window._juviaRequestCounter +
-            '&' + makeQueryString(options);
-        window._juviaRequestCounter++;
-        return result;
-    }
-
-    var s       = document.createElement('script');
-    s.async     = true;
-    s.type      = 'text/javascript';
-    s.className = 'juvia';
-    s.src       = makeApiUrl(options);
-    (document.getElementsByTagName('head')[0] ||
-     document.getElementsByTagName('body')[0]).appendChild(s);
-})();
-</script>
-{% endif %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/themes/tuxlite_tbs/templates/simple_comments.html	Mon Jul 15 11:43:18 2013 +0200
@@ -0,0 +1,32 @@
+{% if article.comments %}
+    {% for comment in article.comments %}
+    <div style="border-bottom: 1px dotted #CCCCCC; padding: 20px 0px 20px 0px;">
+        <div style="font-weight: bold;">
+            {{ comment.Author }}
+        </div>
+        <div style="font-size: 80%; padding: 0px 0px 10px 0px;">
+            {{ comment.Date }}
+        </div>
+        <div>
+            {{ comment.text }}
+        </div>
+    </div>
+    {% endfor %}
+{% endif %}
+<div style="padding: 20px 0px 0px 0px;">
+    <div style="font-size: 120%;">
+        Leave a comment
+    </div>
+    <form action="http://xanthippe.dyndns.org/blog-comments/simple_comments.php" method="POST">
+        <input type="hidden" name="Slug" value="{{ article.slug }}">
+        <div style="padding: 10px 0px 0px 0px;">
+            Your name: <input type="text" name="Author">
+        </div>
+        <div>
+            <textarea rows="5" cols="60" name="Comment"></textarea>
+        </div>
+        <div>
+            <input type="submit" value="Submit">
+        </div>
+    </form>
+</div>
\ No newline at end of file