tazpkg diff tazpanel/pkgs.cgi @ rev 755
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 | 1d6e23a2782f |
children | 815e7efac70c |
line diff
1.1 --- a/tazpanel/pkgs.cgi Wed Jan 21 17:53:26 2015 +0200 1.2 +++ b/tazpanel/pkgs.cgi Tue Mar 24 03:43:36 2015 +0200 1.3 @@ -6,7 +6,7 @@ 1.4 # its own code for some tasks. Please KISS, it is important and keep speed 1.5 # in mind. Thanks, Pankso. 1.6 # 1.7 -# (C) 2011-2014 SliTaz GNU/Linux - BSD License 1.8 +# (C) 2011-2015 SliTaz GNU/Linux - BSD License 1.9 # 1.10 1.11 . /lib/libtaz.sh 1.12 @@ -62,10 +62,10 @@ 1.13 i18n_desc $PACKAGE 1.14 cat << EOT 1.15 <tr> 1.16 -<td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link $PACKAGE $class)</td> 1.17 -<td>$VERSION</td> 1.18 -<td>$SHORT_DESC</td> 1.19 -<td><a class="w" href="$WEB_SITE"></a></td> 1.20 + <td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link $PACKAGE $class)</td> 1.21 + <td>$VERSION</td> 1.22 + <td>$SHORT_DESC</td> 1.23 + <td><a data-img="web" href="$WEB_SITE"></a></td> 1.24 </tr> 1.25 EOT 1.26 done 1.27 @@ -80,10 +80,10 @@ 1.28 i18n_desc $PACKAGE 1.29 cat << EOT 1.30 <tr> 1.31 -<td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link $PACKAGE $class)</td> 1.32 -<td>$VERSION</td> 1.33 -<td>$SHORT_DESC</td> 1.34 -<td><a class="w" href="$WEB_SITE"></a></td> 1.35 + <td><input type="checkbox" name="pkg" value="$PACKAGE">$(pkg_info_link $PACKAGE $class)</td> 1.36 + <td>$VERSION</td> 1.37 + <td>$SHORT_DESC</td> 1.38 + <td><a data-img="web" href="$WEB_SITE"></a></td> 1.39 </tr> 1.40 EOT 1.41 done 1.42 @@ -94,35 +94,36 @@ 1.43 # Show button 1.44 show_button() { 1.45 for button in $@; do 1.46 + class=''; img='' 1.47 case $button in 1.48 - recharge) img='tp-recharge'; label="$(_ 'Recharge list')" ;; 1.49 - up) img='tp-up'; label="$(_ 'Check upgrades')" ;; 1.50 - list) img='tp-list'; label="$(_ 'My packages')" ;; 1.51 - tags) img='tp-tag'; label="$(_ 'Tags')" ;; 1.52 - linkable) img='tp-link'; label="$(_ 'Linkable packages')" ;; 1.53 - admin) img='tp-admin'; label="$(_ 'Administration')" ;; 1.54 - *Install*nf*) img='tp-pkg-ins'; label="$(_ 'Install (Non Free)')" ;; 1.55 - *Install*) img='tp-pkg-ins'; label="$(_ 'Install')" ;; 1.56 - *Remove*) img='tp-pkg-rem'; label="$(_ 'Remove')" ;; 1.57 - *Link*) img='tp-link'; label="$(_ 'Link')" ;; 1.58 - *Block*) img='tp-block'; label="$(_ 'Block')" ;; 1.59 - *Unblock*) img='tp-unblock'; label="$(_ 'Unblock')" ;; 1.60 - *Repack*) img='tp-repack'; label="$(_ 'Repack')" ;; 1.61 - *saveconf*) img='tp-save'; label="$(_ 'Save configuration')" ;; 1.62 - *listconf*) img='tp-list'; label="$(_ 'List configuration files')" ;; 1.63 - *quickcheck*) img='tp-check'; label="$(_ 'Quick check')" ;; 1.64 - *fullcheck*) img='tp-check'; label="$(_ 'Full check')" ;; 1.65 - *clean*) img='tp-remove'; label="$(_ 'Clean')" ;; 1.66 - *setlink*) img='tp-link'; label="$(_ 'Set link')" ;; 1.67 - *removelink*) img='tp-remove'; label="$(_ 'Remove link')" ;; 1.68 - *add-mirror) img='tp-add'; label="$(_n 'Add mirror')" ;; 1.69 - *add-repo) img='tp-add'; label="$(_n 'Add repository')" ;; 1.70 + recharge) class='refresh'; label="$(_ 'Recharge list')" ;; 1.71 + up) class='upgrade'; label="$(_ 'Check upgrades')" ;; 1.72 + list) class='list'; label="$(_ 'My packages')" ;; 1.73 + tags) class='tags'; label="$(_ 'Tags')" ;; 1.74 + linkable) class='link'; label="$(_ 'Linkable packages')" ;; 1.75 + admin) class='admin'; label="$(_ 'Administration')" ;; 1.76 + *Install*nf*) class='install'; label="$(_ 'Install (Non Free)')" ;; 1.77 + *Install*) class='install'; label="$(_ 'Install')" ;; 1.78 + *Remove*) class='remove'; label="$(_ 'Remove')" ;; 1.79 + *Link*) class='link'; label="$(_ 'Link')" ;; 1.80 + *Block*) class='lock'; label="$(_ 'Block')" ;; 1.81 + *Unblock*) class='unlock'; label="$(_ 'Unblock')" ;; 1.82 + *Repack*) class='repack'; label="$(_ 'Repack')" ;; 1.83 + *saveconf*) class='save'; label="$(_ 'Save configuration')" ;; 1.84 + *listconf*) class='list'; label="$(_ 'List configuration files')" ;; 1.85 + *quickcheck*) class='check'; label="$(_ 'Quick check')" ;; 1.86 + *fullcheck*) class='check'; label="$(_ 'Full check')" ;; 1.87 + *clean*) class='remove'; label="$(_ 'Clean')" ;; 1.88 + *setlink*) class='link'; label="$(_ 'Set link')" ;; 1.89 + *removelink*) class='unlink'; label="$(_ 'Remove link')" ;; 1.90 + *add-mirror) class='add'; label="$(_n 'Add mirror')" ;; 1.91 + *add-repo) class='add'; label="$(_n 'Add repository')" ;; 1.92 esac 1.93 - cat << EOT 1.94 - <button class="button" type="submit" name="${button%%=*}" value="${button#*=}"> 1.95 - <img src="$IMAGES/$img.png"/>$label 1.96 - </button> 1.97 -EOT 1.98 + if [ -n "$class" ]; then 1.99 + echo -n "<button data-icon=\"$class\" name=\"${button%%=*}\" value=\"${button#*=}\">$label</button>" 1.100 + else 1.101 + echo -n "<button name=\"${button%%=*}\" value=\"${button#*=}\"><img src=\"$IMAGES/$img.png\"/>$label</button>" 1.102 + fi 1.103 done 1.104 } 1.105 1.106 @@ -139,21 +140,19 @@ 1.107 [ -z "$repo" ] && repo="$(GET repo)" 1.108 [ -z "$repo" ] && repo="Any" 1.109 cat << EOT 1.110 -<form method="get" action=""> 1.111 - <div class="search"><input 1.112 - type="search" name="search" results="5" autosave="pkgsearch" autocomplete="on"><input 1.113 - type="submit" value="$(_n 'Search')"><input 1.114 - type="submit" value="$(_n 'Files')" name="files"> 1.115 - </div> 1.116 -</form> 1.117 +<form class="search"><!-- 1.118 + --><input type="search" name="search" results="5" autosave="pkgsearch" autocomplete="on"><!-- 1.119 + --><button type="submit">$(_n 'Search')</button><!-- 1.120 + --><button name="files">$(_n 'Files')</button><!-- 1.121 +--></form> 1.122 EOT 1.123 } 1.124 1.125 1.126 table_head() { 1.127 cat << EOT 1.128 -<table class="zebra pkglist"> 1.129 - <thead> 1.130 +<table class="wide zebra pkglist" id="head1"> 1.131 + <thead id="head2"> 1.132 <tr> 1.133 <td>$(_ 'Name')</td> 1.134 <td>$(_ 'Version')</td> 1.135 @@ -230,8 +229,8 @@ 1.136 EOT 1.137 fi 1.138 cat << EOT 1.139 - <a href="?tags">$(_ 'All tags...')</a> 1.140 - <a href="?cats">$(_ 'All categories...')</a> 1.141 + <a data-icon="tags" href="?tags">$(_ 'All tags...')</a><br/> 1.142 + <a data-icon="list" href="?cats">$(_ 'All categories...')</a> 1.143 </div> 1.144 </form> 1.145 EOT 1.146 @@ -268,7 +267,7 @@ 1.147 1.148 header_repo_name() { 1.149 [ -d $PKGS_DB/undigest ] && [ "$repo" != "Public" ] && \ 1.150 - echo "<h3>$(_ 'Repository: %s' $(repo_name $1))</h3>" 1.151 + _ 'Repository: %s' $(repo_name $1) 1.152 } 1.153 1.154 1.155 @@ -344,7 +343,7 @@ 1.156 1.157 if [ "$pager" != "<p>$(_ 'Pages:') </p>" ] && [ -n "${list:1:1}" ]; then 1.158 cat << EOT 1.159 -$(header_repo_name $i) 1.160 +<h3>$(header_repo_name $i)</h3> 1.161 $pager 1.162 $(table_head) 1.163 $list 1.164 @@ -388,11 +387,8 @@ 1.165 cat << EOT 1.166 <h2>$(_ 'Linkable packages')</h2> 1.167 1.168 -<form method="get" action=""> 1.169 -<div id="actions"> 1.170 - <div class="float-left">$(_ 'Selection:') $(show_button do=Link)</div> 1.171 - <div class="float-right">$(show_button recharge up)</div> 1.172 -</div> 1.173 +<form class="wide"> 1.174 + $(_ 'Selection:') $(show_button do=Link) 1.175 EOT 1.176 table_head 1.177 target=$(readlink $PKGS_DB/fslink) 1.178 @@ -426,17 +422,18 @@ 1.179 echo "<h2>$(_ 'Categories list')</h2>" 1.180 1.181 for pkgsinfo in $(repo_list /packages.info); do 1.182 - header_repo_name $(dirname $pkgsinfo) 1.183 cat << EOT 1.184 -<table class="zebra outbox"> 1.185 - <thead> 1.186 - <tr> 1.187 - <td>$(_ 'Category')</td> 1.188 - <td>$(_ 'Available packages')</td> 1.189 - <td>$(_ 'Installed packages')</td> 1.190 - </tr> 1.191 - </thead> 1.192 - <tbody> 1.193 +<section> 1.194 + <header>$(header_repo_name $(dirname $pkgsinfo))</header> 1.195 + <table class="wide zebra center"> 1.196 + <thead> 1.197 + <tr> 1.198 + <td>$(_ 'Category')</td> 1.199 + <td>$(_ 'Available packages')</td> 1.200 + <td>$(_ 'Installed packages')</td> 1.201 + </tr> 1.202 + </thead> 1.203 + <tbody> 1.204 EOT 1.205 { 1.206 awk -F$'\t' '{print $3}' $pkgsinfo | sort | uniq -c 1.207 @@ -451,7 +448,11 @@ 1.208 }' | sort | awk '{ 1.209 printf "<tr><td><a href=\"?list&cat=%s\">%s</a></td><td>%d</td><td>%d</td></tr>", $1, $1, $2, $3 1.210 }' 1.211 - echo '</tbody></table>' 1.212 + cat << EOT 1.213 + </tbody> 1.214 + </table> 1.215 +</section> 1.216 +EOT 1.217 done 1.218 ;; 1.219 1.220 @@ -481,19 +482,18 @@ 1.221 <h2>$(_ 'Packages list')</h2> 1.222 <p>$title</p> 1.223 1.224 -<form method="get" action=""> 1.225 -<div id="actions"> 1.226 - <div class="float-left">$(_ 'Selection:') 1.227 - $([ "$my" != 'my' ] && show_button do=Install) 1.228 - $(show_button do=Remove) 1.229 - </div> 1.230 - <div class="float-right">$(show_button recharge up)</div> 1.231 -</div> 1.232 +<form class="wide actions"> 1.233 + $(_ 'Selection:') 1.234 + $([ "$my" != 'my' ] && show_button do=Install) 1.235 + $(show_button do=Remove) 1.236 EOT 1.237 for i in $(repo_list ""); do 1.238 show_list ${my#no} 1.239 done 1.240 - echo '</form>' 1.241 + cat << EOT 1.242 +</form> 1.243 +<script type="text/javascript">window.onscroll = scrollHandler;</script> 1.244 +EOT 1.245 ;; 1.246 1.247 1.248 @@ -511,16 +511,15 @@ 1.249 cat << EOT 1.250 <h2>$(_ 'Search packages')</h2> 1.251 1.252 -<form method="get" action=""> 1.253 +<form class="wide"> 1.254 <div id="actions"> 1.255 - <div class="float-left">$(_ 'Selection:'; show_button do=Install do=Remove) 1.256 - <a href="$(cat $PANEL/lib/checkbox.js)">$(_ 'Toogle all')</a></div> 1.257 - <div class="float-right">$(show_button recharge up)</div> 1.258 + $(_ 'Selection:'; show_button do=Install do=Remove) 1.259 + <a href="$(cat $PANEL/lib/checkbox.js)">$(_ 'Toogle all')</a> 1.260 </div> 1.261 EOT 1.262 if [ -n "$(GET files)" ]; then 1.263 cat <<EOT 1.264 - <table class="zebra outbox filelist"> 1.265 + <table class="zebra filelist"> 1.266 <thead> 1.267 <tr> 1.268 <td>$(_ 'Package')</td> 1.269 @@ -543,7 +542,7 @@ 1.270 else 1.271 table_head 1.272 awk -F$'\t' 'BEGIN{IGNORECASE = 1} 1.273 - $1 $4 ~ /'$pkg'/{print $0}' $(repo_list /packages.info) | parse_packages_info 1.274 + $1 " " $4 ~ /'$pkg'/{print $0}' $(repo_list /packages.info) | parse_packages_info 1.275 fi 1.276 cat << EOT 1.277 </tbody> 1.278 @@ -563,21 +562,19 @@ 1.279 cat << EOT 1.280 <h2>$(_ 'Recharge')</h2> 1.281 1.282 -<form method="get" action=""> 1.283 +<form> 1.284 <div id="actions"> 1.285 - <div class="float-left"> 1.286 - <p>$(_ 'Recharge checks for new or updated packages')</p> 1.287 - </div> 1.288 + <p>$(_ 'Recharge checks for new or updated packages')</p> 1.289 <div class="float-right">$(show_button up)</div> 1.290 </div> 1.291 -<div class="wrapper"> 1.292 + 1.293 <pre> 1.294 EOT 1.295 echo $(_ 'Recharging packages list') | log 1.296 tazpkg recharge | filter_taztools_msgs 1.297 cat << EOT 1.298 </pre> 1.299 -</div> 1.300 + 1.301 <p>$(_ 'Packages lists are up-to-date. You should check for upgrades now.')</p> 1.302 EOT 1.303 ;; 1.304 @@ -593,10 +590,10 @@ 1.305 cat << EOT 1.306 <h2>$(_ 'Up packages')</h2> 1.307 1.308 -<form method="get" action=""> 1.309 +<form> 1.310 <div id="actions"> 1.311 - <div class="float-left">$(_ 'Selection:'; show_button do=Install do=Remove) 1.312 - <button class="button" onclick="$(cat $PANEL/lib/checkbox.js)">$(_ 'Toogle all')</button></div> 1.313 + $(_ 'Selection:'; show_button do=Install do=Remove) 1.314 + <button class="button" onclick="$(cat $PANEL/lib/checkbox.js)">$(_ 'Toogle all')</button> 1.315 <div class="float-right">$(show_button recharge)</div> 1.316 </div> 1.317 EOT 1.318 @@ -658,11 +655,11 @@ 1.319 LOADING_MSG=$(_ 'Getting package info...'); loading_msg 1.320 1.321 cat << EOT 1.322 -<h2>$(_ 'Package %s' $pkg)</h2> 1.323 - 1.324 -<form method="get" action=""> 1.325 -<input type="hidden" name="pkg" value="${pkg#get-}"/> 1.326 -<div id="actions"> 1.327 +<section> 1.328 + <header> 1.329 + $(_ 'Package %s' $pkg) 1.330 + <form> 1.331 + <input type="hidden" name="pkg" value="${pkg#get-}"/> 1.332 EOT 1.333 1.334 # Get receipt variables, show Install/Remove buttons 1.335 @@ -702,8 +699,11 @@ 1.336 1.337 # Show info table 1.338 cat << EOT 1.339 -</div> 1.340 -<table class="zebra summary outbox"> 1.341 + </form> 1.342 + </header> 1.343 + 1.344 + <div> 1.345 +<table class="wide zebra summary"> 1.346 <tbody> 1.347 <tr><td><b>$(_ 'Name')</b></td><td>$PACKAGE</td></tr> 1.348 <tr><td><b>$(_ 'Version')</b></td><td>$VERSION</td></tr> 1.349 @@ -718,30 +718,37 @@ 1.350 $(show_info_links "$SUGGESTED" "$(_ 'Suggested')" 'info') 1.351 </tbody> 1.352 </table> 1.353 +</div> 1.354 +</section> 1.355 EOT 1.356 1.357 # Show description 1.358 DESC="$(tazpkg desc $pkg)" 1.359 - [ -n "$DESC" ] && echo "<pre>$DESC</pre>" 1.360 + [ -n "$DESC" ] && echo "<section><pre>$DESC</pre></section>" 1.361 1.362 # Show configuration files list 1.363 CONFIGS="$(tazpkg list-config $pkg | sed 's|\(.*\)|\1 \1|')" 1.364 - [ -n "$CONFIGS" ] && echo "<p>$(_ 'Configuration files')</p><pre>$(printf '<a href="index.cgi?file=%s">%s</a>\n' $CONFIGS)</pre>" 1.365 + [ -n "$CONFIGS" ] && cat << EOT 1.366 +<section> 1.367 + <header>$(_ 'Configuration files')</header> 1.368 + <pre>$(printf '<a href="index.cgi?file=%s">%s</a>\n' $CONFIGS)</pre> 1.369 +</section> 1.370 +EOT 1.371 1.372 # Show installed files list 1.373 if [ -d $INSTALLED/$pkg ]; then 1.374 cat << EOT 1.375 -<p>$(_ 'Installed files: %s' $(wc -l < $INSTALLED/$pkg/files.list))</p> 1.376 - 1.377 -<pre>$(sort $INSTALLED/$pkg/files.list)</pre> 1.378 +<section> 1.379 + <header>$(_ 'Installed files: %s' $(wc -l < $INSTALLED/$pkg/files.list))</header> 1.380 + <pre>$(sort $INSTALLED/$pkg/files.list)</pre> 1.381 +</section> 1.382 EOT 1.383 else 1.384 cat << EOT 1.385 -<p>$(_ 'Installed files: %s' ' ')</p> 1.386 - 1.387 -<pre> 1.388 -$(lzcat files.list.lzma undigest/*/files.list.lzma 2> /dev/null | awk -vp="$pkg:" '$1==p{print $2}' | sort) 1.389 -</pre> 1.390 +<section> 1.391 + <header>$(_ 'Installed files: %s' ' ')</header> 1.392 + <pre>$(lzcat files.list.lzma undigest/*/files.list.lzma 2> /dev/null | awk -vp="$pkg:" '$1==p{print $2}' | sort)</pre> 1.393 +</section> 1.394 EOT 1.395 fi 1.396 ;; 1.397 @@ -792,12 +799,9 @@ 1.398 1.399 <p>$(_ 'TazPkg administration and settings')</p> 1.400 1.401 -<form method="get" action=""> 1.402 -<input type="hidden" name="admin" /> 1.403 - 1.404 -<div id="actions"> 1.405 +<form id="actions"> 1.406 + <input type="hidden" name="admin"/> 1.407 $(show_button action=saveconf action=listconf action=quickcheck action=fullcheck) 1.408 -</div> 1.409 </form> 1.410 EOT 1.411 case "$(GET action)" in 1.412 @@ -858,19 +862,17 @@ 1.413 mirror=$(cat $PKGS_DB/mirror) 1.414 default_mirror=${mirror%/packages/*} 1.415 cat << EOT 1.416 -<article> 1.417 -<h3>$(_ 'Packages cache')</h3> 1.418 +<section> 1.419 + <header>$(_ 'Packages cache')</header> 1.420 + <form class="wide"> 1.421 + <div>$(_ 'Packages in the cache: %s (%s)' $cache_files $cache_size)</div> 1.422 + <footer>$(show_button admin=clean)</footer> 1.423 + </form> 1.424 +</section> 1.425 1.426 -<form method="get" action=""> 1.427 - <p>$(_ 'Packages in the cache: %s (%s)' $cache_files $cache_size) 1.428 - $(show_button admin=clean) 1.429 - </p> 1.430 -</form> 1.431 -</article> 1.432 1.433 - 1.434 -<article> 1.435 -<h3>$(_ 'Current mirror list')</h3> 1.436 +<section> 1.437 + <header>$(_ 'Current mirror list')</header> 1.438 EOT 1.439 1.440 # List mirrors 1.441 @@ -881,103 +883,120 @@ 1.442 echo "<h4>$(_ 'Repository: %s' "$(repo_name $(dirname $i))")</h4>" 1.443 fi 1.444 cat << EOT 1.445 -<form method="get" action=""> 1.446 -<input type="hidden" name="admin" value="select-mirror"/> 1.447 -<table class="zebra"> 1.448 + <form class="wide"> 1.449 + <input type="hidden" name="admin" value="select-mirror"/> 1.450 + <table class="wide zebra"> 1.451 EOT 1.452 while read line; do 1.453 cat << EOT 1.454 -<tr> 1.455 - <td> 1.456 - <input type="radio" name="mirror" id="$line" value="$line" onchange="this.form.submit()" 1.457 - $([ "$line" == "$default_mirror/" ] && echo -n 'checked="checked"')> 1.458 - <label for="$line"><code>$line</code></label></td> 1.459 - <td><a class="w" href="$line" target="_blank"></a></td> 1.460 - <td><a href="?admin=rm-mirror&mirror=$line&file=$i"> 1.461 - <img src="$IMAGES/tp-remove.png" title="$(_ 'Delete')"/></a></td> 1.462 -</tr> 1.463 + <tr> 1.464 + <td> 1.465 + <input type="radio" name="mirror" id="$line" value="$line" onchange="this.form.submit()" 1.466 + $([ "$line" == "$default_mirror/" ] && echo -n 'checked="checked"')> 1.467 + <label for="$line"><code>$line</code></label></td> 1.468 + <td><a data-img="web" href="$line" target="_blank"></a></td> 1.469 + <td><a data-img="remove" href="?admin=rm-mirror&mirror=$line&file=$i" title="$(_ 'Delete')"></a></td> 1.470 + </tr> 1.471 EOT 1.472 done < $i 1.473 cat << EOT 1.474 -</table> 1.475 -</form> 1.476 + </table> 1.477 + </form> 1.478 1.479 -<form method="get" action=""> 1.480 - <p> 1.481 - <input type="hidden" name="file" value="$i" /> 1.482 - <input type="text" name="mirror" size="40" /> 1.483 - $(show_button admin=add-mirror) 1.484 - </p> 1.485 -</form> 1.486 + <form class="wide"> 1.487 + <footer> 1.488 + <input type="hidden" name="file" value="$i" /> 1.489 + <input type="text" name="mirror" size="40" /> 1.490 + $(show_button admin=add-mirror) 1.491 + </footer> 1.492 + </form> 1.493 EOT 1.494 done 1.495 - echo "</article><article>" 1.496 - echo "<h3>$(_ 'Private repositories')</h3>" 1.497 + cat << EOT 1.498 +</section> 1.499 + 1.500 + 1.501 +<section> 1.502 + <header>$(_ 'Private repositories')</header> 1.503 +EOT 1.504 if [ -n "$(ls $PKGS_DB/undigest 2> /dev/null)" ]; then 1.505 - echo '<table class="zebra">' 1.506 + cat << EOT 1.507 + <table class="wide zebra"> 1.508 +EOT 1.509 ls $PKGS_DB/undigest 2> /dev/null | while read repo ; do 1.510 cat <<EOT 1.511 - <tr><td><a href="?admin=rm-repo&repository=$repo"><img src="$IMAGES/tp-remove.png" title="$(_ 'Delete')"></a>$repo</td></tr> 1.512 + <tr> 1.513 + <td><code>$repo</code></td> 1.514 + <td><a data-img="remove" href="?admin=rm-repo&repository=$repo" title="$(_ 'Delete')"></a></td> 1.515 + </tr> 1.516 EOT 1.517 done 1.518 - echo '</table>' 1.519 + cat << EOT 1.520 + </table> 1.521 +EOT 1.522 fi 1.523 1.524 cat << EOT 1.525 -<form method="get" action=""> 1.526 - <p>$(_ 'Name') <input type="text" name="repository" size="10"/> 1.527 - $(_ 'URL:') <input type="text" name="mirror" value="http://"> 1.528 - $(show_button admin=add-repo)</p> 1.529 -</form> 1.530 -</article> 1.531 + <form class="wide"> 1.532 + <table> 1.533 + <tr><td>$(_ 'Name')</td><td><input type="text" name="repository" size="10"/></td></tr> 1.534 + <tr><td>$(_ 'URL:')</td><td><input type="text" name="mirror" value="http://"></td></tr> 1.535 + </table> 1.536 + <footer> 1.537 + $(show_button admin=add-repo) 1.538 + </footer> 1.539 + </form> 1.540 +</section> 1.541 1.542 1.543 -<article> 1.544 -<h3>$(_ 'Link to another SliTaz installation')</h3> 1.545 +<section> 1.546 + <header>$(_ 'Link to another SliTaz installation')</header> 1.547 + <form class="wide"> 1.548 + <div> 1.549 + $(_ "This link points to the root of another SliTaz installation. You will be able to install packages using soft links to it.") 1.550 + </div> 1.551 + <input type="text" name="link" value="$(readlink $PKGS_DB/fslink 2> /dev/null)"/> 1.552 + <footer> 1.553 + $(show_button admin=setlink admin=removelink) 1.554 + </footer> 1.555 + </form> 1.556 +</section> 1.557 1.558 -<p>$(_ "This link points to the root of another SliTaz installation. \ 1.559 -You will be able to install packages using soft links to it.")</p> 1.560 1.561 -<form method="get" action=""> 1.562 -<p> 1.563 - <input type="text" name="link" value="$(readlink $PKGS_DB/fslink 2> /dev/null)"/> 1.564 - $(show_button admin=setlink admin=removelink) 1.565 -</p> 1.566 -</form> 1.567 -</article> 1.568 +<section> 1.569 + <header id="dvd">$(_ 'SliTaz packages DVD')</header> 1.570 1.571 + <div> 1.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) 1.573 1.574 -<article> 1.575 -<h3 id="dvd">$(_ 'SliTaz packages DVD')</h3> 1.576 + <form method="post" action='?admin&action=dvdimage'> 1.577 + $(_ 'Install from ISO image:') 1.578 + <input type="text" name="dvdimage" size="40" value="/root/packages-$version.iso" /> 1.579 + </form> 1.580 + </div> 1.581 1.582 -<p>$(_ "A bootable DVD image of all available packages for the %s version is \ 1.583 -generated every day. It also contains a copy of the website and can be used \ 1.584 -without an internet connection. This image can be installed on a DVD or a USB \ 1.585 -key." $version)</p> 1.586 + <footer> 1.587 + <button data-icon="download" onclick='http://mirror.slitaz.org/iso/$version/packages-$version.iso'> 1.588 + $(_ 'Download DVD image')</button> 1.589 + <button data-icon="link" onclick='?admin&action=dvdusbkey'> 1.590 + $(_ 'Install from DVD/USB key')</button> 1.591 + </footer> 1.592 +</section> 1.593 1.594 -<button class="button" onclick='http://mirror.slitaz.org/iso/$version/packages-$version.iso'> 1.595 - <img src="$IMAGES/tp-dl-dvd.png" />$(_ 'Download DVD image')</button> 1.596 -<button class="button" onclick='?admin&action=dvdusbkey'> 1.597 - <img src="$IMAGES/tp-link.png" />$(_ 'Install from DVD/USB key')</button> 1.598 -<div class="box"> 1.599 - <form method="post" action='?admin&action=dvdimage'> 1.600 - $(_ 'Install from ISO image:') 1.601 - <input type="text" name="dvdimage" size="40" value="/root/packages-$version.iso" /> 1.602 -</div> 1.603 -</form> 1.604 -</article> 1.605 1.606 - 1.607 -<article> 1.608 -<h3>$(_ 'Packages list')</h3> 1.609 - 1.610 -<p>$(_ 'Long list of packages is paginated. Here you can set the page size (default: 100, turning off the pager: 0).')</p> 1.611 -<form method="get" action=""> 1.612 - <input type="hidden" name="admin" value="pager" /> 1.613 - <input type="number" name="pager" value="$pager" min="0" step="10" size="4" /> 1.614 - <button class="button" type="submit">$(_ 'Set')</button> 1.615 -</form> 1.616 -</article> 1.617 +<section> 1.618 + <header>$(_ 'Packages list')</header> 1.619 + <form class="wide"> 1.620 + <div> 1.621 + $(_ 'Long list of packages is paginated. Here you can set the page size (default: 100, turning off the pager: 0).') 1.622 + </div> 1.623 + <input type="hidden" name="admin" value="pager"/> 1.624 + <input type="number" name="pager" value="$pager" min="0" step="10" size="4"/> 1.625 + <footer> 1.626 + <button data-icon="ok" type="submit">$(_ 'Set')</button> 1.627 + </footer> 1.628 + </form> 1.629 +</section> 1.630 EOT 1.631 ;; 1.632 1.633 @@ -1098,16 +1117,12 @@ 1.634 1.635 tag=$(GET tag) 1.636 cat << EOT 1.637 -<h2>$(_ 'Tag "%s"' $tag)</h2> 1.638 +<h2 data-icon="tag">$(_ 'Tag "%s"' $tag)</h2> 1.639 1.640 -<form method="get" action=""> 1.641 +<form> 1.642 <div id="actions"> 1.643 - <div class="float-left"> 1.644 - $(_ 'Selection:'; show_button do=Install do=Remove) 1.645 - </div> 1.646 - <div class="float-right"> 1.647 - $(show_button tags) 1.648 - </div> 1.649 + $(_ 'Selection:'; show_button do=Install do=Remove) 1.650 + <div class="float-right">$(show_button tags)</div> 1.651 </div> 1.652 EOT 1.653 for i in $(repo_list ""); do 1.654 @@ -1126,10 +1141,9 @@ 1.655 cat << EOT 1.656 <h2>$(_ 'Blocked packages list')</h2> 1.657 1.658 -<form method="get" action=""> 1.659 +<form> 1.660 <div id="actions"> 1.661 - <div class="float-left">$(_ 'Selection:'; show_button do=Unblock) 1.662 - </div> 1.663 + $(_ 'Selection:'; show_button do=Unblock) 1.664 </div> 1.665 EOT 1.666 table_head 1.667 @@ -1150,27 +1164,26 @@ 1.668 search_form; sidebar 1.669 1.670 cat << EOT 1.671 -<h2>$(_ 'Summary')</h2> 1.672 - 1.673 -<form method="get" action=""> 1.674 -<div id="actions"> 1.675 +<form id="actions2"> 1.676 EOT 1.677 fslink=$(readlink $PKGS_DB/fslink) 1.678 [ -n "$fslink" -a -d "$fslink/$INSTALLED" ] && show_button linkable 1.679 show_button recharge up admin 1.680 cat << EOT 1.681 -</div> 1.682 +</form> 1.683 1.684 -<article> 1.685 -<h3>$(_ 'Summary')</h3> 1.686 -<table class="zebra summary"> 1.687 -<tbody> 1.688 -<tr> 1.689 - <td>$(_ 'Last recharge:')</td> 1.690 - <td>$(list=$PKGS_DB/ID 1.691 +<section> 1.692 + <header>$(_ 'Summary')</header> 1.693 + 1.694 + <table class="wide zebra"> 1.695 + <tr> 1.696 + <td>$(_ 'Last recharge:')</td> 1.697 + <td>$(list=$PKGS_DB/ID 1.698 if [ -e $list ]; then 1.699 - ohhmm="$(date +%z)" # '+0200' for EET (+2 hours) 1.700 - offset=$(( 60 * (60 * ${ohhmm:0:3} + ${ohhmm:3:2}) )) # in the seconds 1.701 + # Timezone offset as string, ex. '+0200' for EET (+2 hours) 1.702 + ohhmm="$(date +%z)" 1.703 + # Timezone offset in the seconds 1.704 + offset=$(( 60 * (60 * ${ohhmm:0:3} + ${ohhmm:3:2}) )) 1.705 daynow=$(( ($(date +%s) + $offset) / 86400 )) 1.706 dayupd=$(( ($(date -r $list +%s) + $offset) / 86400 )) 1.707 days=$(( $daynow - $dayupd )) 1.708 @@ -1182,47 +1195,49 @@ 1.709 [2-9]) echo $ago;; 1.710 *) echo "<span style='color:red'>$ago</span>" 1.711 _ 'It is recommended to [recharge] the lists.' | \ 1.712 - sed 's|\[|<a href="?recharge">|;s|\]|</a>|';; 1.713 + sed 's|\[|<a data-icon="refresh" href="?recharge">|;s|\]|</a>|';; 1.714 esac 1.715 else 1.716 _ 'never.' 1.717 _ 'You need to [download] the lists for further work.' | \ 1.718 - sed 's|\[|<a href="?recharge">|;s|\]|</a>|' 1.719 + sed 's|\[|<a data-icon="download" href="?recharge">|;s|\]|</a>|' 1.720 fi)</td></tr> 1.721 -<tr> 1.722 - <td>$(_ 'Installed packages:')</td> 1.723 - <td><a href="?list&my=my&cat=all&repo=Any"> 1.724 - <b>$(cat $PKGS_DB/installed.info | wc -l)</b> 1.725 - </a></td></tr> 1.726 -<tr> 1.727 - <td>$(_ 'Mirrored packages:')</td> 1.728 - <td><a href="?list&my=no&cat=all&repo=Any"> 1.729 - <b>$(cat $PKGS_DB/packages.list | wc -l)</b> 1.730 - </a></td></tr> 1.731 -<tr> 1.732 - <td>$(_ 'Upgradeable packages:')</td> 1.733 - <td><a href="?up"> 1.734 - <b>$(cat $PKGS_DB/packages.up | wc -l)</b> 1.735 - </a></td></tr> 1.736 -<tr> 1.737 - <td>$(_ 'Installed files:')</td> 1.738 - <td><b>$(cat $INSTALLED/*/files.list | wc -l)</b></td></tr> 1.739 -<tr> 1.740 - <td>$(_ 'Blocked packages:')</td> 1.741 - <td><a href="?blocked"> 1.742 - <b>$(cat $PKGS_DB/blocked-packages.list | wc -l)</b> 1.743 - </a></td></tr> 1.744 -</tbody> 1.745 -</table></article> 1.746 + <tr> 1.747 + <td>$(_ 'Installed packages:')</td> 1.748 + <td><a href="?list&my=my&cat=all&repo=Any"> 1.749 + <b>$(cat $PKGS_DB/installed.info | wc -l)</b> 1.750 + </a></td></tr> 1.751 + <tr> 1.752 + <td>$(_ 'Mirrored packages:')</td> 1.753 + <td><a href="?list&my=no&cat=all&repo=Any"> 1.754 + <b>$(cat $PKGS_DB/packages.list | wc -l)</b> 1.755 + </a></td></tr> 1.756 + <tr> 1.757 + <td>$(_ 'Upgradeable packages:')</td> 1.758 + <td><a href="?up"> 1.759 + <b>$(cat $PKGS_DB/packages.up | wc -l)</b> 1.760 + </a></td></tr> 1.761 + <tr> 1.762 + <td>$(_ 'Installed files:')</td> 1.763 + <td><b>$(cat $INSTALLED/*/files.list | wc -l)</b></td></tr> 1.764 + <tr> 1.765 + <td>$(_ 'Blocked packages:')</td> 1.766 + <td><a href="?blocked"> 1.767 + <b>$(cat $PKGS_DB/blocked-packages.list | wc -l)</b> 1.768 + </a></td></tr> 1.769 + </table> 1.770 +</section> 1.771 1.772 -<article> 1.773 -<h3>$(_ 'Latest log entries')</h3> 1.774 1.775 -<pre> 1.776 -$(tail -n 5 $LOG | fgrep "-" | awk '{print $1, $2, $3, $4, $5, "<a href=\"?info=" $6 "\">" $6 "</a>", $7}') 1.777 -<a href="index.cgi?file=$LOG">$(_ 'more...')</a> 1.778 -</pre> 1.779 -</article> 1.780 +<section> 1.781 + <header> 1.782 + $(_ 'Latest log entries') 1.783 + <form action="index.cgi"> 1.784 + <button name="file" value="$LOG" data-icon="view">$(_ 'Show')</button> 1.785 + </form> 1.786 + </header> 1.787 + <pre>$(tail -n 5 $LOG | tac | fgrep "-" | awk '{print $1, $2, $3, $4, $5, "<a href=\"?info=" $6 "\">" $6 "</a>", $7}')</pre> 1.788 +</section> 1.789 EOT 1.790 ;; 1.791 esac