tinycm rev 17

index.cgi: small improvments
author Christophe Lincoln <pankso@slitaz.org>
date Sat Jan 04 20:21:17 2014 +0100 (2014-01-04)
parents 340dbb6265cd
children 941ba53b4335
files index.cgi
line diff
     1.1 --- a/index.cgi	Sat Jan 04 19:01:14 2014 +0100
     1.2 +++ b/index.cgi	Sat Jan 04 20:21:17 2014 +0100
     1.3 @@ -272,9 +272,9 @@
     1.4  		-e s"#''\([^']*\)''#<em>\1</em>#"g \
     1.5  		-e s"#__\([^']*\)__#<u>\1</u>#"g \
     1.6  		-e s"#\[\([^]]*\)|\($doc\)\]#<a href='$script?d=\2'>\1</a>#"g \
     1.7 -		-e s"#http://\([^']*\).png#<img src='\0'> \/>#"g \
     1.8 -		-e s"#http://\([^']*\).*# <a href='\0'>\1</a>#"g
     1.9 -	#-e s"/^$/<br \/>/"g
    1.10 +		-e s"#\[\([^]]*\)!\($doc\)\]#<a href='\2'>\1</a>#"g \
    1.11 +		-e s"#\[\(http://*[^]]*.png\)\]#<img src='\1' />#"g \
    1.12 +		-e s"#\[\([^]]*.png\)\]#<img src='content/cloud/\1' />#"g
    1.13  }
    1.14  
    1.15  link_user() {
    1.16 @@ -543,14 +543,23 @@
    1.17  		user_box
    1.18  		users=$(ls -1 $PEOPLE | wc -l)
    1.19  		docs=$(find $wiki -type f | wc -l)
    1.20 -		size="$(du -sh $wiki | awk '{print $1}')"
    1.21 +		wikisize="$(du -sh $wiki | awk '{print $1}')"
    1.22 +		cachesize="$(du -sh $cache | awk '{print $1}')"
    1.23 +		[ "$HG" != "yes" ] && hg=$(gettext "disabled")
    1.24 +		[ "$HG" == "yes" ] && hg=$(gettext "enabled")
    1.25  		echo "<h2>$d</h2>"
    1.26  		if check_auth; then
    1.27 -			echo "<p><b>$(gettext "Users:")</b> $users"
    1.28 -			echo "| <b>$(gettext "Documents:")</b> $docs ($size)</p>"
    1.29 -			[ "$HG" != "yes" ] && echo $(gettext "Hg is disabled")
    1.30 -			echo "<h3>$(gettext "Plugins")</h3>"
    1.31 -			echo '<pre>'
    1.32 +			cat << EOT
    1.33 +<pre>
    1.34 +Users     : $users
    1.35 +Wiki      : $docs ($wikisize)
    1.36 +Cache     : $cachesize
    1.37 +Mercurial : $hg
    1.38 +</pre>
    1.39 +
    1.40 +<h3>$(gettext "Plugins")</h3>
    1.41 +<pre>
    1.42 +EOT
    1.43  			for p in $(ls -1 $plugins)
    1.44  			do
    1.45  				. $plugins/$p/$p.conf