Can now specify in an arvados model that an element should be rendered as textile...
[arvados.git] / apps / workbench / app / models / job.rb
1 class Job < ArvadosBase
2   def self.goes_in_projects?
3     true
4   end
5
6   def content_summary
7     "#{script} job"
8   end
9
10   def attribute_editable? attr, *args
11     false
12   end
13
14   def self.creatable?
15     false
16   end
17
18   def default_name
19     if script
20       x = "\"#{script}\" job"
21     else
22       x = super
23     end
24     if finished_at
25       x += " finished #{finished_at.strftime('%b %-d')}"
26     elsif started_at
27       x += " started #{started_at.strftime('%b %-d')}"
28     elsif created_at
29       x += " submitted #{created_at.strftime('%b %-d')}"
30     end
31   end
32
33   def cancel
34     arvados_api_client.api "jobs/#{self.uuid}/", "cancel", {}
35   end
36 end