makedist-announcement: two columns layout for index

This commit is contained in:
Silvan Calarco 2012-11-29 12:20:48 +01:00
parent 983fc9a778
commit 4504980fdc

View File

@ -3,7 +3,8 @@
# Copyright (c) 2012 by Silvan Calarco <silvan.calarco@mambasoft.it>
#
VERSION=0.1
. /usr/share/makedist/VERSION
VERSION=$makedist_version
outputlangs="en it"
distribution="openmamba"
@ -73,16 +74,25 @@ fi
echo $"Generating $distversion announcements index"
for outputlang in $outputlangs; do
indexfile=/var/ftp/pub/$distribution/media/$distversion/release-announcement-index.$outputlang.html.inc
> $indexfile
for i in `seq 0 ${#MEDIA_NAME[*]}`; do
mediumdir=/var/ftp/pub/$distribution/media/$distversion/${MEDIA_NAME[i]}
echo -n "${MEDIA_NAME[i]} " >> $indexfile
echo "<table>" > $indexfile
column=0
for i in `seq 1 ${#MEDIA_NAME[*]}`; do
mediumdir=/var/ftp/pub/$distribution/media/$distversion/${MEDIA_NAME[i-1]}
version=
for f in $mediumdir/info/release-announcement-*.$outputlang.html; do
[ -r $f ] || continue
version=`echo $f | sed "s|.*/release-announcement-\(.*\)\.$outputlang.html|\1|"`
echo "<a href='?distrelease=${distversion}&medium=${MEDIA_NAME[i]}&version=${version}&lang=${outputlang}'>${version}</a>" >> $indexfile
done
[ $i -lt ${#MEDIA_NAME[*]} ] && echo -n "<br>" >> $indexfile
[ "$version" ] || continue
[ $column -eq 0 ] && echo -n "<tr>" >> $indexfile
echo -n "<td>${MEDIA_NAME[i-1]}</td>" >> $indexfile
echo -n "<td><a href='?distrelease=${distversion}&medium=${MEDIA_NAME[i-1]}&version=${version}&lang=${outputlang}'>${version}</a></td>" >> $indexfile
[ $column -eq 1 ] && echo "</tr>" >> $indexfile
# [ $i -lt ${#MEDIA_NAME[*]} ] && echo -n "<br>" >> $indexfile
column=`expr $column + 1`
[ $column -gt 1 ] && column=0
done
[ $column -eq 0 ] && echo -n "<td></td></tr>" >> $indexfile
echo "</table>" >> $indexfile
done
#fi