Merge branch 'master' into 3354-render-textile
[arvados.git] / apps / workbench / app / views / pipeline_instances / index.html.erb
index 2789ca113badb96d2b33d1d84369be4420c28f4e..4b73bd499a16a39b89bccd419b8e79d570c5f30b 100644 (file)
@@ -1,81 +1,8 @@
-<%= form_tag({action: 'compare', controller: 'pipeline_instances', method: 'get'}, {method: 'get', id: 'compare'}) do |f| %>
-
-<table class="table table-hover">
-  <thead>
-    <tr class="contain-align-left">
-      <th>
-       <%= submit_tag 'Compare', {class: 'btn btn-primary', disabled: true} %>
-      </th><th>
-       status
-      </th><th>
-       id
-      </th><th>
-       name
-      </th><th>
-       template
-      </th><th>
-       owner
-      </th><th>
-       components
-      </th><th>
-       dependencies
-      </th><th>
-       created
-      </th>
-    </tr>
-  </thead>
-  <tbody>
-
-    <% @objects.sort_by { |ob| ob.created_at }.reverse.each do |ob| %>
-
-    <tr>
-      <td>
-        <%= check_box_tag 'uuids[]', ob.uuid, false %>
-      </td><td>
-        <% if ob.success %>
-        <span class="label label-success">success</span>
-        <% elsif ob.active %>
-        <span class="label label-info">active</span>
-        <% end %>
-      </td><td>
-        <%= link_to_if_arvados_object ob %>
-      </td><td>
-        <%= ob.name %>
-      </td><td>
-        <%= link_to_if_arvados_object ob.pipeline_template_uuid %>
-      </td><td>
-        <%= link_to_if_arvados_object ob.owner_uuid %>
-      </td><td>
-        <% ob.components.each do |cname, c| %>
-        <% status = if !(c.is_a?(Hash) && c[:job].is_a?(Hash)) then nil elsif c[:job][:success] then 'success' elsif c[:job][:running] then 'info' else 'warning' end %>
-        <span class="label <%= "label-#{status}" if status %>"><%= cname.to_s %></span>
-        <% end %>
-      </td><td>
-        <small>
-          <% ob.dependencies.each do |d| %>
-          <%= d %><br />
-          <% end %>
-        </small>
-      </td><td>
-        <%= ob.created_at %>
-      </td>
-    </tr>
-
-    <% end %>
-
-  </tbody>
-</table>
-
+<% 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 2 or 3 selected', {class: 'btn btn-primary', disabled: true, style: 'display: none'} %>
+  &nbsp;
+<% end rescue nil %>
 <% end %>
 
-<% content_for :footer_js do %>
-$('form#compare input[name="uuids[]"]').on('click', function() {
-    var form = $('form#compare')[0]
-    $('input[type=submit]', form).prop('disabled',true);
-    $('input[name="uuids[]"]', form).each(function(){
-        if(this.checked) {
-            $('input[type=submit]', form).prop('disabled',false);
-        }
-    });
-});
-<% end %>
+<%= render file: 'application/index.html.erb', locals: local_assigns %>