tazbug rev 142

Dont show My bugs on profile if any created
author Christophe Lincoln <pankso@slitaz.org>
date Wed Feb 22 21:35:46 2017 +0100 (2017-02-22)
parents b4700d7f9d42
children b49ba342d157
files web/plugins/mybugs/user.sh
line diff
     1.1 --- a/web/plugins/mybugs/user.sh	Wed Feb 22 21:18:03 2017 +0100
     1.2 +++ b/web/plugins/mybugs/user.sh	Wed Feb 22 21:35:46 2017 +0100
     1.3 @@ -3,19 +3,22 @@
     1.4  # This script display bug for a given user. A copy is used on SCN to
     1.5  # display user bugs on profile page with a custom config file to set
     1.6  # $bugdir.
     1.7 -# 
     1.8 +#
     1.9  [ -f "$plugins/mybugs/bugdir.conf" ] && . $plugins/mybugs/bugdir.conf
    1.10  [ "$(GET user)" ] && user="$(GET user)"
    1.11 +list="$(fgrep -l $user ${bugdir}/*/*/bug.conf | xargs ls -lt | awk '{print $9}')"
    1.12  
    1.13 -echo "<h3>My bugs</h3>"
    1.14 -echo "<pre>"
    1.15 -for bug in $(fgrep -l $user ${bugdir}/*/*/bug.conf | xargs ls -lt | awk '{print $9}')
    1.16 -do
    1.17 -	. ${bug}
    1.18 -	id=$(basename $(dirname $bug))
    1.19 -	cat << EOT
    1.20 +if [ "$list" ]; then
    1.21 +	echo "<h3>My bugs</h3>"
    1.22 +	echo "<pre>"
    1.23 +	for bug in ${list}
    1.24 +	do
    1.25 +		. ${bug}
    1.26 +		id=$(basename $(dirname $bug))
    1.27 +		cat << EOT
    1.28  <img src='images/bug.png' alt='' /> \
    1.29  Bug $id: <a href="?id=$id">$BUG</a> <span class="date">- $DATE</span>
    1.30  EOT
    1.31 -done
    1.32 -echo "</pre>"
    1.33 +	done
    1.34 +	echo "</pre>"
    1.35 +fi