<%= content_for :tab_line_buttons do %> <%= form_tag({action: 'compare', controller: params[:controller], method: 'get'}, {method: 'get', id: 'compare', class: 'pull-right small-form-margin'}) do |f| %> <%= submit_tag 'Compare selected', {class: 'btn btn-primary', disabled: true, style: 'display: none'} %>   <% end rescue nil %> <% end %> <%= form_tag do |f| %> <% @objects.sort_by { |ob| ob.created_at }.reverse.each do |ob| %> <% end %>
Status Instance Template Owner Age
<%= check_box_tag 'uuids[]', ob.uuid, false %> <% if ob.success %> success <% elsif ob.active %> active <% end %> <%= link_to_if_arvados_object ob, friendly_name: true %> <%= link_to_if_arvados_object ob.pipeline_template_uuid, friendly_name: true %> <%= link_to_if_arvados_object ob.owner_uuid, friendly_name: true %> <%= distance_of_time_in_words(ob.created_at, Time.now) %>
<% ob.components.each do |cname, c| %> <% status = if !(c.is_a?(Hash) && c[:job].is_a?(Hash)) nil elsif c[:job][:success] 'success' elsif c[:job][:running] 'info' else 'warning' end %> <%= cname.to_s %> <% end %>
<% end %> <% content_for :footer_js do %> var showhide_compare = function() { var form = $('form#compare')[0]; $('input[type=hidden][name="uuids[]"]', form).remove(); $('input[type=submit]', form).prop('disabled',true); $('input[name="uuids[]"]').each(function(){ if(this.checked) { $('input[type=submit]', form).prop('disabled',false).show(); $(form).append($('').val(this.value)); } }); }; $('form input[name="uuids[]"]').on('click', showhide_compare); showhide_compare(); <% end %>