Merge branch 'master' into 2272-setup-user-in-workbench
[arvados.git] / apps / workbench / app / views / jobs / _show_recent.html.erb
1 <% content_for :css do %>
2   table.topalign>tbody>tr>td {
3   vertical-align: top;
4   }
5   table.topalign>thead>tr>td {
6   vertical-align: bottom;
7   }
8 <% end %>
9
10 <table class="topalign table">
11   <thead>
12     <tr class="contain-align-left">
13       <th>
14       </th><th>
15         status
16       </th><th>
17         progress
18       </th><th>
19         uuid
20       </th><th>
21         script
22       </th><th>
23         version
24       </th><th>
25         output
26       </th>
27     </tr>
28   </thead>
29   <tbody>
30
31     <% @jobs.sort_by { |j| j[:created_at] }.reverse.each do |j| %>
32
33     <tr class="cell-noborder">
34       <td>
35         <i class="icon-plus-sign expand-collapse-row" data-id="<%= j.uuid %>" style="cursor: pointer"></i>
36       </td>
37       <td>
38         <%= render partial: 'job_status_label', locals: {:j => j} %>
39       </td>
40       <td>
41         <div class="inline-progress-container">
42           <%= render partial: 'job_progress', locals: {:j => j} %>
43         </div>
44       </td>
45       <td>
46         <%= link_to_if_arvados_object j.uuid %>
47       </td>
48       <td>
49         <%= j.script %>
50       </td>
51       <td>
52         <%= j.script_version.andand[0..8] %>
53       </td>
54       <td>
55         <%= link_to_if_arvados_object j.output %>
56       </td>
57     </tr>
58     <tr class="cell-noborder" id="<%= j.uuid %>" style="display:none">
59       <td colspan="7"><table class="table table-justforlayout"><tr>
60       <td style="border-left: 1px solid black">
61         <table class="table table-condensed">
62           <tr>
63             <td>
64               queued
65             </td>
66             <td>
67               &#x2709;&nbsp;<span title="<%= j.created_at %>"><%= raw distance_of_time_in_words(Time.now, j.created_at).sub('about ','~').sub(' ','&nbsp;') + '&nbsp;ago' if j.created_at %></span>
68             </td>
69             <td>
70               <%= raw('for&nbsp;' + distance_of_time_in_words(j.started_at, j.created_at).sub('about ','~').sub(' ','&nbsp;')) if j.created_at and j.started_at %>
71             </td>
72           </tr>
73           <% if j.started_at.is_a? Time %>
74           <tr>
75             <td>
76               started
77             </td>
78             <td>
79               &#x2708;&nbsp;<span title="<%= j.created_at %>"><%= raw distance_of_time_in_words(j.started_at, Time.now).sub('about ','~').sub(' ','&nbsp;') + '&nbsp;ago' if j.started_at %></span>
80             </td>
81             <td>
82               <% if j.finished_at.is_a? Time %>
83               <%= raw('ran&nbsp;' + distance_of_time_in_words(j.finished_at, j.started_at).sub('about ','~').sub(' ','&nbsp;')) %>
84               <% elsif j.running %>
85               <span class="badge badge-success" title="tasks finished">&#x2714;&nbsp;<%= j.tasks_summary[:done] %></span>
86               <span class="badge badge-info" title="tasks running">&#x2708;&nbsp;<%= j.tasks_summary[:running] %></span>
87               <span class="badge" title="tasks todo">&#x2709;&nbsp;<%= j.tasks_summary[:todo] %></span>
88               <% if j.tasks_summary[:failed] %>
89               <span class="badge badge-warning" title="task failures">&#x2716;&nbsp;<%= j.tasks_summary[:failed] %></span>
90               <% end %>
91               <% end %>
92             </td>
93           </tr>
94           <% end %>
95         </table>
96       </td><td>
97         <table class="table table-condensed">
98           <tr><td colspan="2">
99               <%= j.script %> <%= j.script_version %>
100           </td></tr>
101           <% j.script_parameters.sort.each do |k,v| %>
102           <tr>
103             <td><%= k %></td><td><%= link_to_if_arvados_object v %></td>
104           </tr>
105           <% end %>
106           <tr>
107             <td>output</td><td><%= link_to_if_arvados_object j.output %></td>
108           </tr>
109         </table>
110       </td><td>
111         <table class="table table-condensed">
112         <% j.runtime_constraints.sort.each do |k,v| %>
113         <tr><td><%= v %></td><td><%= k %></td></tr>
114         <% end %>
115         </table>
116       </td>
117       </tr></table></td>
118     </tr>
119
120     <% end %>
121
122   </tbody>
123 </table>
124