if opts[:friendly_name]
begin
- friendly_name = resource_class.find(link_uuid).friendly_link_name
- if friendly_name and not friendly_name.empty?
- link_name = friendly_name
- end
+ link_name = resource_class.find(link_uuid).friendly_link_name
rescue RuntimeError
# If that lookup failed, the link will too. So don't make one.
return attrvalue
end
def friendly_link_name
- if self.class.column_names.include? 'name'
- self.name
- end
+ (name if self.respond_to? :name) || uuid
end
protected
def self.by_tail(t, opts={})
where(opts.merge :tail_kind => t.kind, :tail_uuid => t.uuid)
end
+
+ def friendly_link_name
+ "(#{link_class}) #{tail_kind.sub 'arvados#', ' '} #{name} #{head_kind.sub 'arvados#', ' '}"
+ end
end
current_user and current_user.is_admin
end
def friendly_link_name
- self.hostname
+ (hostname && !hostname.empty?) ? hostname : uuid
end
end
super]
end
def friendly_link_name
- self.hostname
+ (hostname && !hostname.empty?) ? hostname : uuid
end
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} %>)
+ <br />
+ (<%= link_to_if_arvados_object attrvalue, {referring_attr: attr, referring_object: obj, with_class_name: true, friendly_name: true} %>)
<% end %>
<% elsif attr == 'uuid' %>
<%= link_to_if_arvados_object attrvalue, {referring_attr: attr, referring_object: obj, with_class_name: false, friendly_name: false} %>
<% content_for :arvados_object_table do %>
-<h2><%= @object.class %> <%= @object.uuid %></h2>
+
<%= form_for @object do |f| %>
<table class="table topalign">
<thead>
--- /dev/null
+<ul class="breadcrumb">
+ <li>
+ <%= link_to((Rails.configuration.site_name rescue Rails.application.class.parent_name), '/') %>
+ <span class="divider">/</span>
+ </li>
+ <% if params[:action] == 'index' %>
+ <li class="active">
+ <%= controller.model_class.to_s.pluralize.underscore.gsub '_', ' ' %>
+ </li>
+ <% else %>
+ <li><%= link_to(
+ controller.model_class.to_s.pluralize.underscore.gsub('_', ' '),
+ url_for({controller: params[:controller]})) %>
+ <span class="divider">/</span>
+ </li>
+ <li class="active"><%= @object.andand.friendly_link_name %>
+ </li>
+ <% end %>
+</ul>
-
-<h2 class="pull-left"><%= controller.model_class.to_s.pluralize.underscore.capitalize.gsub '_', ' ' %></h2>
-<br/>
<% if controller.model_class.creatable? %>
<%= button_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}",
{ action: 'create', return_to: request.url },
{ class: 'btn btn-primary pull-right' } %>
<% end %>
-
<% if @objects.empty? %>
<br/>
<p style="text-align: center">
<% if @object.respond_to? :properties %>
<% content_for :page_title do %>
-<%= @object.properties[:page_title] || @object.uuid %>
+<%= @object.properties[:page_title] || @object.friendly_link_name %>
<% end %>
<% if @object.properties[:page_content] %>
-<% content_for :head do %>
-<style>
+<% content_for :css do %>
table.topalign>tbody>tr>td {
vertical-align: top;
}
table.topalign>thead>tr>td {
vertical-align: bottom;
}
-</style>
<% end %>
<table class="topalign table">
+++ /dev/null
-<%= render :partial => 'application/arvados_object' %>
<div class="container">
+ <%= content_for?(:breadcrumbs) ? yield(:breadcrumbs) : render(partial: 'breadcrumbs') %>
<%= yield %>
</div> <!-- /container -->
+<% content_for :breadcrumbs do '' end %>
+
<% n_files = @required_user_agreements.collect(&:files).flatten(1).count %>
<% content_for :page_title do %>
<% if n_files == 1 %>
+<% content_for :breadcrumbs do raw '<!-- -->' end %>
<% content_for :css do %>
.dash-list {
padding: 9px 0;
+<% content_for :breadcrumbs do raw '<!-- -->' end %>
+
<%= image_tag "dax.png", style: "float: left; max-width: 25%; margin-right: 2em" %>
<h1>Hi there! Please log in to use <%= Rails.configuration.site_name %>.</h1>
<div class="row-fluid">