X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=Wiki.page;h=49d4687b2ba255df85f00e5e2f2bb38569a342b3;hb=4d74f6d67635ed9d45929f78bfb299df547ae3a4;hp=5effa39776e13d0c6c3e8ef2564ecebc523b760f;hpb=62c3d9c54dec22772956bea9f2ec482c891e511e;p=busy diff --git a/Wiki.page b/Wiki.page index 5effa39..49d4687 100755 --- a/Wiki.page +++ b/Wiki.page @@ -6,6 +6,8 @@ rev="$(egrep -o '(^|&)(r=)[0-9]{10}(&|$)' <<<"${QUERY_STRING}" |tr -d '&r=')" search="$(egrep -o '(^|&)(s=).+(&|$)' <<<"${QUERY_STRING}" |sed -r 's:^&?s=::;s:\+: :g;s:%:\\x:g')" search="$(echo -e "${search}" |sed 's:\t: :g;s:\r::g;s:\\:\\\\:g' |head -n1)" +[ -z "$ACL_WIKIEDIT" ] && ACL_WIKIEDIT=false + [ -n "$rev" ] && rev=".$rev" if [ -n "$search" ]; then info='' @@ -21,24 +23,31 @@ else 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 < - +
Editing $title
- +

$title

- +
+ WikiEND elif [ -n "$info" -a -r "Wiki/${info}${rev}" ]; then @@ -60,8 +69,9 @@ elif [ -n "$info" -a -r "Wiki/${info}${rev}" ]; then rno=$(($rno+1)) done) Latest

- $($LOGIN && [ -z "$rev" ] && if [ -z "$lock" ]; then - echo "edit this page" + $($LOGIN && if [ -z "$lock" ]; then + [ -z "$rev" ] && echo "edit this page" + [ -n "$rev" ] && echo "Click edit to derive a new page revision from this one." else echo "This page is currently being edited by $lockedit anyway" fi @@ -81,10 +91,10 @@ elif [ -n "$info" -a -r "Wiki/${info}${rev}" ]; then
-
+

$title

$(_wiki Wiki/"${info}${rev}") -
+
WikiEND @@ -92,19 +102,19 @@ WikiEND $LOGIN && cat <Comment / Ask WikiEND stat -c '' Wiki/${info}.comment.<0000000000-9999999999>_<000-999> && for each in $(ls -c Wiki/${info}.comment.<0000000000-9999999999>_<000-999>); do author=$(grep -m1 '^author=' "$each" |cut -d= -f2-) - echo "

$author wrote:

" - tail -n-1 $each - echo '
' + echo "

$author wrote:

" + tail -n+2 $each |_wiki + echo '
' done echo '' @@ -119,7 +129,7 @@ elif [ -z "$info" ]; then
WikiEND if [ -n "$search" ]; then - echo "

Search results for: $search

" + echo "

Wiki search results for: $search

" for each in $(grep -ile "$search" Wiki/<0000000000-9999999999>_<000-999>); do echo " WikiEND - $LOGIN && cat <