Advertise filters param in discovery doc.
[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 2 or 3 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-condensed table-fixedlayout">
11   <colgroup>
12     <col width="5%" />
13     <col width="10%" />
14     <col width="20%" />
15     <col width="10%" />
16     <col width="30%" />
17     <col width="15%" />
18     <col width="10%" />
19   </colgroup>
20   <thead>
21     <tr class="contain-align-left">
22       <th>
23       </th><th>
24         Status
25       </th><th>
26         Instance
27       </th><th colspan="2">
28         Template
29       </th><th>
30         Owner
31       </th><th>
32         Age
33       </th>
34     </tr>
35   </thead>
36   <tbody>
37
38     <% @objects.sort_by { |ob| ob.created_at }.reverse.each do |ob| %>
39
40     <tr data-object-uuid="<%= ob.uuid %>">
41       <td>
42         <%= check_box_tag 'uuids[]', ob.uuid, false %>
43       </td><td>
44         <% if ob.success %>
45         <span class="label label-success">success</span>
46         <% elsif ob.active %>
47         <span class="label label-info">active</span>
48         <% end %>
49       </td><td colspan="2">
50         <%= link_to_if_arvados_object ob, friendly_name: true %>
51       </td><td>
52         <%= link_to_if_arvados_object ob.pipeline_template_uuid, friendly_name: true %>
53       </td><td>
54         <%= link_to_if_arvados_object ob.owner_uuid, friendly_name: true %>
55       </td><td>
56         <%= distance_of_time_in_words(ob.created_at, Time.now) %>
57       </td>
58     </tr>
59     <tr>
60       <td style="border-top: 0;" colspan="3">
61       </td>
62       <td style="border-top: 0; opacity: 0.5;" colspan="4">
63         <% ob.components.each do |cname, c| %>
64         <% status = if !(c.is_a?(Hash) && c[:job].is_a?(Hash))
65                       nil
66                     elsif c[:job][:success]
67                       'success'
68                     elsif c[:job][:running]
69                       'info'
70                     else
71                       'warning'
72                     end %>
73         <span class="label label-<%= status || 'default' %>"><%= cname.to_s %></span>
74         <% end %>
75       </td>
76     </tr>
77     <% end %>
78
79   </tbody>
80 </table>
81
82 <% end %>
83
84 <% content_for :footer_js do %>
85 var showhide_compare = function() {
86     var form = $('form#compare')[0];
87     $('input[type=hidden][name="uuids[]"]', form).remove();
88     $('input[type=submit]', form).prop('disabled',true).show();
89     var checked_inputs = $('input[name="uuids[]"]:checked');
90     if (checked_inputs.length >= 2 && checked_inputs.length <= 3) {
91         checked_inputs.each(function(){
92             if(this.checked) {
93                 $('input[type=submit]', form).prop('disabled',false).show();
94                 $(form).append($('<input type="hidden" name="uuids[]"/>').val(this.value));
95             }
96         });
97     }
98 };
99 $('form input[name="uuids[]"]').on('click', showhide_compare);
100 showhide_compare();
101 <% end %>