[PATCH 2/2] (koji-web) Markup scratch builds.

Dennis Gilmore dennis at ausil.us
Thu May 7 18:13:29 UTC 2015


On Monday, April 27, 2015 02:20:31 PM Ralph Bean wrote:
> With this we can markup scratch builds, deemphasize them, etc.
> ---
>  www/kojiweb/index.chtml |  3 ++-
>  www/lib/kojiweb/util.py | 13 +++++++++++++
>  2 files changed, 15 insertions(+), 1 deletion(-)
> 
> diff --git a/www/kojiweb/index.chtml b/www/kojiweb/index.chtml
> index 7613fe6..738256c 100644
> --- a/www/kojiweb/index.chtml
> +++ b/www/kojiweb/index.chtml
> @@ -50,7 +50,8 @@
>        <th>State</th>
>      </tr>
>      #for $task in $tasks
> -    <tr class="$util.rowToggle($self)">
> +    #set $scratch = $util.taskScratchClass($task)
> +    <tr class="$util.rowToggle($self) $scratch">
>        #set $state = $util.taskState($task.state)
>        <td>$task.id</td>
>        <td><a href="taskinfo?taskID=$task.id" class="task$state"
> title="$state">$koji.taskLabel($task)</a></td> diff --git
> a/www/lib/kojiweb/util.py b/www/lib/kojiweb/util.py
> index ae00757..89a5ddb 100644
> --- a/www/lib/kojiweb/util.py
> +++ b/www/lib/kojiweb/util.py
> @@ -458,6 +458,19 @@ def rowToggle(template):
>      else:
>          return 'row-even'
> 
> +
> +def taskScratchClass(task_object):
> +    """ Return a css class indicating whether or not this task is a scratch
> +    build.
> +    """
> +    request = task_object['request']
> +    if len(request) >= 3:
> +        opts = request[2]
> +        if opts.get('scratch'):
> +            return "scratch"
> +    return ""
> +
> +
>  _fileFlags = {1: 'configuration',
>                2: 'documentation',
>                4: 'icon',
Ack
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.fedoraproject.org/pipermail/buildsys/attachments/20150507/da94766c/attachment.sig>


More information about the buildsys mailing list