changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > werc / changeset: Only allow comments for .md files, this avoids silly things like comments for

changeset 370: bba0f2fda217
parent 369: b1112b957e36
child 371: d961d29e9201
author: uriel@engel.se.cat-v.org
date: Mon, 26 Jan 2009 04:56:05 +0100
files: apps/bridge/app.rc apps/bridge/foot.tpl
description: Only allow comments for .md files, this avoids silly things like comments for
loggin form pages, but will need to be improved to become more general.

Simplify some code a bit and cosmetic improvements.
     1.1--- a/apps/bridge/app.rc	Mon Jan 26 04:51:06 2009 +0100
     1.2+++ b/apps/bridge/app.rc	Mon Jan 26 04:56:05 2009 +0100
     1.3@@ -1,9 +1,7 @@
     1.4 fn bridge_init {
     1.5-    # XXX: Should avoid running for 404s, dir lists, etc.
     1.6-    if(! ~ $#enable_comments 0) {
     1.7-        ll_add handlers_body_foot bridge_body_foot 
     1.8+    if(! ~ $#enable_comments 0 && test -f $local_path.md) {
     1.9+        ll_add handlers_body_foot template apps/bridge/foot.tpl
    1.10         if(get_post_args comment_text) {
    1.11-            dprint POST COMMNET $"comment_text
    1.12             d=`{date -n} # FIXME Obvious race
    1.13             d=$local_path^'_werc/comments/'^$d/
    1.14 
    1.15@@ -29,7 +27,3 @@
    1.16 
    1.17 }
    1.18 
    1.19-fn bridge_body_foot {
    1.20-    template apps/bridge/foot.tpl
    1.21-}
    1.22-
     2.1--- a/apps/bridge/foot.tpl	Mon Jan 26 04:51:06 2009 +0100
     2.2+++ b/apps/bridge/foot.tpl	Mon Jan 26 04:56:05 2009 +0100
     2.3@@ -2,8 +2,9 @@
     2.4 % if(test -d $cdir) { 
     2.5     <hr /><h2>Comments</h2>
     2.6 %    for(c in `{ls $cdir/}) {
     2.7-        <div>By: 
     2.8+        <div><b>By: <i> 
     2.9 %           cat $c/user
    2.10+            </i></b>
    2.11             <br />
    2.12 %           cat $c/body | escape_html | sed 's,$,<br />,'
    2.13         <hr /></div>