tazbug rev 153

Improve buggy packages listing
author Christophe Lincoln <pankso@slitaz.org>
date Tue Nov 21 15:41:54 2017 +0100 (16 months ago)
parents ef44034e6d3a
children 5ce0583b6113
files web/plugins/packages/packages.cgi
line diff
     1.1 --- a/web/plugins/packages/packages.cgi	Mon Oct 09 17:10:30 2017 +0100
     1.2 +++ b/web/plugins/packages/packages.cgi	Tue Nov 21 15:41:54 2017 +0100
     1.3 @@ -32,22 +32,39 @@
     1.4  EOT
     1.5  	else
     1.6  		# List all pkgs affected by a bug
     1.7 -		echo "<h2>Buggy packages</h2>"
     1.8 -		echo "<pre>"
     1.9 +		cat << EOT
    1.10 +<h2>Buggy packages</h2>
    1.11 +<div id="plugins">
    1.12 +<table>
    1.13 +	<thead>
    1.14 +		<td>$(gettext "Package name")</td>
    1.15 +		<td>$(gettext "Bug date")</td>
    1.16 +		<td>$(gettext "Action")</td>
    1.17 +	</thead>
    1.18 +EOT
    1.19  		for bug in $(ls $bugdir/open)
    1.20  		do
    1.21 -			. $bugdir/open/${bug}/bug.conf
    1.22 +			. ${bugdir}/open/${bug}/bug.conf
    1.23  			for pkg in ${PKGS}; do
    1.24 +				count=1
    1.25  				if ! echo "$pkgs" | grep -q -w "$pkg"; then
    1.26  					pkgs="$pkgs $PKGS"
    1.27 +				else
    1.28 +					count_${pkg}=$(($count + 1))
    1.29  				fi
    1.30  			unset PKGS
    1.31  			done
    1.32  		done
    1.33  		for pkg in $pkgs; do
    1.34 -			echo "<img src='images/pkg.png' alt='' /> Package: <a href='?pkg=$pkg'>$pkg</a>"
    1.35 +			cat << EOT
    1.36 +	<tr>
    1.37 +		<td><img src='images/pkg.png' alt='' /> <a href='?pkg=$pkg'>$pkg</a></td>
    1.38 +		<td>$count_pkg</td>
    1.39 +		<td>TODO</td>
    1.40 +	</tr>
    1.41 +EOT
    1.42  		done
    1.43 -		echo "</pre>"
    1.44 +		echo "</table></div>"
    1.45  	fi
    1.46  	html_footer
    1.47  	exit 0