<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>templates/config.html</filename>
    </added>
    <added>
      <filename>utils.py</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -10,9 +10,4 @@ handlers:
   script: webapp.py
 - url: /new
   script: webapp.py
-  login: admin
-- url: /shooin
-  script: shooin.py
-  login: admin
-  
-  
+  login: admin
\ No newline at end of file</diff>
      <filename>app.yaml</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,7 @@ from google.appengine.api import users
 import functools
 import os
 from lib import utils, markdown2, BeautifulSoup
-from requesthandler import TehRequestHandler
+from utils import TehRequestHandler, administrator
 import shooin
 
 class Entry(db.Model):
@@ -35,20 +35,6 @@ class Entry(db.Model):
         if self.static == False: return '/entry/'+self.slug
         else: return '/'+self.slug
     
-def administrator(method):
-    @functools.wraps(method)
-    def wrapper(self, *args, **kwargs):
-        user = users.get_current_user()
-        if not user:
-            if self.request.method == &quot;GET&quot;:
-                self.redirect(users.create_login_url(self.request.uri))
-                return
-        if not users.is_current_user_admin():
-            raise webapp.Error(403)
-        else:
-            return method(self, *args, **kwargs)
-    return wrapper
-
 class EntryIndexHandler(TehRequestHandler):
     def get(self):
         entries = Entry.all().filter(&quot;static =&quot;, False)</diff>
      <filename>blog.py</filename>
    </modified>
    <modified>
      <diff>@@ -16,7 +16,7 @@ from google.appengine.api import users
 from google.appengine.api import urlfetch
 import os
 from lib import utils, markdown2, BeautifulSoup
-from requesthandler import TehRequestHandler
+from utils import TehRequestHandler
 from blog import Entry
 from lib import demjson
 from StringIO import StringIO</diff>
      <filename>shooin.py</filename>
    </modified>
    <modified>
      <diff>@@ -56,6 +56,12 @@ form {
   top: 15px;
 }
 
+#logo a span{
+    font-size:1.5em;
+    color:#fff;
+    text-decoration:none;
+}
+
 #feed {
   position: absolute;
   top: 12px;
@@ -98,7 +104,10 @@ form {
 }
 
 .full .entry h1 a,
