debian-koji/www/kojiweb/builds.chtml
2007-02-14 11:25:01 -05:00

133 lines
6.5 KiB
Text

#import koji
#from kojiweb import util
#def toggleLink($comp, $label, $link)
#if $comp
<strong>$label</strong>#slurp
#else
<a href="$link">$label</a>#slurp
#end if
#end def
#include "includes/header.chtml"
<h4>#if $state != None then $util.stateName($state).capitalize() else ''# Builds#if $prefix then ' starting with "%s"' % $prefix else ''##if $user then ' by <a href="userinfo?userID=%i">%s</a>' % ($user.id, $user.name) else ''##if $tag then ' in tag <a href="taginfo?tagID=%i">%s</a>' % ($tag.id, $tag.name) else ''#</h4>
<table class="data-list">
#if $tag
<tr>
<td colspan="6">
#if $inherited
<a href="builds?inherited=0$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix')">Hide inherited builds</a>
#else
<a href="builds?${util.passthrough($self, 'userID', 'tagID', 'order', 'prefix')[1:]}">Show inherited builds</a>
#end if
</td>
</tr>
#end if
<tr>
<td colspan="#if $tag then '6' else '5'#">
<strong>State</strong>:
<select name="state" class="filterlist" onchange="javascript: window.location = 'builds?state=' + this.value + '$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix', 'inherited')';">
<option value="all">all</option>
#for $stateOpt in ['BUILDING', 'COMPLETE', 'FAILED', 'CANCELED']
<option value="$koji.BUILD_STATES[$stateOpt]" #if $state == $koji.BUILD_STATES[$stateOpt] then 'selected="selected"' else ''#>$stateOpt.lower()</option>
#end for
</select>
</td>
</tr>
<tr>
<td class="charlist" colspan="#if $tag then '6' else '5'#">
#for $char in $chars
#if $prefix == $char
<strong>$char</strong>
#else
<a href="builds?prefix=$char$util.passthrough($self, 'userID', 'tagID', 'order', 'inherited', 'state')">$char</a>
#end if
|
#end for
#if $prefix
<a href="builds?${util.passthrough($self, 'userID', 'tagID', 'order', 'inherited', 'state')[1:]}">all</a>
#else
<strong>all</strong>
#end if
</td>
</tr>
<tr>
<td class="paginate" colspan="#if $tag then '6' else '5'#">
#if $len($buildPages) > 1
<form class="pageJump">
Page:
<select onchange="javascript: window.location = 'builds?start=' + this.value * $buildRange + '$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix', 'inherited', 'state')';">
#for $pageNum in $buildPages
<option value="$pageNum"#if $pageNum == $buildCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
#end for
</select>
</form>
#end if
#if $buildStart > 0
<a href="builds?start=#echo $buildStart - $buildRange #$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix', 'inherited', 'state')">&lt;&lt;&lt;</a>
#end if
#if $totalBuilds != 0
<strong>Builds #echo $buildStart + 1 # through #echo $buildStart + $buildCount # of $totalBuilds</strong>
#end if
#if $buildStart + $buildCount < $totalBuilds
<a href="builds?start=#echo $buildStart + $buildRange#$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix', 'inherited', 'state')">&gt;&gt;&gt;</a>
#end if
</td>
</tr>
<tr class="list-header">
<th><a href="builds?order=$util.toggleOrder($self, 'build_id')$util.passthrough($self, 'userID', 'tagID', 'prefix', 'inherited', 'state')">ID</a> $util.sortImage($self, 'build_id')</th>
<th><a href="builds?order=$util.toggleOrder($self, 'nvr')$util.passthrough($self, 'userID', 'tagID', 'prefix', 'inherited', 'state')">NVR</a> $util.sortImage($self, 'nvr')</th>
#if $tag
<th><a href="builds?order=$util.toggleOrder($self, 'tag_name')$util.passthrough($self, 'userID', 'tagID', 'prefix', 'inherited', 'state')">Tag</a> $util.sortImage($self, 'tag_name')</th>
#end if
<th><a href="builds?order=$util.toggleOrder($self, 'owner_name')$util.passthrough($self, 'userID', 'tagID', 'prefix', 'inherited', 'state')">Built by</a> $util.sortImage($self, 'owner_name')</th>
<th><a href="builds?order=$util.toggleOrder($self, 'completion_time')$util.passthrough($self, 'userID', 'tagID', 'prefix', 'inherited', 'state')">Finished</a> $util.sortImage($self, 'completion_time')</th>
<th><a href="builds?order=$util.toggleOrder($self, 'state')$util.passthrough($self, 'userID', 'tagID', 'prefix', 'inherited', 'state')">State</a> $util.sortImage($self, 'state')</th>
</tr>
#if $len($builds) > 0
#for $build in $builds
<tr class="$util.rowToggle($self)">
<td>$build.build_id</td>
<td><a href="buildinfo?buildID=$build.build_id">$koji.buildLabel($build)</a></td>
#if $tag
<td><a href="taginfo?tagID=$build.tag_id">$build.tag_name</a></td>
#end if
<td><a href="userinfo?userID=$build.owner_id">$build.owner_name</a></td>
<td>$util.formatTime($build.completion_time)</td>
#set $stateName = $util.stateName($build.state)
<td class="$stateName">$util.stateImage($build.state)</td>
</tr>
#end for
#else
<tr class="row-odd">
<td colspan="#if $tag then '6' else '5'#">No builds</td>
</tr>
#end if
<tr>
<td class="paginate" colspan="#if $tag then '6' else '5'#">
#if $len($buildPages) > 1
<form class="pageJump">
Page:
<select onchange="javascript: window.location = 'builds?start=' + this.value * $buildRange + '$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix', 'inherited', 'state')';">
#for $pageNum in $buildPages
<option value="$pageNum"#if $pageNum == $buildCurrentPage then ' selected' else ''#>#echo $pageNum + 1#</option>
#end for
</select>
</form>
#end if
#if $buildStart > 0
<a href="builds?start=#echo $buildStart - $buildRange #$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix', 'inherited', 'state')">&lt;&lt;&lt;</a>
#end if
#if $totalBuilds != 0
<strong>Builds #echo $buildStart + 1 # through #echo $buildStart + $buildCount # of $totalBuilds</strong>
#end if
#if $buildStart + $buildCount < $totalBuilds
<a href="builds?start=#echo $buildStart + $buildRange#$util.passthrough($self, 'userID', 'tagID', 'order', 'prefix', 'inherited', 'state')">&gt;&gt;&gt;</a>
#end if
</td>
</tr>
</table>
#include "includes/footer.chtml"