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