cookutils diff web/cooker.cgi @ rev 805

cooker.cgi: move buttons to the right
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jul 03 11:30:30 2016 +0200 (2016-07-03)
parents 5658598bf22a
children 05a7f4f61409
line diff
     1.1 --- a/web/cooker.cgi	Sun Jul 03 11:17:49 2016 +0300
     1.2 +++ b/web/cooker.cgi	Sun Jul 03 11:30:30 2016 +0200
     1.3 @@ -159,8 +159,11 @@
     1.4  # Optional full list button
     1.5  
     1.6  more_button() {
     1.7 -	[ $(wc -l < ${3:-$CACHE/$1}) -gt ${4:-12} ] &&
     1.8 -	echo "<a class=\"button\" href=\"cooker.cgi?file=$1\">$2</a>"
     1.9 +	[ $(wc -l < ${3:-$CACHE/$1}) -gt ${4:-12} ] && cat <<EOT
    1.10 +<div style="float: right;">
    1.11 +	<a class="button" href="cooker.cgi?file=$1">$2</a>
    1.12 +</div>
    1.13 +EOT
    1.14  }
    1.15  
    1.16  
    1.17 @@ -438,7 +441,14 @@
    1.18  Broken packages  : $(cat $broken | wc -l)
    1.19  Blocked packages : $(cat $blocked | wc -l)
    1.20  </pre>
    1.21 -
    1.22 +EOT
    1.23 +		[ -e $CACHE/cooker-request ] &&
    1.24 +		[ $CACHE/activity -nt $CACHE/cooker-request ] && cat <<EOT
    1.25 +<div style="float: right;">
    1.26 +	<a class="button" href="cooker.cgi?poke">Poke cooker</a>
    1.27 +</div>
    1.28 +EOT
    1.29 +		cat <<EOT
    1.30  <p class="info">
    1.31  	Packages: $inwok in the wok | $cooked cooked | $unbuilt unbuilt |
    1.32  	Server date: $(date -u '+%F %R %Z')
    1.33 @@ -456,26 +466,20 @@
    1.34  	- Architecture $ARCH:
    1.35  	<a href="$toolchain">toolchain</a>
    1.36  </p>
    1.37 -EOT
    1.38 -		[ -e $CACHE/cooker-request ] &&
    1.39 -		[ $CACHE/activity -nt $CACHE/cooker-request ] && cat <<EOT
    1.40 -<a class="button" href="cooker.cgi?poke">Poke cooker</a>
    1.41 -EOT
    1.42  
    1.43 -		cat <<EOT
    1.44 +$(more_button activity "More activity" $CACHE/activity 12)
    1.45  <h2 id="activity">Activity</h2>
    1.46  <pre>
    1.47  $(tac $CACHE/activity | head -n 12 | syntax_highlighter activity)
    1.48  </pre>
    1.49 -$(more_button activity "More activity" $CACHE/activity 12)
    1.50  EOT
    1.51  
    1.52  		[ -s $cooknotes ] && cat <<EOT
    1.53 +$(more_button cooknotes "More notes" $cooknotes 12)
    1.54  <h2 id="cooknotes">Cooknotes</h2>
    1.55  <pre>
    1.56  $(tac $cooknotes | head -n 12 | syntax_highlighter activity)
    1.57  </pre>
    1.58 -$(more_button cooknotes "More notes" $cooknotes 12)
    1.59  EOT
    1.60  
    1.61  		[ -s $commits ] && cat <<EOT
    1.62 @@ -486,19 +490,19 @@
    1.63  EOT
    1.64  
    1.65  		[ -s $cooklist ] && cat <<EOT
    1.66 +$(more_button cooklist "Full cooklist" $cooklist 20)
    1.67  <h2 id="cooklist">Cooklist</h2>
    1.68  <pre>
    1.69  $(cat $cooklist | head -n 20)
    1.70  </pre>
    1.71 -$(more_button cooklist "Full cooklist" $cooklist 20)
    1.72  EOT
    1.73  
    1.74  		[ -s $broken ] && cat <<EOT
    1.75 +$(more_button broken "All broken packages" $broken 20)
    1.76  <h2 id="broken">Broken</h2>
    1.77  <pre>
    1.78  $(cat $broken | head -n 20 | sed s"#^[^']*#<a href='cooker.cgi?pkg=\0'>\0</a>#"g)
    1.79  </pre>
    1.80 -$(more_button broken "All broken packages" $broken 20)
    1.81  EOT
    1.82  
    1.83  		[ -s $blocked ] && cat <<EOT