/
_source_list.html.erb
47 lines (47 loc) · 1.51 KB
/
_source_list.html.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<table>
<tr>
<th>source date</th>
<th>description</th>
</tr>
<% series.data_sources_by_last_run.each do |ds| %>
<% eval = ds.eval.nil? ? " " : ds.eval.split(" ").join(" ") %>
<tr style="background-color:#<%= ds.color%>" >
<td><%= ds.last_run.localtime.strftime("%m/%d/%y") %> <span style="color:gray"><%=
ds.last_run.localtime.strftime("%H:%M:%S") %></span><br />
<%=
link_to "load", {
:controller=> "data_sources",
:action => 'source',
:id => ds.id} unless ds.eval.nil?
%> | <%=
link_to "clear", {
:controller=> "data_sources",
:action => 'clear_and_reload',
:id => ds.id} unless ds.eval.nil?
%> | <%=
link_to "delete", {
:controller=> "data_sources",
:action => 'delete',
:id => ds.id},
:confirm => "Are you sure you want to delete this data source?"
%> <span style="color:gray">
| <%=
link_to "edit", {
:controller=> "data_sources",
:action => 'edit',
:id => ds.id}
%> <span style="color:gray">(<%=
"#{ds.runtime.round(2)}s" unless ds.runtime.nil?
%>)</span>
</td>
<td>
<h3><%= ds.id %></h3>
<%= raw linked_version(ds.description) %>
<br />
<%= raw eval %>
<%= #render(:partial => 'pattern', :locals => {:pattern_id => ds.description.split(" ")[4]}) if ds.description.start_with?("loaded from pattern id")
%>
</td>
</tr>
<% end %>
</table>