]> git.plutz.net Git - busy/commitdiff
implemented version restoring
authorpaul <paul@plutz.net>
Wed, 10 Aug 2011 14:54:35 +0000 (14:54 +0000)
committerpaul <paul@plutz.net>
Wed, 10 Aug 2011 14:54:35 +0000 (14:54 +0000)
svn path=/trunk/; revision=8

Wiki.page

index 490966367705b8b8d744062aa4e6aa007612c0a3..6aaf32e73cfc372c2032dc67d0a26a562da90838 100755 (executable)
--- a/Wiki.page
+++ b/Wiki.page
@@ -21,7 +21,7 @@ else
   lock="$(cut -d: -f1 "$lock")"
 fi
 
   lock="$(cut -d: -f1 "$lock")"
 fi
 
-if [ -n "$edit" -a -r "Wiki/$edit" ]; then
+if [ -n "$edit" -a -r "Wiki/${edit}${rev}" ]; then
   title="$(egrep -x 'title=.+' "Wiki/$edit.meta" |cut -d= -f2- || echo '(Untitled)')"
   cat <<WikiEND
     <form class="edit" action="write/scriptedit.cgi?i=$edit" method="post" accept-charset="UTF-8">
   title="$(egrep -x 'title=.+' "Wiki/$edit.meta" |cut -d= -f2- || echo '(Untitled)')"
   cat <<WikiEND
     <form class="edit" action="write/scriptedit.cgi?i=$edit" method="post" accept-charset="UTF-8">
@@ -34,7 +34,7 @@ if [ -n "$edit" -a -r "Wiki/$edit" ]; then
       <div id="MAIN">
        <div class="wiki">
           <h1>$title</h1>
       <div id="MAIN">
        <div class="wiki">
           <h1>$title</h1>
-          <textarea name="page" rows=30 cols=40>$(cat "Wiki/$edit")</textarea>
+          <textarea name="page" rows=30 cols=40>$(cat "Wiki/${edit}${rev}")</textarea>
         </div>
       </div>
     </form>
         </div>
       </div>
     </form>
@@ -67,8 +67,9 @@ elif [ -n "$info" -a -r "Wiki/${info}${rev}" ]; then
        rno=$(($rno+1))
         done) <a class='rev' href='?p=Wiki&amp;i=$info'>Latest</a><br>
       <hr>
        rno=$(($rno+1))
         done) <a class='rev' href='?p=Wiki&amp;i=$info'>Latest</a><br>
       <hr>
-      $($LOGIN && [ -z "$rev" ] && if [ -z "$lock" ]; then
-         echo "<a class='function' href='write/lock.cgi?p=Wiki&amp;e=$info'>edit this page</a>"
+      $($LOGIN && if [ -z "$lock" ]; then
+          [ -z "$rev" ] && echo "<a class='function' href='write/lock.cgi?p=Wiki&amp;e=$info'>edit this page</a>"
+         [ -n "$rev" ] && echo "Click <a class='function' href='write/lock.cgi?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='write/lock.cgi?p=Wiki&amp;e=$info'>edit anyway</a>"
         fi
         else
          echo "<b>This page is currently being edited by $lock</b><a class='function' href='write/lock.cgi?p=Wiki&amp;e=$info'>edit anyway</a>"
         fi
@@ -126,7 +127,7 @@ elif [ -z "$info" ]; then
       <hr>
 WikiEND
   if [ -n "$search" ]; then
       <hr>
 WikiEND
   if [ -n "$search" ]; then
-    echo "<h1>Search results for: $search</h1>"
+    echo "<h1>Wiki search results for: $search</h1>"
     for each in $(grep -ile "$search" Wiki/<0000000000-9999999999>_<000-999>); do
       echo "<div class='search'><a href='?p=Wiki&amp;i=${each:t}'><h2>$(grep '^title=' "$each.meta" |cut -d= -f2-)</h2></a>"
       grep -C1 -ie "$search" "$each" |sed "s:$search:<b>&</b>:g;s:$:<br>:g"
     for each in $(grep -ile "$search" Wiki/<0000000000-9999999999>_<000-999>); do
       echo "<div class='search'><a href='?p=Wiki&amp;i=${each:t}'><h2>$(grep '^title=' "$each.meta" |cut -d= -f2-)</h2></a>"
       grep -C1 -ie "$search" "$each" |sed "s:$search:<b>&</b>:g;s:$:<br>:g"