]> git.plutz.net Git - busy/blobdiff - templates/Wiki_show.page
adapt default m=page mechanism to updated cgi engine
[busy] / templates / Wiki_show.page
index 87e848f805e9d7b588240d1e5c415f3c031dd682..d00f0e59891e47c76c70bff3de9e4b8b9428746a 100755 (executable)
@@ -3,8 +3,7 @@
 list_comments() {
   base="$1"
   
-  stat -c '' Wiki/${base}.comment.<0000000001-9999999999>_<000-999> \
-  && for each in $(ls -c Wiki/${base}.comment.<0000000001-9999999999>_<000-999>); do
+  for each in $(ls -r Wiki/${base}.comment.<0000000001-9999999999>_<000-999>); do
     author=$(grep -m1 '^author=' "$each" |cut -d= -f2-)
     echo "<div class='comment'><h1>$author wrote:</h1><div class='wikitext'>"
     tail -n+2 $each |_wiki
@@ -19,7 +18,7 @@ add_comment(){
       <a id='comment_button' class='function' href='#'
          onclick='javascript:show_screen("comment");hide_screen("comment_button");'>Comment / Ask</a>
       <div id="comment" style="display: none;">
-        <form action="/?action=wikimeta&i=$info" method="post" accept-charset="UTF-8">
+        <form action="./?action=wikimeta&i=$info" method="post" accept-charset="UTF-8">
           <b>Comment:</b><br>
           <textarea name="comm" rows="6" style="width:99%;"></textarea><br>
           <input type="submit" value="Submit">
@@ -31,7 +30,7 @@ WikiEND
 
 cat <<WikiEND
     <div id="LEFT">
-      <form method="GET" action="/${SCRIPTNAME}" accept-charset="utf-8">
+      <form method="GET" action="./" accept-charset="utf-8">
        <input type="hidden" name="p" value="Wiki">
        <input type="text" name="s" placeholder="Search"><br>
        <input type="submit" value="Search Wiki">
@@ -46,10 +45,10 @@ cat <<WikiEND
         done) <a class='rev' href='?p=Wiki&amp;i=$info'>Latest</a><br>
       <hr>
       $($LOGIN && if [ -z "$lock" ]; then
-          [ -z "$rev" ] && echo "<a class='function' href='/?action=lock&amp;p=Wiki&amp;e=$info'>edit this page</a>"
-         [ -n "$rev" ] && echo "Click <a class='function' href='/?action=lock&amp;p=Wiki&amp;e=${info}&amp;r=${rev:s/.//}'>edit</a> to derive a new page revision from this one."
+          [ -z "$rev" ] && echo "<a class='function' href='./?action=lock&amp;p=Wiki&amp;e=$info'>edit this page</a>"
+         [ -n "$rev" ] && echo "Click <a class='function' href='./?action=lock&amp;p=Wiki&amp;e=${info}&amp;r=${rev:s/.//}'>edit</a> to derive a new page revision from this one."
         else
-         echo "<b>This page is currently being edited by $lock</b><a class='function' href='/?action=lock&amp;p=Wiki&amp;e=$info'>edit anyway</a>"
+         echo "<b>This page is currently being edited by $lock</b><a class='function' href='./?action=lock&amp;p=Wiki&amp;e=$info'>edit anyway</a>"
         fi
         $LOGIN && echo '<hr>')
       <h1>Table of Content</h1>
@@ -68,7 +67,7 @@ cat <<WikiEND
     </div>
     <div id="MAIN">
       <div class="wiki"><div class="wikitext">
-        <h1>$title</h1>
+        <h1 class="wikihead">$title</h1>
         $(_wiki Wiki/"${info}${rev}")
       </div></div>
     </div>