[ARVADOS] updated: 030d673e455ac7fa92732eafe95f1db12f6a46b6
git at public.curoverse.com
git at public.curoverse.com
Fri Jan 10 21:16:11 EST 2014
Summary of changes:
apps/workbench/app/helpers/application_helper.rb | 10 +++++---
.../views/application/_arvados_attr_value.html.erb | 22 ++++++++++---------
.../app/views/application/_arvados_object.html.erb | 18 +++++++---------
.../application/_arvados_object_attr.html.erb | 4 +-
4 files changed, 28 insertions(+), 26 deletions(-)
via 030d673e455ac7fa92732eafe95f1db12f6a46b6 (commit)
from e52eb49c5e240f6adecf0242cd967a1ae6991291 (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 030d673e455ac7fa92732eafe95f1db12f6a46b6
Author: Peter Amstutz <tetron at cosmos>
Date: Fri Jan 10 21:16:11 2014 -0500
Still working on link naming
diff --git a/apps/workbench/app/helpers/application_helper.rb b/apps/workbench/app/helpers/application_helper.rb
index fe35bfe..0c552df 100644
--- a/apps/workbench/app/helpers/application_helper.rb
+++ b/apps/workbench/app/helpers/application_helper.rb
@@ -32,11 +32,13 @@ module ApplicationHelper
link_name = opts[:link_text]
if !link_name
link_name = link_uuid
- opts[:friendly_name]
- if opts[:friendly_name] and resource_class.column_names.include? "name"
- link_name = resource_class.find(link_uuid).name
+
+ if opts[:friendly_name] and resource_class.column_names.include? "name" and resource_class.find(link_uuid).name != nil and not resource_class.find(link_uuid).name.empty?
+ link_name = "#{resource_class.to_s} #{resource_class.find(link_uuid).name}"
+ elsif opts[:friendly_name] and resource_class.column_names.include? "hostname" and resource_class.find(link_uuid).hostname != nil and not resource_class.find(link_uuid).hostname.empty?
+ link_name = "#{resource_class.to_s} #{resource_class.find(link_uuid).hostname}"
elsif opts[:friendly_name] and resource_class.column_names.include? "first_name"
- link_name = "#{resource_class.find(link_uuid).first_name} #{resource_class.find(link_uuid).last_name}"
+ link_name = "#{resource_class.to_s} #{resource_class.find(link_uuid).first_name} #{resource_class.find(link_uuid).last_name}"
else
if opts[:with_class_name]
link_name = "#{resource_class.to_s} #{link_name}"
diff --git a/apps/workbench/app/views/application/_arvados_attr_value.html.erb b/apps/workbench/app/views/application/_arvados_attr_value.html.erb
index 0fb0181..55f8d08 100644
--- a/apps/workbench/app/views/application/_arvados_attr_value.html.erb
+++ b/apps/workbench/app/views/application/_arvados_attr_value.html.erb
@@ -3,14 +3,16 @@
<%= message %><br />
<% end %>
<% else %>
- <% if attr == 'uuid' and (uuid = attrvalue.split('-')).size == 3 %>
- <%= uuid[0..-2].join('-') %>-<b><%= uuid[-1] %></b>
- <% elsif allow_edit && obj.attribute_editable?(attr) %>
- <%= render_editable_attribute obj, attr %>
- <% else %>
- <%= link_to_if_arvados_object attrvalue, {referring_attr: attr, referring_object: obj, with_class_name: true, friendly_name: true} %>
- <% end %>
- <% if resource_class_for_uuid(attrvalue, {referring_object: obj, referring_attr: attr}) %>
- <%= link_to_if_arvados_object(attrvalue, { referring_object: obj, link_text: raw('<span class="icon-hand-right"></span>'), referring_attr: attr }) %>
- <% end %>
+ <% if obj.attribute_editable?(attr) %>
+ <%= render_editable_attribute obj, attr %>
+ <% if resource_class_for_uuid(attrvalue, {referring_object: obj, referring_attr: attr}) %>
+ (<%= link_to_if_arvados_object attrvalue, {referring_attr: attr, referring_object: obj, with_class_name: true, friendly_name: true} %>
+ <%= link_to_if_arvados_object(attrvalue, { referring_object: obj, link_text: raw('<span class="icon-hand-right"></span>'), referring_attr: attr }) %>)
+ <% end %>
+ <% else %>
+ <%= link_to_if_arvados_object attrvalue, {referring_attr: attr, referring_object: obj, with_class_name: true, friendly_name: true} %>
+ <% if resource_class_for_uuid(attrvalue, {referring_object: obj, referring_attr: attr}) %>
+ <%= link_to_if_arvados_object(attrvalue, { referring_object: obj, link_text: raw('<span class="icon-hand-right"></span>'), referring_attr: attr }) %>
+ <% end %>
+ <% end %>
<% end %>
diff --git a/apps/workbench/app/views/application/_arvados_object.html.erb b/apps/workbench/app/views/application/_arvados_object.html.erb
index 8e0350a..95894d1 100644
--- a/apps/workbench/app/views/application/_arvados_object.html.erb
+++ b/apps/workbench/app/views/application/_arvados_object.html.erb
@@ -20,11 +20,10 @@
<tbody>
<% incoming.each do |link| %>
<tr>
- <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "uuid", attrvalue: link.uuid, allow_edit: false } %></td>
- <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "link_class", attrvalue: link.link_class, allow_edit: false } %></td>
- <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "name", attrvalue: link.name, allow_edit: false } %></td>
- <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "head_uuid", attrvalue: link.head_uuid, allow_edit: false } %></td>
- <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "properties", attrvalue: link.properties, allow_edit: false } %></td>
+ <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "uuid", attrvalue: link.uuid } %></td>
+ <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "link_class", attrvalue: link.link_class } %></td>
+ <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "head_uuid", attrvalue: link.head_uuid } %></td>
+ <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "properties", attrvalue: link.properties } %></td>
</tr>
<% end %>
</tbody>
@@ -40,11 +39,10 @@
<tbody>
<% outgoing.each do |link| %>
<tr>
- <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "uuid", attrvalue: link.uuid, allow_edit: false } %></td>
- <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "link_class", attrvalue: link.link_class, allow_edit: false } %></td>
- <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "name", attrvalue: link.name, allow_edit: false } %></td>
- <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "tail_uuid", attrvalue: link.tail_uuid, allow_edit: false } %></td>
- <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "properties", attrvalue: link.properties, allow_edit: false } %></td>
+ <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "uuid", attrvalue: link.uuid } %></td>
+ <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "link_class", attrvalue: link.link_class } %></td>
+ <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "tail_uuid", attrvalue: link.tail_uuid } %></td>
+ <td><%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "properties", attrvalue: link.properties } %></td>
</tr>
<% end %>
</tbody>
diff --git a/apps/workbench/app/views/application/_arvados_object_attr.html.erb b/apps/workbench/app/views/application/_arvados_object_attr.html.erb
index 90c8a61..ec2ac36 100644
--- a/apps/workbench/app/views/application/_arvados_object_attr.html.erb
+++ b/apps/workbench/app/views/application/_arvados_object_attr.html.erb
@@ -2,7 +2,7 @@
<tr class="info">
<td><%= attr %>[<%= infokey %>]</td>
<td>
- <%= render partial: 'application/arvados_attr_value', locals: { obj: @object, attr: nil, attrvalue: infocontent, allow_edit: false } %>
+ <%= render partial: 'application/arvados_attr_value', locals: { obj: @object, attr: nil, attrvalue: infocontent } %>
</td>
</tr>
<% end %>
@@ -10,7 +10,7 @@
<tr class="<%= 'info' if %w(uuid owner_uuid created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at).index(attr.to_s).nil? %>">
<td><%= attr %></td>
<td>
- <%= render partial: 'application/arvados_attr_value', locals: { obj: @object, attr: attr, attrvalue: attrvalue, allow_edit: true } %>
+ <%= render partial: 'application/arvados_attr_value', locals: { obj: @object, attr: attr, attrvalue: attrvalue } %>
</td>
</tr>
<% end %>
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list