On 02/29/2012 11:00 AM, Jan Provaznik wrote:
On 02/28/2012 06:37 PM, mtaylor(a)redhat.com wrote:
> From: Martyn Taylor<mtaylor(a)redhat.com>
>
> ---
> src/app/views/images/show.html.haml | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/app/views/images/show.html.haml
> b/src/app/views/images/show.html.haml
> index 7681cee..8feaeb3 100644
> --- a/src/app/views/images/show.html.haml
> +++ b/src/app/views/images/show.html.haml
> @@ -55,7 +55,7 @@
> %dt
> .build-actions
> %h3= group[:type].name
> - - if @build and b = @builder.find_active_build((a)build.id, driver)
> + - if b = @builder.find_active_build_by_imageid((a)image.id, driver)
It's little bit more tricky - you can have multiple builds for an image,
and if active build is find only by image id (w/o build id),
then active build status will be displayed even for other/older builds.
@build is set to latest_unpushed or latest_build image's attribute, but
this attribute is not set until first image build is finished. So maybe
condition would look like this:
if (@build and b = @builder.find_active_build((a)build.id, driver)) or
(@build.nil? and params[:build].blank? and b =
@builder.find_active_build_by_imageid((a)image.id, driver))
this becomes pretty long so should be on some better place than view
> = label_tag b.status
> - elsif timg
> = button_to t('.delete'), image_target_image_path((a)image.id, timg.id),
> :method => :delete
The jquery template also needs to be updated for backbone.