tinycm rev 65 1.1

Small fix to blog and ls
author Christophe Lincoln <pankso@slitaz.org>
date Sun Feb 16 23:36:43 2014 +0100 (2014-02-16)
parents d73353aed02d
children e899fcee1cd5
files index.cgi plugins/blog/blog.cgi
line diff
     1.1 --- a/index.cgi	Thu Feb 06 19:35:03 2014 +0000
     1.2 +++ b/index.cgi	Sun Feb 16 23:36:43 2014 +0100
     1.3 @@ -571,11 +571,15 @@
     1.4  		cd ${wiki}
     1.5  		for d in $(find . -type f | sed s'/.\///')
     1.6  		do
     1.7 -			echo "<a href='$script?d=${d%.txt}'>${d%.txt}</a>"
     1.8 -			[ "$auth" ] && cat << EOT
     1.9 - : <a href="$script?rm=$d">$(gettext "Remove")</a> || \
    1.10 -<a href="$script?edit=$d">$(gettext "Edit")</a>
    1.11 +			echo -n "<a href='$script?d=${d%.txt}'>${d%.txt}</a>"
    1.12 +			if [ "$auth" ]; then 
    1.13 +				cat << EOT
    1.14 + : <a href="$script?edit=$d">$(gettext "Edit")</a> || \
    1.15 +<a href="$script?rm=$d">$(gettext "Remove")</a> 
    1.16  EOT
    1.17 +			else
    1.18 +				echo ""
    1.19 +			fi
    1.20  		done && unset auth
    1.21  		echo '</pre>'
    1.22  		html_footer ;;
     2.1 --- a/plugins/blog/blog.cgi	Thu Feb 06 19:35:03 2014 +0000
     2.2 +++ b/plugins/blog/blog.cgi	Sun Feb 16 23:36:43 2014 +0100
     2.3 @@ -186,15 +186,16 @@
     2.4  				[ -d "$blog/$p" ] || mkdir -p ${blog}/${p}
     2.5  				# New post ?
     2.6  				if [ ! -f "${blog}/${p}/post.txt" ]; then
     2.7 -					cat > ${blog}/${p}/post.conf << EOT
     2.8 +					echo "New Blog post: <a href='$script?blog=$p'>Read it!</a>" \
     2.9 +						| log_activity
    2.10 +				fi
    2.11 +				# Write config file
    2.12 +				cat > ${blog}/${p}/post.conf << EOT
    2.13  # TinyCM Blog post configuration
    2.14  AUTHOR="$(GET author)"
    2.15  DATE="$(GET date)"
    2.16  TITLE="$(GET title)"
    2.17  EOT
    2.18 -					echo "New Blog post: <a href='$script?blog=$p'>Read it!</a>" \
    2.19 -						| log_activity
    2.20 -				fi
    2.21  				# Write content to file
    2.22  				sed "s/$(echo -en '\r') /\n/g" > ${blog}/${p}/post.txt << EOT
    2.23  $(GET content)