[ARVADOS] updated: 21e96241f20ddec17d6d122a489902204a2a0781
git at public.curoverse.com
git at public.curoverse.com
Thu Apr 17 10:06:43 EDT 2014
Summary of changes:
apps/workbench/app/helpers/application_helper.rb | 43 +++-
apps/workbench/app/helpers/collections_helper.rb | 21 ++
.../app/views/layouts/application.html.erb | 1 -
apps/workbench/test/integration/users_test.rb | 2 +-
doc/_config.yml | 3 +-
doc/api/methods/jobs.html.textile.liquid | 94 ++++++++-
doc/api/schema/Job.html.textile.liquid | 17 +--
.../schema/PipelineTemplate.html.textile.liquid | 127 +++++++++++-
.../job-and-pipeline-reference.html.textile.liquid | 223 --------------------
.../tutorial-firstscript.html.textile.liquid | 2 +
.../tutorial-new-pipeline.html.textile.liquid | 2 +
sdk/cli/bin/crunch-job | 15 +-
.../app/controllers/arvados/v1/jobs_controller.rb | 2 +-
.../app/controllers/arvados/v1/links_controller.rb | 16 +-
services/api/test/fixtures/jobs.yml | 13 ++
.../arvados/v1/job_reuse_controller_test.rb | 20 ++-
.../functional/arvados/v1/links_controller_test.rb | 30 +++
services/keep/keep.go | 189 ++++++++++++++++-
services/keep/keep_test.go | 76 +++++++-
19 files changed, 614 insertions(+), 282 deletions(-)
delete mode 100644 doc/user/reference/job-and-pipeline-reference.html.textile.liquid
via 21e96241f20ddec17d6d122a489902204a2a0781 (commit)
via 30b02581c938c05b804f7510a1fc8e850830b9cd (commit)
via 2f91702d89b7a64093465a1923b87acade6b9715 (commit)
via 89fcf2b60968558a6994ee14c202bc2c76f1d8fe (commit)
via 8048da32800fab790b68f502c52dd00c89b5b690 (commit)
via 51c1390ce92353a4fcf1adfe3643729eff5d6a8a (commit)
via dc51a3a6a2915d66f1b8f82580637b5733bb49f5 (commit)
via ea7c6effed14cd80a444c6e4d5b89c8b99c17d59 (commit)
via 340bd4f69f320d541b6c352953ca9ac2336da470 (commit)
via b346f8754f5d4840ad80aa97bd910f3a6844b413 (commit)
via e6815764c940968ed825e8b2e4d984824a68fd23 (commit)
via 52b3716d78c410806e8aaea89994b39015694258 (commit)
via d9f6071c52c33831be88546475480920fe7e1a60 (commit)
via c2aeaa729c350a33ec47ae1b012e50a6685ac2d2 (commit)
via ad2984e6eaf029ba7b6e35ae875bb78cfb76dfb6 (commit)
via 9067fd12d2c4259a2988286663098c59af18c854 (commit)
via 8e69317214ad56a6255f56725fa3b966c663eda3 (commit)
via dcea5126ac48ecb3916bc8c245d59b1ca4439677 (commit)
via ea6dd70f3178eb38afa4eda7ce49e1bfe8328c40 (commit)
via 4f4f0f57721d854aaddec8ab7dbc8759075717b5 (commit)
via b7d408dfa43a15c6b97e35a72a54b23e8880d8c9 (commit)
via df05c261c2b3b3a20f77dcaf8d481a5a113e67e8 (commit)
via a27dd6c9ab51311af2fbe194a7e5e0b592b78e79 (commit)
via 75df7deca434d9b3b161dc2d7d13ae21b1fe4b08 (commit)
via 17c335f710c5f855f61c13fe69594d7ec439b007 (commit)
via c4b51836d29d37cb75c6432ce056d844cf27c3ac (commit)
via 3c554a995e2b4f716106876ffbd311e87cce4091 (commit)
via 0a09da628d4d7f1ced2daaa55603bea940b9211c (commit)
via c7b155c06452315396ec98f42cf5b502be38b221 (commit)
from c9f04f87062eec4097dc74dcc79b364fb905851c (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 21e96241f20ddec17d6d122a489902204a2a0781
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Apr 17 10:06:36 2014 -0400
Thumbnail behavior now conforms to original story
Added documentation to a few methods
diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index c3e9e59..ec10a52 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -38,7 +38,7 @@ module ApplicationHelper
end
return h(n)
- #raw = n.to_s
+ #raw = n.to_s
#cooked = ''
#while raw.length > 3
# cooked = ',' + raw[-3..-1] + cooked
@@ -51,6 +51,31 @@ module ApplicationHelper
ArvadosBase::resource_class_for_uuid(attrvalue, opts)
end
+ ##
+ # Returns HTML that links to the Arvados object specified in +attrvalue+
+ # Provides various output control and styling options.
+ #
+ # +attrvalue+ an Arvados model object or uuid
+ #
+ # +opts+ a set of flags to control output:
+ #
+ # [:link_text] the link text to use (may include HTML), overrides everything else
+ #
+ # [:friendly_name] whether to use the "friendly" name in the link text (by
+ # calling #friendly_link_name on the object), otherwise use the uuid
+ #
+ # [:with_class_name] prefix the link text with the class name of the model
+ #
+ # [:no_tags] disable tags in the link text (default is to show tags).
+ # Currently tags are only shown for Collections.
+ #
+ # [:thumbnail] if the object is a collection, show an image thumbnail if the
+ # collection consists of a single image file.
+ #
+ # [:no_link] don't create a link, just return the link text
+ #
+ # +style_opts+ additional HTML properties for the anchor tag, passed to link_to
+ #
def link_to_if_arvados_object(attrvalue, opts={}, style_opts={})
if (resource_class = resource_class_for_uuid(attrvalue, opts))
link_uuid = attrvalue.is_a?(ArvadosBase) ? attrvalue.uuid : attrvalue
@@ -79,15 +104,11 @@ module ApplicationHelper
end
end
if opts[:thumbnail] and resource_class == Collection
- maximg = 3
+ # add an image thumbnail if the collection consists of a single image file.
Collection.where(uuid: link_uuid).each do |c|
- c.files.each do |file|
- if CollectionsHelper::is_image file[1]
- link_name += " "
- link_name += image_tag "#{url_for c}/#{CollectionsHelper::file_path file}", style: "height: 4em; width: auto"
- maximg -= 1
- end
- break if maximg == 0
+ if c.files.length == 1 and CollectionsHelper::is_image c.files.first[1]
+ link_name += " "
+ link_name += image_tag "#{url_for c}/#{CollectionsHelper::file_path c.files.first}", style: "height: 4em; width: auto"
end
end
end
@@ -99,6 +120,7 @@ module ApplicationHelper
link_to raw(link_name), { controller: resource_class.to_s.tableize, action: 'show', id: link_uuid }, style_opts
end
else
+ # just return attrvalue if it is not recognizable as an Arvados object or uuid.
attrvalue
end
end
@@ -146,7 +168,6 @@ module ApplicationHelper
datatype = nil
required = true
if template
- #puts "Template is #{template.class} #{template.is_a? Hash} #{template}"
if template.is_a? Hash
if template[:output_of]
return raw("<span class='label label-default'>#{template[:output_of]}</span>")
diff --git a/apps/workbench/app/helpers/collections_helper.rb b/apps/workbench/app/helpers/collections_helper.rb
index 1f867a6..23933cf 100644
--- a/apps/workbench/app/helpers/collections_helper.rb
+++ b/apps/workbench/app/helpers/collections_helper.rb
@@ -5,14 +5,35 @@ module CollectionsHelper
end
end
+ ##
+ # Regex match for collection UUIDs, returns a regex match object with the
+ # hash in group 1, (optional) size in group 2, (optional) subsequent uuid
+ # fields in group 3, and (optional) file path within the collection as group
+ # 4; or nil for no match.
+ #
+ # +uuid+ the uuid string to match
+ #
def self.match(uuid)
/^([a-f0-9]{32})(\+[0-9]+)?(\+.*?)?(\/.*)?$/.match(uuid.to_s)
end
+ ##
+ # Regex match for common image file extensions, returns a regex match object
+ # with the matched extension in group 1; or nil for no match.
+ #
+ # +file+ the file string to match
+ #
def self.is_image file
/\.(jpg|jpeg|gif|png|svg)$/i.match(file)
end
+ ##
+ # Generates a relative file path than can be appended to the URL of a
+ # collection to get a file download link without adding a spurious ./ at the
+ # beginning for files in the default stream.
+ #
+ # +file+ an entry in the Collection.files list in the form [stream, name, size]
+ #
def self.file_path file
f0 = file[0]
f0 = '' if f0 == '.'
commit 30b02581c938c05b804f7510a1fc8e850830b9cd
Merge: c9f04f8 2f91702
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Thu Apr 17 08:50:39 2014 -0400
Merge remote-tracking branch 'origin/master' into 1971-show-image-thumbnails
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list