tazpkg rev 755 5.3.5
TazPanel part of TazPkg: Development in progress, please note it have few known bugs.
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Tue Mar 24 03:43:36 2015 +0200 (2015-03-24) |
parents | 6da82c132f6b |
children | a8a4dad5b9e1 |
files | tazpanel/pkgs tazpanel/pkgs.cgi tazpanel/pkgs.css |
line diff
1.1 --- a/tazpanel/pkgs Mon Mar 23 13:31:18 2015 +0100 1.2 +++ b/tazpanel/pkgs Tue Mar 24 03:43:36 2015 +0200 1.3 @@ -2,18 +2,16 @@ 1.4 export TEXTDOMAIN='tazpkg' 1.5 1.6 cat <<EOT 1.7 -<li><a href="/pkgs.cgi">$(gettext 'Packages')</a> 1.8 - <ul> 1.9 - <li><a href="/pkgs.cgi?list&my=my&cat=all&repo=Any"><img 1.10 - src="/styles/default/images/tp-list.png" />$(gettext 'My packages')</a></li> 1.11 - <li><a href="/pkgs.cgi?recharge"><img 1.12 - src="/styles/default/images/tp-recharge.png" />$(gettext 'Recharge list')</a></li> 1.13 - <li><a href="/pkgs.cgi?up"><img 1.14 - src="/styles/default/images/tp-up.png" />$(gettext 'Check updates')</a></li> 1.15 - <li><a href="/pkgs.cgi?admin"><img 1.16 - src="/styles/default/images/tp-admin.png" />$(gettext 'Administration')</a></li> 1.17 - </ul> 1.18 -</li> 1.19 + <li tabindex="0"> 1.20 + <span>$(gettext 'Packages')</span> 1.21 + <menu> 1.22 + <li><a data-icon="info" href="/pkgs.cgi">$(gettext 'Summary')</a></li> 1.23 + <li><a data-icon="list" href="/pkgs.cgi?list&my=my&cat=all&repo=Any">$(gettext 'My packages')</a></li> 1.24 + <li><a data-icon="refresh" href="/pkgs.cgi?recharge">$(gettext 'Recharge list')</a></li> 1.25 + <li><a data-icon="upgrade" href="/pkgs.cgi?up">$(gettext 'Check updates')</a></li> 1.26 + <li><a data-icon="admin" href="/pkgs.cgi?admin">$(gettext 'Administration')</a></li> 1.27 + </menu> 1.28 + </li> 1.29 EOT 1.30 1.31 export TEXTDOMAIN=$TEXTDOMAIN_original
2.1 --- a/tazpanel/pkgs.cgi Mon Mar 23 13:31:18 2015 +0100 2.2 +++ b/tazpanel/pkgs.cgi Tue Mar 24 03:43:36 2015 +0200 2.3 @@ -6,7 +6,7 @@ 2.4 # its own code for some tasks. Please KISS, it is important and keep speed 2.5 # in mind. Thanks, Pankso. 2.6 # 2.7 -# (C) 2011-2014 SliTaz GNU/Linux - BSD License 2.8 +# (C) 2011-2015 SliTaz GNU/Linux - BSD License 2.9 # 2.10 2.11 . /lib/libtaz.sh 2.12 @@ -62,10 +62,10 @@ 2.13 i18n_desc $PACKAGE 2.14 cat << EOT 2.15 <tr> 2.16 -<td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link $PACKAGE $class)</td> 2.17 -<td>$VERSION</td> 2.18 -<td>$SHORT_DESC</td> 2.19 -<td><a class="w" href="$WEB_SITE"></a></td> 2.20 + <td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link $PACKAGE $class)</td> 2.21 + <td>$VERSION</td> 2.22 + <td>$SHORT_DESC</td> 2.23 + <td><a data-img="web" href="$WEB_SITE"></a></td> 2.24 </tr> 2.25 EOT 2.26 done 2.27 @@ -80,10 +80,10 @@ 2.28 i18n_desc $PACKAGE 2.29 cat << EOT 2.30 <tr> 2.31 -<td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link $PACKAGE $class)</td> 2.32 -<td>$VERSION</td> 2.33 -<td>$SHORT_DESC</td> 2.34 -<td><a class="w" href="$WEB_SITE"></a></td> 2.35 + <td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link $PACKAGE $class)</td> 2.36 + <td>$VERSION</td> 2.37 + <td>$SHORT_DESC</td> 2.38 + <td><a data-img="web" href="$WEB_SITE"></a></td> 2.39 </tr> 2.40 EOT 2.41 done 2.42 @@ -94,35 +94,36 @@ 2.43 # Show button 2.44 show_button() { 2.45 for button in $@; do 2.46 + class=''; img='' 2.47 case $button in 2.48 - recharge) img='tp-recharge'; label="$(_ 'Recharge list')" ;; 2.49 - up) img='tp-up'; label="$(_ 'Check upgrades')" ;; 2.50 - list) img='tp-list'; label="$(_ 'My packages')" ;; 2.51 - tags) img='tp-tag'; label="$(_ 'Tags')" ;; 2.52 - linkable) img='tp-link'; label="$(_ 'Linkable packages')" ;; 2.53 - admin) img='tp-admin'; label="$(_ 'Administration')" ;; 2.54 - *Install*nf*) img='tp-pkg-ins'; label="$(_ 'Install (Non Free)')" ;; 2.55 - *Install*) img='tp-pkg-ins'; label="$(_ 'Install')" ;; 2.56 - *Remove*) img='tp-pkg-rem'; label="$(_ 'Remove')" ;; 2.57 - *Link*) img='tp-link'; label="$(_ 'Link')" ;; 2.58 - *Block*) img='tp-block'; label="$(_ 'Block')" ;; 2.59 - *Unblock*) img='tp-unblock'; label="$(_ 'Unblock')" ;; 2.60 - *Repack*) img='tp-repack'; label="$(_ 'Repack')" ;; 2.61 - *saveconf*) img='tp-save'; label="$(_ 'Save configuration')" ;; 2.62 - *listconf*) img='tp-list'; label="$(_ 'List configuration files')" ;; 2.63 - *quickcheck*) img='tp-check'; label="$(_ 'Quick check')" ;; 2.64 - *fullcheck*) img='tp-check'; label="$(_ 'Full check')" ;; 2.65 - *clean*) img='tp-remove'; label="$(_ 'Clean')" ;; 2.66 - *setlink*) img='tp-link'; label="$(_ 'Set link')" ;; 2.67 - *removelink*) img='tp-remove'; label="$(_ 'Remove link')" ;; 2.68 - *add-mirror) img='tp-add'; label="$(_n 'Add mirror')" ;; 2.69 - *add-repo) img='tp-add'; label="$(_n 'Add repository')" ;; 2.70 + recharge) class='refresh'; label="$(_ 'Recharge list')" ;; 2.71 + up) class='upgrade'; label="$(_ 'Check upgrades')" ;; 2.72 + list) class='list'; label="$(_ 'My packages')" ;; 2.73 + tags) class='tags'; label="$(_ 'Tags')" ;; 2.74 + linkable) class='link'; label="$(_ 'Linkable packages')" ;; 2.75 + admin) class='admin'; label="$(_ 'Administration')" ;; 2.76 + *Install*nf*) class='install'; label="$(_ 'Install (Non Free)')" ;; 2.77 + *Install*) class='install'; label="$(_ 'Install')" ;; 2.78 + *Remove*) class='remove'; label="$(_ 'Remove')" ;; 2.79 + *Link*) class='link'; label="$(_ 'Link')" ;; 2.80 + *Block*) class='lock'; label="$(_ 'Block')" ;; 2.81 + *Unblock*) class='unlock'; label="$(_ 'Unblock')" ;; 2.82 + *Repack*) class='repack'; label="$(_ 'Repack')" ;; 2.83 + *saveconf*) class='save'; label="$(_ 'Save configuration')" ;; 2.84 + *listconf*) class='list'; label="$(_ 'List configuration files')" ;; 2.85 + *quickcheck*) class='check'; label="$(_ 'Quick check')" ;; 2.86 + *fullcheck*) class='check'; label="$(_ 'Full check')" ;; 2.87 + *clean*) class='remove'; label="$(_ 'Clean')" ;; 2.88 + *setlink*) class='link'; label="$(_ 'Set link')" ;; 2.89 + *removelink*) class='unlink'; label="$(_ 'Remove link')" ;; 2.90 + *add-mirror) class='add'; label="$(_n 'Add mirror')" ;; 2.91 + *add-repo) class='add'; label="$(_n 'Add repository')" ;; 2.92 esac 2.93 - cat << EOT 2.94 - <button class="button" type="submit" name="${button%%=*}" value="${button#*=}"> 2.95 - <img src="$IMAGES/$img.png"/>$label 2.96 - </button> 2.97 -EOT 2.98 + if [ -n "$class" ]; then 2.99 + echo -n "<button data-icon=\"$class\" name=\"${button%%=*}\" value=\"${button#*=}\">$label</button>" 2.100 + else 2.101 + echo -n "<button name=\"${button%%=*}\" value=\"${button#*=}\"><img src=\"$IMAGES/$img.png\"/>$label</button>" 2.102 + fi 2.103 done 2.104 } 2.105 2.106 @@ -139,21 +140,19 @@ 2.107 [ -z "$repo" ] && repo="$(GET repo)" 2.108 [ -z "$repo" ] && repo="Any" 2.109 cat << EOT 2.110 -<form method="get" action=""> 2.111 - <div class="search"><input 2.112 - type="search" name="search" results="5" autosave="pkgsearch" autocomplete="on"><input 2.113 - type="submit" value="$(_n 'Search')"><input 2.114 - type="submit" value="$(_n 'Files')" name="files"> 2.115 - </div> 2.116 -</form> 2.117 +<form class="search"><!-- 2.118 + --><input type="search" name="search" results="5" autosave="pkgsearch" autocomplete="on"><!-- 2.119 + --><button type="submit">$(_n 'Search')</button><!-- 2.120 + --><button name="files">$(_n 'Files')</button><!-- 2.121 +--></form> 2.122 EOT 2.123 } 2.124 2.125 2.126 table_head() { 2.127 cat << EOT 2.128 -<table class="zebra pkglist"> 2.129 - <thead> 2.130 +<table class="wide zebra pkglist" id="head1"> 2.131 + <thead id="head2"> 2.132 <tr> 2.133 <td>$(_ 'Name')</td> 2.134 <td>$(_ 'Version')</td> 2.135 @@ -230,8 +229,8 @@ 2.136 EOT 2.137 fi 2.138 cat << EOT 2.139 - <a href="?tags">$(_ 'All tags...')</a> 2.140 - <a href="?cats">$(_ 'All categories...')</a> 2.141 + <a data-icon="tags" href="?tags">$(_ 'All tags...')</a><br/> 2.142 + <a data-icon="list" href="?cats">$(_ 'All categories...')</a> 2.143 </div> 2.144 </form> 2.145 EOT 2.146 @@ -268,7 +267,7 @@ 2.147 2.148 header_repo_name() { 2.149 [ -d $PKGS_DB/undigest ] && [ "$repo" != "Public" ] && \ 2.150 - echo "<h3>$(_ 'Repository: %s' $(repo_name $1))</h3>" 2.151 + _ 'Repository: %s' $(repo_name $1) 2.152 } 2.153 2.154 2.155 @@ -344,7 +343,7 @@ 2.156 2.157 if [ "$pager" != "<p>$(_ 'Pages:') </p>" ] && [ -n "${list:1:1}" ]; then 2.158 cat << EOT 2.159 -$(header_repo_name $i) 2.160 +<h3>$(header_repo_name $i)</h3> 2.161 $pager 2.162 $(table_head) 2.163 $list 2.164 @@ -388,11 +387,8 @@ 2.165 cat << EOT 2.166 <h2>$(_ 'Linkable packages')</h2> 2.167 2.168 -<form method="get" action=""> 2.169 -<div id="actions"> 2.170 - <div class="float-left">$(_ 'Selection:') $(show_button do=Link)</div> 2.171 - <div class="float-right">$(show_button recharge up)</div> 2.172 -</div> 2.173 +<form class="wide"> 2.174 + $(_ 'Selection:') $(show_button do=Link) 2.175 EOT 2.176 table_head 2.177 target=$(readlink $PKGS_DB/fslink) 2.178 @@ -426,17 +422,18 @@ 2.179 echo "<h2>$(_ 'Categories list')</h2>" 2.180 2.181 for pkgsinfo in $(repo_list /packages.info); do 2.182 - header_repo_name $(dirname $pkgsinfo) 2.183 cat << EOT 2.184 -<table class="zebra outbox"> 2.185 - <thead> 2.186 - <tr> 2.187 - <td>$(_ 'Category')</td> 2.188 - <td>$(_ 'Available packages')</td> 2.189 - <td>$(_ 'Installed packages')</td> 2.190 - </tr> 2.191 - </thead> 2.192 - <tbody> 2.193 +<section> 2.194 + <header>$(header_repo_name $(dirname $pkgsinfo))</header> 2.195 + <table class="wide zebra center"> 2.196 + <thead> 2.197 + <tr> 2.198 + <td>$(_ 'Category')</td> 2.199 + <td>$(_ 'Available packages')</td> 2.200 + <td>$(_ 'Installed packages')</td> 2.201 + </tr> 2.202 + </thead> 2.203 + <tbody> 2.204 EOT 2.205 { 2.206 awk -F$'\t' '{print $3}' $pkgsinfo | sort | uniq -c 2.207 @@ -451,7 +448,11 @@ 2.208 }' | sort | awk '{ 2.209 printf "<tr><td><a href=\"?list&cat=%s\">%s</a></td><td>%d</td><td>%d</td></tr>", $1, $1, $2, $3 2.210 }' 2.211 - echo '</tbody></table>' 2.212 + cat << EOT 2.213 + </tbody> 2.214 + </table> 2.215 +</section> 2.216 +EOT 2.217 done 2.218 ;; 2.219 2.220 @@ -481,19 +482,18 @@ 2.221 <h2>$(_ 'Packages list')</h2> 2.222 <p>$title</p> 2.223 2.224 -<form method="get" action=""> 2.225 -<div id="actions"> 2.226 - <div class="float-left">$(_ 'Selection:') 2.227 - $([ "$my" != 'my' ] && show_button do=Install) 2.228 - $(show_button do=Remove) 2.229 - </div> 2.230 - <div class="float-right">$(show_button recharge up)</div> 2.231 -</div> 2.232 +<form class="wide actions"> 2.233 + $(_ 'Selection:') 2.234 + $([ "$my" != 'my' ] && show_button do=Install) 2.235 + $(show_button do=Remove) 2.236 EOT 2.237 for i in $(repo_list ""); do 2.238 show_list ${my#no} 2.239 done 2.240 - echo '</form>' 2.241 + cat << EOT 2.242 +</form> 2.243 +<script type="text/javascript">window.onscroll = scrollHandler;</script> 2.244 +EOT 2.245 ;; 2.246 2.247 2.248 @@ -511,16 +511,15 @@ 2.249 cat << EOT 2.250 <h2>$(_ 'Search packages')</h2> 2.251 2.252 -<form method="get" action=""> 2.253 +<form class="wide"> 2.254 <div id="actions"> 2.255 - <div class="float-left">$(_ 'Selection:'; show_button do=Install do=Remove) 2.256 - <a href="$(cat $PANEL/lib/checkbox.js)">$(_ 'Toogle all')</a></div> 2.257 - <div class="float-right">$(show_button recharge up)</div> 2.258 + $(_ 'Selection:'; show_button do=Install do=Remove) 2.259 + <a href="$(cat $PANEL/lib/checkbox.js)">$(_ 'Toogle all')</a> 2.260 </div> 2.261 EOT 2.262 if [ -n "$(GET files)" ]; then 2.263 cat <<EOT 2.264 - <table class="zebra outbox filelist"> 2.265 + <table class="zebra filelist"> 2.266 <thead> 2.267 <tr> 2.268 <td>$(_ 'Package')</td> 2.269 @@ -543,7 +542,7 @@ 2.270 else 2.271 table_head 2.272 awk -F$'\t' 'BEGIN{IGNORECASE = 1} 2.273 - $1 $4 ~ /'$pkg'/{print $0}' $(repo_list /packages.info) | parse_packages_info 2.274 + $1 " " $4 ~ /'$pkg'/{print $0}' $(repo_list /packages.info) | parse_packages_info 2.275 fi 2.276 cat << EOT 2.277 </tbody> 2.278 @@ -563,21 +562,19 @@ 2.279 cat << EOT 2.280 <h2>$(_ 'Recharge')</h2> 2.281 2.282 -<form method="get" action=""> 2.283 +<form> 2.284 <div id="actions"> 2.285 - <div class="float-left"> 2.286 - <p>$(_ 'Recharge checks for new or updated packages')</p> 2.287 - </div> 2.288 + <p>$(_ 'Recharge checks for new or updated packages')</p> 2.289 <div class="float-right">$(show_button up)</div> 2.290 </div> 2.291 -<div class="wrapper"> 2.292 + 2.293 <pre> 2.294 EOT 2.295 echo $(_ 'Recharging packages list') | log 2.296 tazpkg recharge | filter_taztools_msgs 2.297 cat << EOT 2.298 </pre> 2.299 -</div> 2.300 + 2.301 <p>$(_ 'Packages lists are up-to-date. You should check for upgrades now.')</p> 2.302 EOT 2.303 ;; 2.304 @@ -593,10 +590,10 @@ 2.305 cat << EOT 2.306 <h2>$(_ 'Up packages')</h2> 2.307 2.308 -<form method="get" action=""> 2.309 +<form> 2.310 <div id="actions"> 2.311 - <div class="float-left">$(_ 'Selection:'; show_button do=Install do=Remove) 2.312 - <button class="button" onclick="$(cat $PANEL/lib/checkbox.js)">$(_ 'Toogle all')</button></div> 2.313 + $(_ 'Selection:'; show_button do=Install do=Remove) 2.314 + <button class="button" onclick="$(cat $PANEL/lib/checkbox.js)">$(_ 'Toogle all')</button> 2.315 <div class="float-right">$(show_button recharge)</div> 2.316 </div> 2.317 EOT 2.318 @@ -658,11 +655,11 @@ 2.319 LOADING_MSG=$(_ 'Getting package info...'); loading_msg 2.320 2.321 cat << EOT 2.322 -<h2>$(_ 'Package %s' $pkg)</h2> 2.323 - 2.324 -<form method="get" action=""> 2.325 -<input type="hidden" name="pkg" value="${pkg#get-}"/> 2.326 -<div id="actions"> 2.327 +<section> 2.328 + <header> 2.329 + $(_ 'Package %s' $pkg) 2.330 + <form> 2.331 + <input type="hidden" name="pkg" value="${pkg#get-}"/> 2.332 EOT 2.333 2.334 # Get receipt variables, show Install/Remove buttons 2.335 @@ -702,8 +699,11 @@ 2.336 2.337 # Show info table 2.338 cat << EOT 2.339 -</div> 2.340 -<table class="zebra summary outbox"> 2.341 + </form> 2.342 + </header> 2.343 + 2.344 + <div> 2.345 +<table class="wide zebra summary"> 2.346 <tbody> 2.347 <tr><td><b>$(_ 'Name')</b></td><td>$PACKAGE</td></tr> 2.348 <tr><td><b>$(_ 'Version')</b></td><td>$VERSION</td></tr> 2.349 @@ -718,30 +718,37 @@ 2.350 $(show_info_links "$SUGGESTED" "$(_ 'Suggested')" 'info') 2.351 </tbody> 2.352 </table> 2.353 +</div> 2.354 +</section> 2.355 EOT 2.356 2.357 # Show description 2.358 DESC="$(tazpkg desc $pkg)" 2.359 - [ -n "$DESC" ] && echo "<pre>$DESC</pre>" 2.360 + [ -n "$DESC" ] && echo "<section><pre>$DESC</pre></section>" 2.361 2.362 # Show configuration files list 2.363 CONFIGS="$(tazpkg list-config $pkg | sed 's|\(.*\)|\1 \1|')" 2.364 - [ -n "$CONFIGS" ] && echo "<p>$(_ 'Configuration files')</p><pre>$(printf '<a href="index.cgi?file=%s">%s</a>\n' $CONFIGS)</pre>" 2.365 + [ -n "$CONFIGS" ] && cat << EOT 2.366 +<section> 2.367 + <header>$(_ 'Configuration files')</header> 2.368 + <pre>$(printf '<a href="index.cgi?file=%s">%s</a>\n' $CONFIGS)</pre> 2.369 +</section> 2.370 +EOT 2.371 2.372 # Show installed files list 2.373 if [ -d $INSTALLED/$pkg ]; then 2.374 cat << EOT 2.375 -<p>$(_ 'Installed files: %s' $(wc -l < $INSTALLED/$pkg/files.list))</p> 2.376 - 2.377 -<pre>$(sort $INSTALLED/$pkg/files.list)</pre> 2.378 +<section> 2.379 + <header>$(_ 'Installed files: %s' $(wc -l < $INSTALLED/$pkg/files.list))</header> 2.380 + <pre>$(sort $INSTALLED/$pkg/files.list)</pre> 2.381 +</section> 2.382 EOT 2.383 else 2.384 cat << EOT 2.385 -<p>$(_ 'Installed files: %s' ' ')</p> 2.386 - 2.387 -<pre> 2.388 -$(lzcat files.list.lzma undigest/*/files.list.lzma 2> /dev/null | awk -vp="$pkg:" '$1==p{print $2}' | sort) 2.389 -</pre> 2.390 +<section> 2.391 + <header>$(_ 'Installed files: %s' ' ')</header> 2.392 + <pre>$(lzcat files.list.lzma undigest/*/files.list.lzma 2> /dev/null | awk -vp="$pkg:" '$1==p{print $2}' | sort)</pre> 2.393 +</section> 2.394 EOT 2.395 fi 2.396 ;; 2.397 @@ -792,12 +799,9 @@ 2.398 2.399 <p>$(_ 'TazPkg administration and settings')</p> 2.400 2.401 -<form method="get" action=""> 2.402 -<input type="hidden" name="admin" /> 2.403 - 2.404 -<div id="actions"> 2.405 +<form id="actions"> 2.406 + <input type="hidden" name="admin"/> 2.407 $(show_button action=saveconf action=listconf action=quickcheck action=fullcheck) 2.408 -</div> 2.409 </form> 2.410 EOT 2.411 case "$(GET action)" in 2.412 @@ -858,19 +862,17 @@ 2.413 mirror=$(cat $PKGS_DB/mirror) 2.414 default_mirror=${mirror%/packages/*} 2.415 cat << EOT 2.416 -<article> 2.417 -<h3>$(_ 'Packages cache')</h3> 2.418 +<section> 2.419 + <header>$(_ 'Packages cache')</header> 2.420 + <form class="wide"> 2.421 + <div>$(_ 'Packages in the cache: %s (%s)' $cache_files $cache_size)</div> 2.422 + <footer>$(show_button admin=clean)</footer> 2.423 + </form> 2.424 +</section> 2.425 2.426 -<form method="get" action=""> 2.427 - <p>$(_ 'Packages in the cache: %s (%s)' $cache_files $cache_size) 2.428 - $(show_button admin=clean) 2.429 - </p> 2.430 -</form> 2.431 -</article> 2.432 2.433 - 2.434 -<article> 2.435 -<h3>$(_ 'Current mirror list')</h3> 2.436 +<section> 2.437 + <header>$(_ 'Current mirror list')</header> 2.438 EOT 2.439 2.440 # List mirrors 2.441 @@ -881,103 +883,120 @@ 2.442 echo "<h4>$(_ 'Repository: %s' "$(repo_name $(dirname $i))")</h4>" 2.443 fi 2.444 cat << EOT 2.445 -<form method="get" action=""> 2.446 -<input type="hidden" name="admin" value="select-mirror"/> 2.447 -<table class="zebra"> 2.448 + <form class="wide"> 2.449 + <input type="hidden" name="admin" value="select-mirror"/> 2.450 + <table class="wide zebra"> 2.451 EOT 2.452 while read line; do 2.453 cat << EOT 2.454 -<tr> 2.455 - <td> 2.456 - <input type="radio" name="mirror" id="$line" value="$line" onchange="this.form.submit()" 2.457 - $([ "$line" == "$default_mirror/" ] && echo -n 'checked="checked"')> 2.458 - <label for="$line"><code>$line</code></label></td> 2.459 - <td><a class="w" href="$line" target="_blank"></a></td> 2.460 - <td><a href="?admin=rm-mirror&mirror=$line&file=$i"> 2.461 - <img src="$IMAGES/tp-remove.png" title="$(_ 'Delete')"/></a></td> 2.462 -</tr> 2.463 + <tr> 2.464 + <td> 2.465 + <input type="radio" name="mirror" id="$line" value="$line" onchange="this.form.submit()" 2.466 + $([ "$line" == "$default_mirror/" ] && echo -n 'checked="checked"')> 2.467 + <label for="$line"><code>$line</code></label></td> 2.468 + <td><a data-img="web" href="$line" target="_blank"></a></td> 2.469 + <td><a data-img="remove" href="?admin=rm-mirror&mirror=$line&file=$i" title="$(_ 'Delete')"></a></td> 2.470 + </tr> 2.471 EOT 2.472 done < $i 2.473 cat << EOT 2.474 -</table> 2.475 -</form> 2.476 + </table> 2.477 + </form> 2.478 2.479 -<form method="get" action=""> 2.480 - <p> 2.481 - <input type="hidden" name="file" value="$i" /> 2.482 - <input type="text" name="mirror" size="40" /> 2.483 - $(show_button admin=add-mirror) 2.484 - </p> 2.485 -</form> 2.486 + <form class="wide"> 2.487 + <footer> 2.488 + <input type="hidden" name="file" value="$i" /> 2.489 + <input type="text" name="mirror" size="40" /> 2.490 + $(show_button admin=add-mirror) 2.491 + </footer> 2.492 + </form> 2.493 EOT 2.494 done 2.495 - echo "</article><article>" 2.496 - echo "<h3>$(_ 'Private repositories')</h3>" 2.497 + cat << EOT 2.498 +</section> 2.499 + 2.500 + 2.501 +<section> 2.502 + <header>$(_ 'Private repositories')</header> 2.503 +EOT 2.504 if [ -n "$(ls $PKGS_DB/undigest 2> /dev/null)" ]; then 2.505 - echo '<table class="zebra">' 2.506 + cat << EOT 2.507 + <table class="wide zebra"> 2.508 +EOT 2.509 ls $PKGS_DB/undigest 2> /dev/null | while read repo ; do 2.510 cat <<EOT 2.511 - <tr><td><a href="?admin=rm-repo&repository=$repo"><img src="$IMAGES/tp-remove.png" title="$(_ 'Delete')"></a>$repo</td></tr> 2.512 + <tr> 2.513 + <td><code>$repo</code></td> 2.514 + <td><a data-img="remove" href="?admin=rm-repo&repository=$repo" title="$(_ 'Delete')"></a></td> 2.515 + </tr> 2.516 EOT 2.517 done 2.518 - echo '</table>' 2.519 + cat << EOT 2.520 + </table> 2.521 +EOT 2.522 fi 2.523 2.524 cat << EOT 2.525 -<form method="get" action=""> 2.526 - <p>$(_ 'Name') <input type="text" name="repository" size="10"/> 2.527 - $(_ 'URL:') <input type="text" name="mirror" value="http://"> 2.528 - $(show_button admin=add-repo)</p> 2.529 -</form> 2.530 -</article> 2.531 + <form class="wide"> 2.532 + <table> 2.533 + <tr><td>$(_ 'Name')</td><td><input type="text" name="repository" size="10"/></td></tr> 2.534 + <tr><td>$(_ 'URL:')</td><td><input type="text" name="mirror" value="http://"></td></tr> 2.535 + </table> 2.536 + <footer> 2.537 + $(show_button admin=add-repo) 2.538 + </footer> 2.539 + </form> 2.540 +</section> 2.541 2.542 2.543 -<article> 2.544 -<h3>$(_ 'Link to another SliTaz installation')</h3> 2.545 +<section> 2.546 + <header>$(_ 'Link to another SliTaz installation')</header> 2.547 + <form class="wide"> 2.548 + <div> 2.549 + $(_ "This link points to the root of another SliTaz installation. You will be able to install packages using soft links to it.") 2.550 + </div> 2.551 + <input type="text" name="link" value="$(readlink $PKGS_DB/fslink 2> /dev/null)"/> 2.552 + <footer> 2.553 + $(show_button admin=setlink admin=removelink) 2.554 + </footer> 2.555 + </form> 2.556 +</section> 2.557 2.558 -<p>$(_ "This link points to the root of another SliTaz installation. \ 2.559 -You will be able to install packages using soft links to it.")</p> 2.560 2.561 -<form method="get" action=""> 2.562 -<p> 2.563 - <input type="text" name="link" value="$(readlink $PKGS_DB/fslink 2> /dev/null)"/> 2.564 - $(show_button admin=setlink admin=removelink) 2.565 -</p> 2.566 -</form> 2.567 -</article> 2.568 +<section> 2.569 + <header id="dvd">$(_ 'SliTaz packages DVD')</header> 2.570 2.571 + <div> 2.572 + $(_ "A bootable DVD image of all available packages for the %s version is generated every day. It also contains a copy of the website and can be used without an internet connection. This image can be installed on a DVD or a USB key." $version) 2.573 2.574 -<article> 2.575 -<h3 id="dvd">$(_ 'SliTaz packages DVD')</h3> 2.576 + <form method="post" action='?admin&action=dvdimage'> 2.577 + $(_ 'Install from ISO image:') 2.578 + <input type="text" name="dvdimage" size="40" value="/root/packages-$version.iso" /> 2.579 + </form> 2.580 + </div> 2.581 2.582 -<p>$(_ "A bootable DVD image of all available packages for the %s version is \ 2.583 -generated every day. It also contains a copy of the website and can be used \ 2.584 -without an internet connection. This image can be installed on a DVD or a USB \ 2.585 -key." $version)</p> 2.586 + <footer> 2.587 + <button data-icon="download" onclick='http://mirror.slitaz.org/iso/$version/packages-$version.iso'> 2.588 + $(_ 'Download DVD image')</button> 2.589 + <button data-icon="link" onclick='?admin&action=dvdusbkey'> 2.590 + $(_ 'Install from DVD/USB key')</button> 2.591 + </footer> 2.592 +</section> 2.593 2.594 -<button class="button" onclick='http://mirror.slitaz.org/iso/$version/packages-$version.iso'> 2.595 - <img src="$IMAGES/tp-dl-dvd.png" />$(_ 'Download DVD image')</button> 2.596 -<button class="button" onclick='?admin&action=dvdusbkey'> 2.597 - <img src="$IMAGES/tp-link.png" />$(_ 'Install from DVD/USB key')</button> 2.598 -<div class="box"> 2.599 - <form method="post" action='?admin&action=dvdimage'> 2.600 - $(_ 'Install from ISO image:') 2.601 - <input type="text" name="dvdimage" size="40" value="/root/packages-$version.iso" /> 2.602 -</div> 2.603 -</form> 2.604 -</article> 2.605 2.606 - 2.607 -<article> 2.608 -<h3>$(_ 'Packages list')</h3> 2.609 - 2.610 -<p>$(_ 'Long list of packages is paginated. Here you can set the page size (default: 100, turning off the pager: 0).')</p> 2.611 -<form method="get" action=""> 2.612 - <input type="hidden" name="admin" value="pager" /> 2.613 - <input type="number" name="pager" value="$pager" min="0" step="10" size="4" /> 2.614 - <button class="button" type="submit">$(_ 'Set')</button> 2.615 -</form> 2.616 -</article> 2.617 +<section> 2.618 + <header>$(_ 'Packages list')</header> 2.619 + <form class="wide"> 2.620 + <div> 2.621 + $(_ 'Long list of packages is paginated. Here you can set the page size (default: 100, turning off the pager: 0).') 2.622 + </div> 2.623 + <input type="hidden" name="admin" value="pager"/> 2.624 + <input type="number" name="pager" value="$pager" min="0" step="10" size="4"/> 2.625 + <footer> 2.626 + <button data-icon="ok" type="submit">$(_ 'Set')</button> 2.627 + </footer> 2.628 + </form> 2.629 +</section> 2.630 EOT 2.631 ;; 2.632 2.633 @@ -1098,16 +1117,12 @@ 2.634 2.635 tag=$(GET tag) 2.636 cat << EOT 2.637 -<h2>$(_ 'Tag "%s"' $tag)</h2> 2.638 +<h2 data-icon="tag">$(_ 'Tag "%s"' $tag)</h2> 2.639 2.640 -<form method="get" action=""> 2.641 +<form> 2.642 <div id="actions"> 2.643 - <div class="float-left"> 2.644 - $(_ 'Selection:'; show_button do=Install do=Remove) 2.645 - </div> 2.646 - <div class="float-right"> 2.647 - $(show_button tags) 2.648 - </div> 2.649 + $(_ 'Selection:'; show_button do=Install do=Remove) 2.650 + <div class="float-right">$(show_button tags)</div> 2.651 </div> 2.652 EOT 2.653 for i in $(repo_list ""); do 2.654 @@ -1126,10 +1141,9 @@ 2.655 cat << EOT 2.656 <h2>$(_ 'Blocked packages list')</h2> 2.657 2.658 -<form method="get" action=""> 2.659 +<form> 2.660 <div id="actions"> 2.661 - <div class="float-left">$(_ 'Selection:'; show_button do=Unblock) 2.662 - </div> 2.663 + $(_ 'Selection:'; show_button do=Unblock) 2.664 </div> 2.665 EOT 2.666 table_head 2.667 @@ -1150,27 +1164,26 @@ 2.668 search_form; sidebar 2.669 2.670 cat << EOT 2.671 -<h2>$(_ 'Summary')</h2> 2.672 - 2.673 -<form method="get" action=""> 2.674 -<div id="actions"> 2.675 +<form id="actions2"> 2.676 EOT 2.677 fslink=$(readlink $PKGS_DB/fslink) 2.678 [ -n "$fslink" -a -d "$fslink/$INSTALLED" ] && show_button linkable 2.679 show_button recharge up admin 2.680 cat << EOT 2.681 -</div> 2.682 +</form> 2.683 2.684 -<article> 2.685 -<h3>$(_ 'Summary')</h3> 2.686 -<table class="zebra summary"> 2.687 -<tbody> 2.688 -<tr> 2.689 - <td>$(_ 'Last recharge:')</td> 2.690 - <td>$(list=$PKGS_DB/ID 2.691 +<section> 2.692 + <header>$(_ 'Summary')</header> 2.693 + 2.694 + <table class="wide zebra"> 2.695 + <tr> 2.696 + <td>$(_ 'Last recharge:')</td> 2.697 + <td>$(list=$PKGS_DB/ID 2.698 if [ -e $list ]; then 2.699 - ohhmm="$(date +%z)" # '+0200' for EET (+2 hours) 2.700 - offset=$(( 60 * (60 * ${ohhmm:0:3} + ${ohhmm:3:2}) )) # in the seconds 2.701 + # Timezone offset as string, ex. '+0200' for EET (+2 hours) 2.702 + ohhmm="$(date +%z)" 2.703 + # Timezone offset in the seconds 2.704 + offset=$(( 60 * (60 * ${ohhmm:0:3} + ${ohhmm:3:2}) )) 2.705 daynow=$(( ($(date +%s) + $offset) / 86400 )) 2.706 dayupd=$(( ($(date -r $list +%s) + $offset) / 86400 )) 2.707 days=$(( $daynow - $dayupd )) 2.708 @@ -1182,47 +1195,49 @@ 2.709 [2-9]) echo $ago;; 2.710 *) echo "<span style='color:red'>$ago</span>" 2.711 _ 'It is recommended to [recharge] the lists.' | \ 2.712 - sed 's|\[|<a href="?recharge">|;s|\]|</a>|';; 2.713 + sed 's|\[|<a data-icon="refresh" href="?recharge">|;s|\]|</a>|';; 2.714 esac 2.715 else 2.716 _ 'never.' 2.717 _ 'You need to [download] the lists for further work.' | \ 2.718 - sed 's|\[|<a href="?recharge">|;s|\]|</a>|' 2.719 + sed 's|\[|<a data-icon="download" href="?recharge">|;s|\]|</a>|' 2.720 fi)</td></tr> 2.721 -<tr> 2.722 - <td>$(_ 'Installed packages:')</td> 2.723 - <td><a href="?list&my=my&cat=all&repo=Any"> 2.724 - <b>$(cat $PKGS_DB/installed.info | wc -l)</b> 2.725 - </a></td></tr> 2.726 -<tr> 2.727 - <td>$(_ 'Mirrored packages:')</td> 2.728 - <td><a href="?list&my=no&cat=all&repo=Any"> 2.729 - <b>$(cat $PKGS_DB/packages.list | wc -l)</b> 2.730 - </a></td></tr> 2.731 -<tr> 2.732 - <td>$(_ 'Upgradeable packages:')</td> 2.733 - <td><a href="?up"> 2.734 - <b>$(cat $PKGS_DB/packages.up | wc -l)</b> 2.735 - </a></td></tr> 2.736 -<tr> 2.737 - <td>$(_ 'Installed files:')</td> 2.738 - <td><b>$(cat $INSTALLED/*/files.list | wc -l)</b></td></tr> 2.739 -<tr> 2.740 - <td>$(_ 'Blocked packages:')</td> 2.741 - <td><a href="?blocked"> 2.742 - <b>$(cat $PKGS_DB/blocked-packages.list | wc -l)</b> 2.743 - </a></td></tr> 2.744 -</tbody> 2.745 -</table></article> 2.746 + <tr> 2.747 + <td>$(_ 'Installed packages:')</td> 2.748 + <td><a href="?list&my=my&cat=all&repo=Any"> 2.749 + <b>$(cat $PKGS_DB/installed.info | wc -l)</b> 2.750 + </a></td></tr> 2.751 + <tr> 2.752 + <td>$(_ 'Mirrored packages:')</td> 2.753 + <td><a href="?list&my=no&cat=all&repo=Any"> 2.754 + <b>$(cat $PKGS_DB/packages.list | wc -l)</b> 2.755 + </a></td></tr> 2.756 + <tr> 2.757 + <td>$(_ 'Upgradeable packages:')</td> 2.758 + <td><a href="?up"> 2.759 + <b>$(cat $PKGS_DB/packages.up | wc -l)</b> 2.760 + </a></td></tr> 2.761 + <tr> 2.762 + <td>$(_ 'Installed files:')</td> 2.763 + <td><b>$(cat $INSTALLED/*/files.list | wc -l)</b></td></tr> 2.764 + <tr> 2.765 + <td>$(_ 'Blocked packages:')</td> 2.766 + <td><a href="?blocked"> 2.767 + <b>$(cat $PKGS_DB/blocked-packages.list | wc -l)</b> 2.768 + </a></td></tr> 2.769 + </table> 2.770 +</section> 2.771 2.772 -<article> 2.773 -<h3>$(_ 'Latest log entries')</h3> 2.774 2.775 -<pre> 2.776 -$(tail -n 5 $LOG | fgrep "-" | awk '{print $1, $2, $3, $4, $5, "<a href=\"?info=" $6 "\">" $6 "</a>", $7}') 2.777 -<a href="index.cgi?file=$LOG">$(_ 'more...')</a> 2.778 -</pre> 2.779 -</article> 2.780 +<section> 2.781 + <header> 2.782 + $(_ 'Latest log entries') 2.783 + <form action="index.cgi"> 2.784 + <button name="file" value="$LOG" data-icon="view">$(_ 'Show')</button> 2.785 + </form> 2.786 + </header> 2.787 + <pre>$(tail -n 5 $LOG | tac | fgrep "-" | awk '{print $1, $2, $3, $4, $5, "<a href=\"?info=" $6 "\">" $6 "</a>", $7}')</pre> 2.788 +</section> 2.789 EOT 2.790 ;; 2.791 esac
3.1 --- a/tazpanel/pkgs.css Mon Mar 23 13:31:18 2015 +0100 3.2 +++ b/tazpanel/pkgs.css Tue Mar 24 03:43:36 2015 +0200 3.3 @@ -1,4 +1,4 @@ 3.4 -body { -webkit-appearance: window; } 3.5 +/*body { -webkit-appearance: window; }*/ 3.6 3.7 /** 3.8 * Sidebar menus 3.9 @@ -10,10 +10,9 @@ 3.10 } 3.11 3.12 #sidebar { /* full width = width(132) + h-padding(5) + border(1) = 138px */ 3.13 - position: fixed; top: 60px; bottom: 0; right: 0; 3.14 + position: fixed; top: 65px; bottom: 0; right: 0; 3.15 width: 132px; padding: 5px 5px 0 0; 3.16 - border-left: 1pt solid #AAA; 3.17 - background-color: #EEE; 3.18 + border-left: 1pt solid; 3.19 overflow-y: auto; overflow-x: hidden; /* for tiny screens */ 3.20 } 3.21 3.22 @@ -41,7 +40,6 @@ 3.23 background-color: rgba(0,0,0,0.05); 3.24 } 3.25 3.26 -option:checked { color: red; font-weight: bold; background-color: orange; } 3.27 3.28 /* sidebar links */ 3.29 #sidebar a { 3.30 @@ -69,8 +67,34 @@ 3.31 a.pkg { background: url(images/tp-new.png) no-repeat left; } 3.32 a.pkgi { background: url(images/tp-pkgi.png) no-repeat left; } 3.33 a.pkgib { background: url(images/tp-pkgib.png) no-repeat left; color: red; } 3.34 -a.w, .pkglist td:nth-child(4) a { 3.35 - background: url(images/tp-web.png) no-repeat left; } 3.36 +a.w::before, .pkglist td:nth-child(4) a::before { 3.37 + font-family: TazPanel; content: 'web'; 3.38 + 3.39 + vertical-align: baseline; 3.40 + padding: 0 0.2rem 0 0; 3.41 + font-size: 1rem; 3.42 + 3.43 + font-style: normal; 3.44 + font-weight: normal; 3.45 + font-variant: normal; 3.46 + text-transform: none; 3.47 + line-height: 1; 3.48 + display: inline-block; 3.49 + text-decoration: none; 3.50 + width: 1rem; text-align: center; 3.51 + 3.52 + -webkit-text-rendering: optimizeLegibility; 3.53 + -moz-text-rendering: optimizeLegibility; 3.54 + -ms-text-rendering: optimizeLegibility; 3.55 + -o-text-rendering: optimizeLegibility; 3.56 + text-rendering: optimizeLegibility; 3.57 + 3.58 + -webkit-font-smoothing: antialiased; 3.59 + -moz-font-smoothing: antialiased; 3.60 + -ms-font-smoothing: antialiased; 3.61 + -o-font-smoothing: antialiased; 3.62 + font-smoothing: antialiased; 3.63 +} 3.64 3.65 a.pkg, a.pkgi, a.pkgib, a.w, .pkglist td:nth-child(4) a { 3.66 margin: 0; padding: 0 0 0 17px; 3.67 @@ -78,18 +102,20 @@ 3.68 display: inline-block; 3.69 } 3.70 3.71 + 3.72 + 3.73 /* not break the line */ 3.74 -.pkglist td:nth-child(1), 3.75 +.pkglist td:nth-child(1), 3.76 .filelist td:nth-child(1) { white-space: nowrap; } 3.77 3.78 -.pkglist td:nth-child(1) a, 3.79 +.pkglist td:nth-child(1) a, 3.80 .filelist td:nth-child(1) a { max-width: 12em; } 3.81 -.pkglist td:nth-child(2) { max-width: 7em; } 3.82 +.pkglist td:nth-child(2) { max-width: 7em; } 3.83 .filelist td:nth-child(2) { max-width: 30em; } 3.84 3.85 /* ellipsize content of 1st and 2nd columns */ 3.86 -.pkglist td:nth-child(1) a, 3.87 -.pkglist td:nth-child(2), 3.88 +.pkglist td:nth-child(1) a, 3.89 +.pkglist td:nth-child(2), 3.90 .filelist td:nth-child(1) a, 3.91 .filelist td:nth-child(2) { 3.92 white-space: nowrap; 3.93 @@ -97,11 +123,19 @@ 3.94 text-overflow: ellipsis; -o-text-overflow: ellipsis; 3.95 } 3.96 3.97 +/* 3.98 +.pkglist tr { border-bottom: 1pt solid; } 3.99 +.pkglist, .pkglist thead { border: 1.5pt solid!important; } 3.100 3.101 -.pkglist tr { border-bottom: 1pt solid #DDD; } 3.102 +.light .pkglist tr { border-color: rgba(92, 92, 92, 0.1); } 3.103 +.light .pkglist, .light .pkglist thead { border-color: rgba(92, 92, 92, 0.1)!important; } 3.104 3.105 -.pkglist, .pkglist thead { border: 1.5pt solid #BBB!important; } 3.106 +.dark .pkglist tr { border-color: #111; } 3.107 +.dark .pkglist, .dark .pkglist thead, .dark .hborders thead tr { border-color: #333!important; } 3.108 +*/ 3.109 3.110 +/* Fixed table header */ 3.111 +#head1h { display: none; position: fixed; } 3.112 3.113 3.114 /** 3.115 @@ -145,6 +179,7 @@ 3.116 /* 3.117 * Tags 3.118 */ 3.119 + 3.120 #tags { text-align: center; } 3.121 a.tag1 { font-size: 0.9em; color: #678; } 3.122 a.tag2 { font-size: 1.0em; color: #444; } 3.123 @@ -166,74 +201,15 @@ 3.124 3.125 3.126 3.127 -/* 3.128 - * Action buttons panel 3.129 - */ 3.130 -#actions { 3.131 - background-color: rgba(229,229,229,0.5); 3.132 - margin: 0; padding: 0.2rem 0.3rem!important; 3.133 - border: 1pt solid #CCC; 3.134 - border-radius: 0.3rem; 3.135 - overflow: auto; /* provide break after floated objects */ 3.136 -} 3.137 .button img { 3.138 padding: 0 4px 0 0; 3.139 } 3.140 3.141 3.142 -/* "articles" are used in the admin page */ 3.143 -article, fieldset { 3.144 - display: block; 3.145 - border: 1pt solid rgba(128, 128, 128, 0.5); 3.146 - border-radius: 0.3rem; 3.147 - padding: 0.3rem 0.3rem 0 0.3rem; 3.148 - margin: 0.5rem 0; 3.149 - background-color: rgba(128, 128, 128, 0.2); 3.150 -} 3.151 -article h3 { 3.152 - padding: 0.3rem; margin: -0.3rem; 3.153 - border-bottom: 1pt solid rgba(128, 128, 128, 0.5); 3.154 - border-radius: 0.3rem 0.3rem 0 0; 3.155 - background-color: rgba(128, 128, 128, 0.3); 3.156 -} 3.157 -legend { 3.158 - font-weight: bold; 3.159 -} 3.160 /* Disable too much borders */ 3.161 -article pre, article table { border: none } 3.162 +section .hborders thead tr { border-top: none; border-bottom: 1pt solid #DDD; } 3.163 3.164 3.165 -/* 3.166 - * Search block 3.167 - */ 3.168 -.search { 3.169 - position: fixed; right: 10px; top: 8px; 3.170 - height: 25px; 3.171 - border-radius: 4px; 3.172 - background-color: #FFF; 3.173 - padding: 0; margin: 0; 3.174 -} 3.175 -.search input { 3.176 - height: 100%; 3.177 - margin: 0; padding: 4px; 3.178 - /*outline: none;*/ 3.179 -} 3.180 -.search input:nth-child(1) { 3.181 - width: 200px; 3.182 - border: none; 3.183 - -webkit-appearance: none; /* remove borders for input type="search" */ 3.184 -} 3.185 -.search input:nth-child(2), .search input:nth-child(3) { -webkit-appearance: push-button; } 3.186 3.187 -.search input:nth-child(1) { 3.188 - border-radius: 4px 0 0 4px; 3.189 - -moz-border-radius: 4px 0 0 4px; 3.190 - -webkit-border-radius: 4px 0 0 4px; 3.191 -} 3.192 -.search input:nth-child(2) { border-radius: 0; -moz-border-radius: 0; -webkit-border-radius: 0; } 3.193 -.search input:nth-child(3) { 3.194 - border-top-left-radius: 0; border-bottom-left-radius: 0; 3.195 - -moz-border-top-left-radius: 0; -moz-border-bottom-left-radius: 0; 3.196 - -webkit-border-top-left-radius: 0; -webkit-border-bottom-left-radius: 0; 3.197 -} 3.198 3.199 +/* •‣⁕←↑→↓↔↕↥↯↶↷↺↻⇄⇅⇈⌫⏏█▶▷▸▹►▻▪▫◯●◻◼◽◾☐☑☒♺♻⚙⚠⚡⚪⚫✉✎✏✐✓✔✕✖✗✘❖➤➜➝➛⟲⟳⧎ */