tazbug view web/plugins/mybugs/user.sh @ rev 143

Fix mybugs plugin if no created bug
author Christophe Lincoln <pankso@slitaz.org>
date Wed Feb 22 21:43:02 2017 +0100 (2017-02-22)
parents 6d13228babae
children d98dc7dce8d4
line source
1 #!/bin/sh
2 #
3 # This script display bug for a given user. A copy is used on SCN to
4 # display user bugs on profile page with a custom config file to set
5 # $bugdir.
6 #
7 [ -f "$plugins/mybugs/bugdir.conf" ] && . $plugins/mybugs/bugdir.conf
8 [ "$(GET user)" ] && user="$(GET user)"
10 if fgrep -q -l "$user" ${bugdir}/*/*/bug.conf; then
11 echo "<h3>My bugs</h3>"
12 echo "<pre>"
13 for bug in $(fgrep -l $user ${bugdir}/*/*/bug.conf | xargs ls -lt | awk '{print $9}')
14 do
15 . ${bug}
16 id=$(basename $(dirname $bug))
17 cat << EOT
18 <img src='images/bug.png' alt='' /> \
19 Bug $id: <a href="?id=$id">$BUG</a> <span class="date">- $DATE</span>
20 EOT
21 done
22 echo "</pre>"
23 fi