tazbug rev 141

Improve mybugs plugin
author Christophe Lincoln <pankso@slitaz.org>
date Wed Feb 22 21:18:03 2017 +0100 (2017-02-22)
parents 49fa101e75f5
children 6d13228babae
files web/plugins/dashboard/dashboard.cgi web/plugins/dashboard/dashboard.conf web/plugins/mybugs/mybugs.cgi web/plugins/mybugs/mybugs.conf web/plugins/mybugs/user.sh web/plugins/skel/skel.conf web/plugins/users/users.cgi
line diff
     1.1 --- a/web/plugins/dashboard/dashboard.cgi	Wed Feb 22 20:51:46 2017 +0100
     1.2 +++ b/web/plugins/dashboard/dashboard.cgi	Wed Feb 22 21:18:03 2017 +0100
     1.3 @@ -24,15 +24,15 @@
     1.4  	fi
     1.5  	if check_auth; then
     1.6  		cat << EOT
     1.7 -<div id="tools">
     1.8 -	$DASHBOARD_TOOLS $ADMIN_TOOLS
     1.9 -</div>
    1.10  <h2>Dashboard</h2>
    1.11  <pre>
    1.12  Bugs count       : $(ls_bugs | wc -l)
    1.13  Messages count   : $(find $bugdir -name msg.* | wc -l)
    1.14  Database size    : $(du -sh $bugdir | awk '{print $1}')
    1.15  </pre>
    1.16 +<div id="tools">
    1.17 +	$DASHBOARD_TOOLS $ADMIN_TOOLS
    1.18 +</div>
    1.19  EOT
    1.20  	
    1.21  		# Only for admins
     2.1 --- a/web/plugins/dashboard/dashboard.conf	Wed Feb 22 20:51:46 2017 +0100
     2.2 +++ b/web/plugins/dashboard/dashboard.conf	Wed Feb 22 21:18:03 2017 +0100
     2.3 @@ -6,3 +6,4 @@
     2.4  
     2.5  # Authenticated users
     2.6  PLUGINS_TOOLS="<a href='?dashboard'>Dashboard</a> ${PLUGINS_TOOLS}"
     2.7 +PROFILE_TOOLS="<a href='?dashboard'>Dashboard</a> ${PROFILE_TOOLS}"
     3.1 --- a/web/plugins/mybugs/mybugs.cgi	Wed Feb 22 20:51:46 2017 +0100
     3.2 +++ b/web/plugins/mybugs/mybugs.cgi	Wed Feb 22 21:18:03 2017 +0100
     3.3 @@ -12,7 +12,7 @@
     3.4  		echo "You must logged to view user bugs" 
     3.5  		html_footer && exit 0
     3.6  	fi
     3.7 -	echo "<h2><a href='?user=$USER'>$(get_gravatar "$MAIL" 48)</a> $USER</h2>"
     3.8 +	echo "<h2><a href='?user=$USER'>$(get_gravatar "$MAIL" 48)</a> $NAME</h2>"
     3.9  	. $plugins/mybugs/user.sh
    3.10  	html_footer && exit 0
    3.11  fi
     4.1 --- a/web/plugins/mybugs/mybugs.conf	Wed Feb 22 20:51:46 2017 +0100
     4.2 +++ b/web/plugins/mybugs/mybugs.conf	Wed Feb 22 21:18:03 2017 +0100
     4.3 @@ -4,12 +4,6 @@
     4.4  SHORT_DESC="Show bugs for a user (also on profile page)"
     4.5  MAINTAINER="devel@slitaz.org"
     4.6  
     4.7 -# All users
     4.8 -BUGS_TOOLS="${BUGS_TOOLS} <a href="?mybugs">My bugs</a>"
     4.9 -
    4.10  # Authenticated users
    4.11 -PLUGINS_TOOLS="${PLUGINS_TOOLS}"
    4.12 -DASHBOARD_TOOLS="${DASHBOARD_TOOLS}"
    4.13 -
    4.14 -# Admin only in Dashboard
    4.15 -ADMIN_TOOLS="${ADMIN_TOOLS}"
    4.16 +PLUGINS_TOOLS="${PLUGINS_TOOLS} <a href="?mybugs">My bugs</a>"
    4.17 +DASHBOARD_TOOLS="${DASHBOARD_TOOLS} <a href="?mybugs">My bugs</a>"
     5.1 --- a/web/plugins/mybugs/user.sh	Wed Feb 22 20:51:46 2017 +0100
     5.2 +++ b/web/plugins/mybugs/user.sh	Wed Feb 22 21:18:03 2017 +0100
     5.3 @@ -3,8 +3,9 @@
     5.4  # This script display bug for a given user. A copy is used on SCN to
     5.5  # display user bugs on profile page with a custom config file to set
     5.6  # $bugdir.
     5.7 -#
     5.8 -[ -f "$plugins/mybugs/user.conf" ] && . $plugins/mybugs/user.conf
     5.9 +# 
    5.10 +[ -f "$plugins/mybugs/bugdir.conf" ] && . $plugins/mybugs/bugdir.conf
    5.11 +[ "$(GET user)" ] && user="$(GET user)"
    5.12  
    5.13  echo "<h3>My bugs</h3>"
    5.14  echo "<pre>"
     6.1 --- a/web/plugins/skel/skel.conf	Wed Feb 22 20:51:46 2017 +0100
     6.2 +++ b/web/plugins/skel/skel.conf	Wed Feb 22 21:18:03 2017 +0100
     6.3 @@ -10,6 +10,7 @@
     6.4  # Authenticated users
     6.5  PLUGINS_TOOLS="${PLUGINS_TOOLS}"
     6.6  DASHBOARD_TOOLS="${DASHBOARD_TOOLS}"
     6.7 +PROFILE_TOOLS="${PROFILE_TOOLS}"
     6.8  
     6.9  # Admin only in Dashboard
    6.10  ADMIN_TOOLS="${ADMIN_TOOLS}"
     7.1 --- a/web/plugins/users/users.cgi	Wed Feb 22 20:51:46 2017 +0100
     7.2 +++ b/web/plugins/users/users.cgi	Wed Feb 22 21:18:03 2017 +0100
     7.3 @@ -15,7 +15,7 @@
     7.4  </pre>
     7.5  
     7.6  <div id="tools">
     7.7 -	$PLUGINS_TOOLS
     7.8 +	$PROFILE_TOOLS
     7.9  	<a href="$script?modprofile">$(gettext "Modify profile")</a>
    7.10  </div>
    7.11  EOT