tazpkg rev 723
pkgs.cgi: "cat extra": show info for installed packages; "search package": don't wrap checkbox and package name; "search file": shrink looong file paths, highlight search term.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Dec 23 17:44:49 2014 +0200 (2014-12-23) |
parents | c17a50593335 |
children | 473e09f6714e |
files | tazpanel/pkgs.cgi tazpanel/pkgs.css |
line diff
1.1 --- a/tazpanel/pkgs.cgi Tue Dec 23 16:25:43 2014 +0200 1.2 +++ b/tazpanel/pkgs.cgi Tue Dec 23 17:44:49 2014 +0200 1.3 @@ -437,8 +437,15 @@ 1.4 1.5 case $category in 1.6 extra) 1.7 - sed 's|.*|& -- - -- http://mirror.slitaz.org/packages/get/& - - -|' \ 1.8 - $i/extra.list | parse_packages_info 1.9 + NA="$(_n 'n/a')" 1.10 + for pkg in $(cat $i/extra.list); do 1.11 + PKG="$(grep ^$pkg$'\t' $i/installed.info)" 1.12 + if [ -n "$PKG" ]; then 1.13 + echo "$PKG" 1.14 + else 1.15 + echo "$pkg $NA - $NA http://mirror.slitaz.org/packages/get/$pkg - - -" 1.16 + fi 1.17 + done | parse_packages_info 1.18 ;; 1.19 all) 1.20 make_mixed_list | sort -t$'\t' -k1,1 | awk -F$'\t' ' 1.21 @@ -518,11 +525,10 @@ 1.22 </div> 1.23 </div> 1.24 <input type="hidden" name="repo" value="$repo" /> 1.25 - 1.26 - <table class="zebra outbox"> 1.27 EOT 1.28 if [ "$(GET files)" ]; then 1.29 cat <<EOT 1.30 + <table class="zebra outbox filelist"> 1.31 <thead> 1.32 <tr> 1.33 <td>$(_ 'Package')</td> 1.34 @@ -538,11 +544,12 @@ 1.35 cat << EOT 1.36 <tr> 1.37 <td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link $PACKAGE $class)</td> 1.38 - <td>$FILE</td> 1.39 + <td>$(echo "$FILE" | sed "s|$pkg|<span class=\"diff-add\">$pkg</span>|g")</td> 1.40 </tr> 1.41 EOT 1.42 done 1.43 else 1.44 + echo ' <table class="zebra outbox pkglist">' 1.45 table_head 1.46 echo " <tbody>" 1.47 awk -F$'\t' 'BEGIN{IGNORECASE = 1}
2.1 --- a/tazpanel/pkgs.css Tue Dec 23 16:25:43 2014 +0200 2.2 +++ b/tazpanel/pkgs.css Tue Dec 23 17:44:49 2014 +0200 2.3 @@ -26,11 +26,11 @@ 2.4 display: inline-block; } 2.5 2.6 2.7 -.pkglist td:nth-child(1) { 2.8 +.pkglist td:nth-child(1), .filelist td:nth-child(1) { 2.9 white-space: nowrap; 2.10 } 2.11 2.12 -.pkglist td:nth-child(1) a { 2.13 +.pkglist td:nth-child(1) a, .filelist td:nth-child(1) a { 2.14 max-width: 12em; 2.15 } 2.16 2.17 @@ -38,9 +38,14 @@ 2.18 max-width: 7em; 2.19 } 2.20 2.21 -.pkglist td:nth-child(1) a, .pkglist td:nth-child(2) { 2.22 +.pkglist td:nth-child(1) a, .pkglist td:nth-child(2), 2.23 +.filelist td:nth-child(1) a, .filelist td:nth-child(2) { 2.24 white-space: nowrap; 2.25 overflow: hidden; 2.26 text-overflow: ellipsis; -o-text-overflow: ellipsis; 2.27 } 2.28 2.29 +.filelist td:nth-child(2) { 2.30 + max-width: 30em; 2.31 + } 2.32 +