ef394e8c8660b416c61ca9ccb1aec00aa49c7526
[arvados.git] / apps / workbench / app / views / pipeline_instances / _recent.html.erb
1 <%= form_tag do |f| %>
2
3 <table class="table table-hover">
4   <thead>
5     <tr class="contain-align-left">
6       <th>
7       </th><th>
8         status
9       </th><th>
10         id
11       </th><th>
12         name
13       </th><th>
14         template
15       </th><th>
16         owner
17       </th><th>
18         components
19       </th><th>
20         dependencies
21       </th><th>
22         created
23       </th><th>
24       </th>
25     </tr>
26   </thead>
27   <tbody>
28
29     <% @objects.sort_by { |ob| ob.created_at }.reverse.each do |ob| %>
30
31     <tr data-object-uuid="<%= ob.uuid %>">
32       <td>
33         <%= check_box_tag 'uuids[]', ob.uuid, false %>
34       </td><td>
35         <% if ob.success %>
36         <span class="label label-success">success</span>
37         <% elsif ob.active %>
38         <span class="label label-info">active</span>
39         <% end %>
40       </td><td>
41         <%= link_to_if_arvados_object ob %>
42       </td><td>
43         <%= ob.name %>
44       </td><td>
45         <%= link_to_if_arvados_object ob.pipeline_template_uuid %>
46       </td><td>
47         <%= link_to_if_arvados_object ob.owner_uuid %>
48       </td><td>
49         <% ob.components.each do |cname, c| %>
50         <% 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 %>
51         <span class="label <%= "label-#{status}" if status %>"><%= cname.to_s %></span>
52         <% end %>
53       </td><td>
54         <small>
55           <% ob.dependencies.each do |d| %>
56           <%= d %><br />
57           <% end %>
58         </small>
59       </td><td>
60         <%= ob.created_at %>
61       </td>
62     </tr>
63
64     <% end %>
65
66   </tbody>
67 </table>
68
69 <% end %>
70
71 <% content_for :footer_js do %>
72 var showhide_compare = function() {
73     var form = $('form#compare')[0];
74     $('input[type=hidden][name="uuids[]"]', form).remove();
75     $('input[type=submit]', form).prop('disabled',true);
76     $('input[name="uuids[]"]').each(function(){
77         if(this.checked) {
78             $('input[type=submit]', form).prop('disabled',false).show();
79             $(form).append($('<input type="hidden" name="uuids[]"/>').val(this.value));
80         }
81     });
82 };
83 $('form input[name="uuids[]"]').on('click', showhide_compare);
84 showhide_compare();
85 <% end %>