-.full .entry h1 a:visited {
+.full .entry h1 a:visited,
+.full .entry h2 a,
+.full .entry h2 a:visited,
+ {
   text-decoration: none;
   color: #222222;
 }</diff>
      <filename>static/css/base.css</filename>
    </modified>
    <modified>
      <diff>@@ -2,9 +2,9 @@
 &lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
 &lt;head&gt;
 &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;/&gt;
-&lt;title&gt;
+&lt;title&gt;{{config.title}} | 
 	{% block title %}
-		TEH - minimalist blog tool powered by Google App Engine
+		minimalist blog tool powered by Google App Engine
 	{% endblock %}
 &lt;/title&gt;
 {% block css %}
@@ -17,7 +17,10 @@
 &lt;body&gt;
 &lt;div id=&quot;header&quot;&gt;
 	&lt;div id=&quot;logo&quot;&gt;
-		&lt;a href=&quot;/&quot;&gt;&lt;img src=&quot;/static/images/logo.png&quot; alt=&quot;Teh blog&quot;/&gt;&lt;/a&gt; 
+		&lt;a href=&quot;/&quot;&gt;
+			&lt;!-- img src=&quot;/static/images/logo.png&quot; alt=&quot;Teh blog&quot;/ --&gt;
+			&lt;span&gt;{{config.title}}&lt;/span&gt;
+			&lt;/a&gt; 
 	&lt;/div&gt;&lt;!-- logo --&gt;
 	&lt;div id=&quot;feed&quot;&gt;&lt;a href=&quot;http://teh.appspot.com/feed&quot;&gt;
 		&lt;img src=&quot;/static/images/feed.png&quot; alt=&quot;Subscribe to this blog&quot;/&gt;&lt;/a&gt;
@@ -53,6 +56,9 @@
 
 &lt;div id=&quot;footer&quot;&gt;
 	&amp;copy;2008 Teh blog - &lt;a href=&quot;/about&quot;&gt;About Teh&lt;/a&gt; - &lt;a href=&quot;http://creativecommons.org/licenses/by/2.5/&quot;&gt;Creative Commons License&lt;/a&gt;
+	{% block extrafooter %}
+		
+	{% endblock %}
 &lt;/div&gt;
 &lt;!-- 
 	Layout for Teh blog app - http://teh.appspot.com</diff>
      <filename>templates/base.html</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,31 @@
 		&lt;div class=&quot;body&quot;&gt;
 			{{entry.body_html}}
 		&lt;/div&gt;&lt;!-- body --&gt;
+		{% if config.disqus %}
+			&lt;div class=&quot;entrycomment&quot;&gt;
+				&lt;a href=&quot;{{entry.url}}#disqus_thread&quot;&gt;Comments&lt;/a&gt;
+			&lt;/div&gt;&lt;!-- entrycomment --&gt;
+		{% endif %}
 		&lt;/div&gt;&lt;!-- entry --&gt;
 {% endfor %}
+{% endblock %}
+
+{% block extrafooter %}
+{% if config.disqus %}
+	&lt;script type=&quot;text/javascript&quot;&gt;
+	//&lt;![CDATA[
+	(function() {
+	var links = document.getElementsByTagName('a');
+	var query = '?';
+	for (var i = 0; i &lt; links.length; i++) {
+	if (links[i].href.indexOf('#disqus_thread') &gt;= 0) {
+	query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&amp;';
+	}
+	}
+	document.write('&lt;script type=&quot;text/javascript&quot; src=&quot;http://disqus.com/forums/{{config.disqus}}/get_num_replies.js' + query + '&quot;&gt;&lt;/' + 'script&gt;');
+	})();
+	//]]&gt;
+	&lt;/script&gt;
+
+	{% endif %}
 {% endblock %}
\ No newline at end of file</diff>
      <filename>templates/home.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,7 @@
 {% extends &quot;base.html&quot; %}
+{% block title %}
+{{entry.title}}
+{% endblock %}
 {% block content %}
 &lt;div class=&quot;entry&quot;&gt;
 &lt;h1&gt;&lt;a href=&quot;{{entry.url}}&quot;&gt;{{entry.title}}&lt;/a&gt;&lt;/h1&gt;
@@ -11,10 +14,17 @@
 	{% endfor %}
 &lt;/div&gt;&lt;!-- tags --&gt;
 &lt;/div&gt;&lt;!-- body --&gt;
+&lt;div id=&quot;disqus_thread&quot;&gt;&lt;/div&gt;
 &lt;div id=&quot;controls&quot;&gt;
 	{% if users.is_current_user_admin %}
 	&lt;a href=&quot;{{entry.url}}/edit&quot;&gt;edit&lt;/a&gt; | &lt;a href=&quot;{{entry.url}}/del&quot;&gt;delete&lt;/a&gt;
 	{% endif %}
 &lt;/div&gt;&lt;!-- controls --&gt;
 &lt;/div&gt;&lt;!-- entry --&gt;
+{% endblock %}
+
+{% block extrafooter %}
+	{% if config.disqus %}
+		&lt;script type=&quot;text/javascript&quot; src=&quot;http://disqus.com/forums/{{config.disqus}}/embed.js&quot;&gt;&lt;/script&gt;
+	{% endif %}
 {% endblock %}
\ No newline at end of file</diff>
      <filename>templates/page.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
-{% extends &quot;base.html&quot; %}
+{% extends &quot;formbase.html&quot; %}
 {% block title %}	
 	Data importer
 {% endblock %}</diff>
      <filename>templates/shooin.html</filename>
    </modified>
    <modified>
      <diff>@@ -12,10 +12,10 @@ from google.appengine.ext import webapp
 from google.appengine.ext import db
 from google.appengine.ext.webapp import template
 from google.appengine.api import users
-import functools
+
 import os
 from lib import utils, markdown2, BeautifulSoup
-from requesthandler import TehRequestHandler
+from utils import TehRequestHandler, administrator, Config
 import shooin
 import blog
 
@@ -42,13 +42,26 @@ class HomePageHandler(TehRequestHandler):
         entries.order('-published').fetch(limit=5)
         self.render(&quot;templates/home.html&quot;, entries=entries)
 
-
+class ConfigHandler(TehRequestHandler):
+    @administrator
+    def get(self):
+        self.render(&quot;templates/config.html&quot;)
+    @administrator    
+    def post(self):
+        config = Config.all()
+        config = config.fetch(1)[0]
+        config.title = self.request.get(&quot;title&quot;)
+        config.disqus = self.request.get(&quot;disqus&quot;)
+        config.put()
+        self.redirect('/')
+        
 def main():
     application = webapp.WSGIApplication([
         (r&quot;/&quot;, HomePageHandler),
         (r&quot;/login&quot;, LoginHandler),
         (r&quot;/logout&quot;, LogoutHandler),
-        
+        (r&quot;/config&quot;, ConfigHandler),
+
         (r&quot;/entries&quot;, blog.EntryIndexHandler),
         (r&quot;/feed&quot;, blog.FeedHandler),
         (r&quot;/entry/([^/]+)&quot;, blog.EntryHandler),
@@ -59,9 +72,16 @@ def main():
         (r&quot;/new&quot;, blog.NewEntryHandler),
         (r&quot;/topic/([^/]+)&quot;, blog.TagHandler),
         (r&quot;/shooin/([^/]+)&quot;, shooin.ShooinHandler),
-        
         (r&quot;/([^/]+)&quot;, blog.PageHandler),
         ], debug=True)
+    
+    config = Config.all()
+    if config.count() &gt; 0:
+        config = config.fetch(1)[0]
+    else: 
+        config1 = Config(title=&quot;TEH Blog&quot;)
+        config1.put()
+       
     wsgiref.handlers.CGIHandler().run(application)
 
 if __name__ == &quot;__main__&quot;:</diff>
      <filename>webapp.py</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>requesthandler.py</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>e638a455ff4e6a854dbedfff8d75a0bdbcb58dc9</id>
    </parent>
  </parents>
  <author>
    <name>btbytes</name>
    <email>pradeep@btbytes.com</email>
  </author>
  <url>http://github.com/btbytes/teh/commit/d428f76f0ad8e6d85320fc35239383ff9ff266e0</url>
  <id>d428f76f0ad8e6d85320fc35239383ff9ff266e0</id>
  <committed-date>2008-04-30T21:32:14-07:00</committed-date>
  <authored-date>2008-04-30T21:32:14-07:00</authored-date>
  <message>disqus enabled commenting works; configuration works</message>
  <tree>17ceb54f9297ea472a235158d8bc8bdf5d1c0512</tree>
  <committer>
    <name>btbytes</name>
    <email>pradeep@btbytes.com</email>
  </committer>
</commit>
