debian-koji/www/kojiweb/builds.chtml
2024-09-30 10:46:26 -04:00

190 lines
7.8 KiB
Text

#import koji
#from kojiweb import util
#attr _PASSTHROUGH = ['userID', 'tagID', 'packageID', 'order', 'prefix', 'state', 'inherited', 'latest', 'type']
#include "includes/header.chtml"
#@util.safe_return
#def getDescription()
#if $latest
Latest
#elif $state != None
$util.stateName($state).capitalize()
#end if
#if $type
$type.capitalize()
#end if
Builds
#if $package
of <a href="packageinfo?packageID=$package.id">$package.name</a>
#end if
#if $user
by <a href="userinfo?userID=$user.id">$user.name</a>
#end if
#if $prefix
starting with &quot;$prefix&quot;
#end if
#if $tag
in tag <a href="taginfo?tagID=$tag.id">$tag.name</a>
#end if
#end def
<h4>$getDescription()</h4>
<table class="data-list">
<tr>
<td colspan="#if $tag then '6' else '5'#">
<table class="nested">
<tr><td>
#if $tag
<strong>Latest</strong>:
</td><td>
<select name="latest" class="filterlist" onchange="javascript: window.location = 'builds?latest=' + this.value + '$util.passthrough_except($self, 'latest')';">
<option value="1" #if $latest then 'selected' else ''#>yes</option>
<option value="0" #if not $latest then 'selected' else ''#>no</option>
</select>
#else
<strong>State</strong>:
</td><td>
<select name="state" class="filterlist" onchange="javascript: window.location = 'builds?state=' + this.value + '$util.passthrough_except($self, 'state')';">
<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' else ''#>$stateOpt.lower()</option>
#end for
</select>
#end if
</td><td>
<strong>Built by</strong>:
</td><td>
<select name="userID" class="filterlist" onchange="javascript: window.location = 'builds?userID=' + this.value + '$util.passthrough_except($self, 'userID')';">
<option value="" #if not $user then 'selected' else ''#>everyone</option>
#if $loggedInUser
<option value="$loggedInUser.name">me</option>
#end if
#for $userOption in $users
<option value="$userOption.name" #if $userOption.name == ($user and $user.name or None) then 'selected' else ''#>$userOption.name</option>
#end for
</select>
</td></tr>
<tr>
<td>
<strong>Type</strong>:
</td>
<td>
<select name="type" class="filterlist" onchange="javascript: window.location='builds?type=' + this.value + '$util.passthrough_except($self, 'type')';">
<option value="all" #if not $type then 'selected' else ''#>all</option>
#for $btype in $btypes
<option value="$btype" #if $type == $btype then 'selected' else ''#>$btype</option>
#end for
</select>
</td>
#if $tag
<td>
<strong>Inherited</strong>:
</td><td>
<select name="inherited" class="filterlist" onchange="javascript: window.location = 'builds?inherited=' + this.value + '$util.passthrough_except($self, 'inherited')';">
<option value="1" #if $inherited then 'selected' else ''#>yes</option>
<option value="0" #if not $inherited then 'selected' else ''#>no</option>
</select>
</td>
#end if
</tr>
</table>
</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_except($self, 'prefix')">$char</a>
#end if
|
#end for
#if $prefix
<a href="builds?${util.passthrough_except($self, 'prefix', prefix='')}">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" action="">
Page:
<select onchange="javascript: window.location = 'builds?start=' + this.value * $buildRange + '$util.passthrough_except($self)';">
#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_except($self)">&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_except($self)">&gt;&gt;&gt;</a>
#end if
</td>
</tr>
<tr class="list-header">
<th><a href="builds?order=$util.toggleOrder($self, 'build_id')$util.passthrough_except($self, 'order')">ID</a> $util.sortImage($self, 'build_id')</th>
<th><a href="builds?order=$util.toggleOrder($self, 'nvr')$util.passthrough_except($self, 'order')">NVR</a> $util.sortImage($self, 'nvr')</th>
#if $tag
<th><a href="builds?order=$util.toggleOrder($self, 'tag_name')$util.passthrough_except($self, 'order')">Tag</a> $util.sortImage($self, 'tag_name')</th>
#end if
<th><a href="builds?order=$util.toggleOrder($self, 'owner_name')$util.passthrough_except($self, 'order')">Built by</a> $util.sortImage($self, 'owner_name')</th>
<th><a href="builds?order=$util.toggleOrder($self, 'completion_time')$util.passthrough_except($self, 'order')">Finished</a> $util.sortImage($self, 'completion_time')</th>
<th><a href="builds?order=$util.toggleOrder($self, 'state')$util.passthrough_except($self, 'order')">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 class="user-$build.owner_name"><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" action="">
Page:
<select onchange="javascript: window.location = 'builds?start=' + this.value * $buildRange + '$util.passthrough_except($self)';">
#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_except($self)">&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_except($self)">&gt;&gt;&gt;</a>
#end if
</td>
</tr>
</table>
#include "includes/footer.chtml"