/
index.html.erb
51 lines (47 loc) · 1.35 KB
/
index.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
48
49
50
51
<h1>Manage your codes</h1>
<% if !@codes.empty? %>
<table border="1">
<thead>
<tr>
<td>Code Name</td>
<td>Created at</td>
<td>Latest change</td>
<td>Revision</td>
<td>Actions</td>
<td>Queue!</td>
<td>Schedule!</td>
</tr>
</thead>
<% @codes.each do |c| %>
<tr>
<td><%= c.name %></td>
<td><%= c.created_at %></td>
<td><%= c.latest_change %></td>
<td><%= c.rev %></td>
<td>
<%= link_to "Revisions", revisions_code_path(c.id) %>
<%= link_to "Download", download_code_path(c.id) %>
</td>
<td><%= button_to "Queue!", queue_tasks_path(:worker_name => c.name) %></td>
<td><%= button_to "Schedule!", schedule_task_schedules_path(:worker_name => c.name, :seconds => 10) %></td>
</tr>
<% end %>
</table>
<% else %>
<h5>There are now any codes uploaded, feel free to upload new one</h5>
<% end %>
<h3>Worker files to upload</h3>
<table border="1">
<thead>
<tr>
<td>File Name</td>
<td>Action</td>
</tr>
</thead>
<% @files.each do |f| %>
<tr>
<td><%= File.basename(f) %></td>
<td><%= button_to "Upload file", upload_codes_path(:filename => f) %></td>
<% end %>
</table>
<%= link_to "Back", root_path %>