tazpkg rev 745

pkgs.cgi: show last recharge date in a different way; fix Makefile.
author Aleksej Bobylev <al.bobylev@gmail.com>
date Sun Jan 11 11:51:31 2015 +0200 (2015-01-11)
parents 31829db351f2
children 5c8db125f207
files Makefile tazpanel/pkgs.cgi tazpanel/pkgs.css
line diff
     1.1 --- a/Makefile	Fri Jan 09 17:05:12 2015 +0200
     1.2 +++ b/Makefile	Sun Jan 11 11:51:31 2015 +0200
     1.3 @@ -21,8 +21,8 @@
     1.4  	xgettext -o po/tazpkg.pot -L Shell \
     1.5  		--package-name=TazPkg \
     1.6  		--package-version="$(VERSION)" -kaction -ktitle -k_ -k_n -k_p:1,2 \
     1.7 -		./tazpkg ./tazpkg-convert ./tazpkg-find-depends ./tazpkg-box \
     1.8 -		./pkgs ./pkgs.cgi ./tazpkg-notify
     1.9 +		./tazpkg ./modules/tazpkg-convert ./modules/tazpkg-find-depends ./tazpkg-box \
    1.10 +		./tazpanel/pkgs ./tazpanel/pkgs.cgi ./tazpkg-notify
    1.11  
    1.12  msgmerge:
    1.13  	@for l in $(LINGUAS); do \
     2.1 --- a/tazpanel/pkgs.cgi	Fri Jan 09 17:05:12 2015 +0200
     2.2 +++ b/tazpanel/pkgs.cgi	Sun Jan 11 11:51:31 2015 +0200
     2.3 @@ -1166,23 +1166,28 @@
     2.4  		cat << EOT
     2.5  </div>
     2.6  
     2.7 -<table class="zebra outbox">
     2.8 +<table class="zebra summary">
     2.9  <tbody>
    2.10 -<tr><td>$(_ 'Last recharge:')</td><td>
    2.11 -EOT
    2.12 -		recharged="$(date -r $PKGS_DB/packages.info +%c 2>/dev/null)"
    2.13 -		if [ -z "$recharged" ]; then
    2.14 -			_ 'never'
    2.15 -		else
    2.16 -			echo "<b>$recharged</b>"
    2.17 -			if [ -n "$(find $PKGS_DB/packages.info -mtime +10)" ]; then
    2.18 -				_ '(Older than 10 days)'
    2.19 -			else
    2.20 -				_ '(Not older than 10 days)'
    2.21 -			fi
    2.22 -		fi
    2.23 -		cat << EOT
    2.24 -</td></tr>
    2.25 +<tr>
    2.26 +	<td>$(_ 'Last recharge:')</td>
    2.27 +	<td>$(list=$PKGS_DB/packages.info
    2.28 +	if [ -e $list ]; then
    2.29 +		$((days=$(date +%s)/86400-$(date -r $list +%s)/86400))
    2.30 +		time=$(date -r $list +%R)
    2.31 +		ago="$(_p '%d day ago.' '%d days ago.' $days $days)"
    2.32 +		case $days in
    2.33 +			0) _ 'Today at %s.' $time;;
    2.34 +			1) _ 'Yesterday at %s.' $time;;
    2.35 +			[2-9]) echo $ago;;
    2.36 +			*) echo "<span style='color:red'>$ago</span>"
    2.37 +				_ 'It is recommended to [recharge] the lists.' | \
    2.38 +				sed 's|\[|<a href="?recharge">|;s|\]|</a>|';;
    2.39 +		esac
    2.40 +	else
    2.41 +		_ 'never.'
    2.42 +		_ 'You need to [download] the lists for further work.' | \
    2.43 +		sed 's|\[|<a href="?recharge">|;s|\]|</a>|'
    2.44 +	fi)</td></tr>
    2.45  <tr>
    2.46  	<td>$(_ 'Installed packages:')</td>
    2.47  	<td><b>$(cat $PKGS_DB/installed.info | wc -l)</a></b>
     3.1 --- a/tazpanel/pkgs.css	Fri Jan 09 17:05:12 2015 +0200
     3.2 +++ b/tazpanel/pkgs.css	Sun Jan 11 11:51:31 2015 +0200
     3.3 @@ -29,7 +29,7 @@
     3.4  .select_wrap select {
     3.5  	padding: 5px;
     3.6  	margin:-5px -20px -5px -5px;
     3.7 -	width: 157px;
     3.8 +	width: 162px;
     3.9  	font-size: small;
    3.10  }
    3.11  
    3.12 @@ -100,8 +100,11 @@
    3.13  
    3.14  .pkglist tr { border-bottom: 1pt solid #DDD; }
    3.15  
    3.16 -.pkglist, .pkglist thead { border: 1.5pt solid #BBB!important; }
    3.17 +.pkglist, .pkglist thead, .summary { border: 1.5pt solid #BBB!important; }
    3.18  
    3.19 +.summary td:nth-child(1) {
    3.20 +	width:10%; white-space: nowrap; /* to have minimal width of first column */
    3.21 +	}
    3.22  
    3.23  #actions { overflow: auto; }
    3.24