<fieldset><legend>Code Browser</legend>
<div class='key'><input type='radio' name='repoType' value='svn' $(grep -q repoType=svn $metafile && echo checked)>SVN Repository</div>
<div class='value'><input type='text' name='svnRepo' value='$(sed -rn 's:^svnRepo=(.*)$:\1:p' "$metafile")'></div><br>
- <div class='key'><input disabled type='radio' name='repoType' value='git' $(grep -q repoType=git $metafile && echo checked)>GIT Repository</div>
- <div class='value'><input disabled type='text' name='gitRepo' value='$(sed -rn 's:^gitRepo=(.*)$:\1:p' "$metafile")'></div><br>
+ <div class='key'><input type='radio' name='repoType' value='git' $(grep -q repoType=git $metafile && echo checked)>GIT Repository</div>
+ <div class='value'><input type='text' name='gitRepo' value='$(sed -rn 's:^gitRepo=(.*)$:\1:p' "$metafile")'></div><br>
</fieldset>
<fieldset><legend>Donations</legend>
--- /dev/null
+#!/bin/zsh
+url="$(sed -rn 's:\+: :g;s:%:\\x:g;s:^(.*&)?i=([^&]+)(&.*)?$:\2:p' <<<"${QUERY_STRING}")"
+url="$(echo -e "${url}" |sed -rn '1{s:\t: :g;s:\r::g;s:\\:\\\\:g;p}')"
+rev="$(sed -rn 's:\+: :g;s:%:\\x:g;s:^(.*&)?r=([0-9a-fA-F]+)(&.*)?$:\2:p' <<<"${QUERY_STRING}")"
+
+baseuri=$(sed -rn 's:^gitRepo=(.*)$:\1:p' project.meta)
+[ -z "$rev" ] && rev="HEAD"
+
+cat <<SVNEND
+ <div id="LEFT">
+ <h1>Path:</h1>
+ <a href='?p=Subversion&i=/&r=$rev'>[root]</a>
+ $(tmp=$url
+ until [ -z "$tmp" -o "$tmp" = // ]; do
+ echo "<a href='?p=Git&i=$tmp&r=$rev'>/$(basename "$tmp")</a> "
+ tmp=$(dirname "$tmp")/
+ done |tac)
+ <hr><!----------------------------------------------->
+ <h1>Tags:</h1>
+ $(for i in {1.."$lastrev"}; do
+ echo "<a href='?p=Git&i=$url&r=$i'>$i</a>"
+ done)
+
+ <h1>Branches:</h1>
+ $(for i in {1.."$lastrev"}; do
+ echo "<a href='?p=Git&i=$url&r=$i'>$i</a>"
+ done)
+ </div>
+
+ <div id="RIGHT">
+ <h1>Changelog:</h1><hr>
+ $(svn log $(egrep -q '^(.*/|)$' <<<"$url" && echo '') "${baseuri}/${url}" |\
+ sed -rn '2,${s:^-+$:</div>:g;
+ s:^r([0-9]+) \| ([a-zA-Z0-9]+) \| ([0-9: -]+) .+$:<div class="changelog"><h2>Revision \1 by \2<br>at \3</h2>:g;p}')
+ </div>
+
+ <div id="MAIN">
+ <div class='wikitext'><h1>$(basename "$url"), Revision "$rev":</h1>
+ $(if (egrep -q '^(.*/|)$' <<<"$url"); then #are we showing a directory
+ svn ls -r "$rev" "${baseuri}/${url}" |sed -r "s:^.*$:<a href='?p=Subversion\&i=$url/&\&r=$rev'>&</a><br>:g"
+ echo '</div>'
+ else #or are we showing a file
+ lang=$(source-highlight --lang-list |cut -d\ -f1 |grep -x "$(sed 's:.*\.::g' <<<"$url")" || echo sh)
+ grep -q '\.' <<<"$url" || lang=txt
+ svn cat -r "$rev" "${baseuri}/${url}" |source-highlight -s "$lang"
+ fi)
+ </div></div>
+SVNEND