[ARVADOS] updated: ad8e91c2c580b2a6188fccafb05672b7130ec931
git at public.curoverse.com
git at public.curoverse.com
Tue Feb 25 11:54:38 EST 2014
Summary of changes:
apps/workbench/Gemfile | 2 +-
apps/workbench/Gemfile.lock | 6 +++++
.../app/controllers/application_controller.rb | 3 +-
apps/workbench/app/helpers/application_helper.rb | 2 +-
apps/workbench/app/models/arvados_base.rb | 21 ++++++++++++++++++
.../views/application/_selection_checkbox.html.erb | 2 +
.../views/pipeline_templates/_show_recent.html.erb | 23 ++++++++++++++++++++
7 files changed, 56 insertions(+), 3 deletions(-)
via ad8e91c2c580b2a6188fccafb05672b7130ec931 (commit)
from 98f0657745f2f38c19047ef9039c52c1b0fe0659 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit ad8e91c2c580b2a6188fccafb05672b7130ec931
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Tue Feb 25 11:55:51 2014 -0500
Fixed url_for() so that links/redirects to workbench records work as expected.
Can now click a "play" button next to a pipeline template and create a pipeline instance.
diff --git a/apps/workbench/Gemfile b/apps/workbench/Gemfile
index 66734ef..6aecdeb 100644
--- a/apps/workbench/Gemfile
+++ b/apps/workbench/Gemfile
@@ -43,7 +43,7 @@ gem 'less-rails'
# gem 'capistrano'
# To use debugger
-# gem 'debugger'
+#gem 'byebug'
gem 'rvm-capistrano', :group => :test
diff --git a/apps/workbench/Gemfile.lock b/apps/workbench/Gemfile.lock
index 7f4dc8e..247fa30 100644
--- a/apps/workbench/Gemfile.lock
+++ b/apps/workbench/Gemfile.lock
@@ -36,6 +36,9 @@ GEM
bootstrap-x-editable-rails (1.5.1.1)
railties (>= 3.0)
builder (3.0.4)
+ byebug (2.7.0)
+ columnize (~> 0.3)
+ debugger-linecache (~> 1.2)
capistrano (2.15.5)
highline
net-scp (>= 1.0.0)
@@ -49,8 +52,10 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.6.3)
+ columnize (0.3.6)
commonjs (0.2.7)
daemon_controller (1.1.7)
+ debugger-linecache (1.2.0)
erubis (2.7.0)
execjs (2.0.2)
highline (1.6.20)
@@ -152,6 +157,7 @@ DEPENDENCIES
andand
bootstrap-sass (~> 3.1.0)
bootstrap-x-editable-rails
+ byebug
coffee-rails (~> 3.2.0)
httpclient
jquery-rails
diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 02ebc8b..162fd28 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -107,8 +107,9 @@ class ApplicationController < ActionController::Base
end
def create
- @object ||= model_class.new params[model_class.to_s.singularize.to_sym]
+ @object ||= model_class.new params[model_class.to_s.underscore.singularize.to_sym]
@object.save!
+
respond_to do |f|
f.html {
redirect_to(params[:return_to] || @object)
diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index cd8e527..48b6bb4 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -67,7 +67,7 @@ module ApplicationHelper
end
end
style_opts[:class] = (style_opts[:class] || '') + ' nowrap'
- link_to link_name, { controller: resource_class.to_s.underscore.pluralize, action: 'show', id: link_uuid }, style_opts
+ link_to link_name, { controller: resource_class.to_s.tableize, action: 'show', id: link_uuid }, style_opts
else
attrvalue
end
diff --git a/apps/workbench/app/models/arvados_base.rb b/apps/workbench/app/models/arvados_base.rb
index f1d4294..fbf7ee5 100644
--- a/apps/workbench/app/models/arvados_base.rb
+++ b/apps/workbench/app/models/arvados_base.rb
@@ -61,13 +61,16 @@ class ArvadosBase < ActiveRecord::Base
attr_reader :kind
@columns
end
+
def self.column(name, sql_type = nil, default = nil, null = true)
ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
end
+
def self.attribute_info
self.columns
@attribute_info
end
+
def self.find(uuid, opts={})
if uuid.class != String or uuid.length < 27 then
raise 'argument to find() must be a uuid string. Acceptable formats: warehouse locator or string with format xxxxx-xxxxx-xxxxxxxxxxxxxxx'
@@ -84,21 +87,27 @@ class ArvadosBase < ActiveRecord::Base
end
new.private_reload(hash)
end
+
def self.order(*args)
ArvadosResourceList.new(self).order(*args)
end
+
def self.where(*args)
ArvadosResourceList.new(self).where(*args)
end
+
def self.limit(*args)
ArvadosResourceList.new(self).limit(*args)
end
+
def self.eager(*args)
ArvadosResourceList.new(self).eager(*args)
end
+
def self.all(*args)
ArvadosResourceList.new(self).all(*args)
end
+
def save
obdata = {}
self.class.columns.each do |col|
@@ -128,8 +137,11 @@ class ArvadosBase < ActiveRecord::Base
end
end
+ @new_record = false
+
self
end
+
def save!
self.save or raise Exception.new("Save failed")
end
@@ -169,6 +181,7 @@ class ArvadosBase < ActiveRecord::Base
@links = $arvados_api_client.api Link, '', { _method: 'GET', where: o, eager: true }
@links = $arvados_api_client.unpack_api_response(@links)
end
+
def all_links
return @all_links if @all_links
res = $arvados_api_client.api Link, '', {
@@ -181,9 +194,11 @@ class ArvadosBase < ActiveRecord::Base
}
@all_links = $arvados_api_client.unpack_api_response(res)
end
+
def reload
private_reload(self.uuid)
end
+
def private_reload(uuid_or_hash)
raise "No such object" if !uuid_or_hash
if uuid_or_hash.is_a? Hash
@@ -206,8 +221,14 @@ class ArvadosBase < ActiveRecord::Base
end
end
@all_links = nil
+ @new_record = false
self
end
+
+ def to_param
+ uuid
+ end
+
def dup
super.forget_uuid!
end
diff --git a/apps/workbench/app/views/application/_selection_checkbox.html.erb b/apps/workbench/app/views/application/_selection_checkbox.html.erb
index cb0ec82..4d47d89 100644
--- a/apps/workbench/app/views/application/_selection_checkbox.html.erb
+++ b/apps/workbench/app/views/application/_selection_checkbox.html.erb
@@ -1,6 +1,8 @@
+<%if object %>
<%= check_box_tag 'uuids[]', object.uuid, false, {
:class => 'persistent-selection',
:friendly_type => object.class.name,
:friendly_name => object.selection_label,
:href => "#{url_for controller: object.class.name.tableize, action: 'show', id: object.uuid }"
} %>
+<% end %>
diff --git a/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb b/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
index c389aa0..f878f59 100644
--- a/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
+++ b/apps/workbench/app/views/pipeline_templates/_show_recent.html.erb
@@ -1,7 +1,22 @@
+<% content_for :css do %>
+ .playbutton {
+ color: white;
+ background: gray;
+ border: 0px;
+ border-radius: 3px;
+ padding: 0px 3px;
+ }
+ .playbutton:hover {
+ color: white;
+ background: blackh;
+ }
+<% end %>
+
<table class="table table-hover">
<thead>
<tr class="contain-align-left">
<th>
+ </th><th>
id
</th><th>
name
@@ -18,6 +33,14 @@
<tr>
<td>
+ <%= form_tag '/pipeline_instances' do |f| %>
+ <%= hidden_field :pipeline_instance, :pipeline_template_uuid, :value => ob.uuid %>
+ <%= button_tag nil, {class: 'playbutton'} do %>
+ <span class="glyphicon glyphicon-play"></span>
+ <% end %>
+ <% end %>
+ </td>
+ <td>
<%= link_to_if_arvados_object ob %>
</td><td>
<%= render_editable_attribute ob, 'name' %>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list