projects
/
arvados.git
/ commitdiff
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
2ecdb02
)
Allow controller to override page name for breadcrumbs.
author
Tom Clegg <tom@curoverse.com>
Sat, 1 Feb 2014 23:16:52 +0000
(15:16 -0800)
committer
Tom Clegg <tom@curoverse.com>
Sat, 1 Feb 2014 23:29:49 +0000
(15:29 -0800)
apps/workbench/app/controllers/application_controller.rb
patch
|
blob
|
history
apps/workbench/app/controllers/pipeline_instances_controller.rb
patch
|
blob
|
history
apps/workbench/app/models/link.rb
patch
|
blob
|
history
apps/workbench/app/views/application/_breadcrumb_page_name.html.erb
[new file with mode: 0644]
patch
|
blob
apps/workbench/app/views/application/_breadcrumbs.html.erb
patch
|
blob
|
history
apps/workbench/app/views/links/_breadcrumb_page_name.html.erb
[new file with mode: 0644]
patch
|
blob
diff --git
a/apps/workbench/app/controllers/application_controller.rb
b/apps/workbench/app/controllers/application_controller.rb
index 201c063235ea2026d242f0a754c9ffb4d1c7b3e6..8d23c71a739f6c62c1ac02ce5ea1aec0ca415488 100644
(file)
--- a/
apps/workbench/app/controllers/application_controller.rb
+++ b/
apps/workbench/app/controllers/application_controller.rb
@@
-129,6
+129,11
@@
class ApplicationController < ActionController::Base
controller_name.classify.constantize
end
controller_name.classify.constantize
end
+ def breadcrumb_page_name
+ (@breadcrumb_page_name ||
+ (@object.friendly_link_name if @object.respond_to? :friendly_link_name))
+ end
+
protected
def find_object_by_uuid
protected
def find_object_by_uuid
diff --git
a/apps/workbench/app/controllers/pipeline_instances_controller.rb
b/apps/workbench/app/controllers/pipeline_instances_controller.rb
index 99a4ddddddbeb87e9f0cdaafea0642fc9a57c33d..507131f8ebcf63c319a861532494554351887b80 100644
(file)
--- a/
apps/workbench/app/controllers/pipeline_instances_controller.rb
+++ b/
apps/workbench/app/controllers/pipeline_instances_controller.rb
@@
-4,6
+4,8
@@
class PipelineInstancesController < ApplicationController
include PipelineInstancesHelper
def compare
include PipelineInstancesHelper
def compare
+ @breadcrumb_page_name = 'compare'
+
@rows = [] # each is {name: S, components: [...]}
# Build a table: x=pipeline y=component
@rows = [] # each is {name: S, components: [...]}
# Build a table: x=pipeline y=component
diff --git
a/apps/workbench/app/models/link.rb
b/apps/workbench/app/models/link.rb
index 07de4478700af803f4b54fb2be029e7e6c96aae3..899a80022ced45b28ce618f2fc847f268550750a 100644
(file)
--- a/
apps/workbench/app/models/link.rb
+++ b/
apps/workbench/app/models/link.rb
@@
-4,8
+4,4
@@
class Link < ArvadosBase
def self.by_tail(t, opts={})
where(opts.merge :tail_kind => t.kind, :tail_uuid => t.uuid)
end
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
end
diff --git a/apps/workbench/app/views/application/_breadcrumb_page_name.html.erb
b/apps/workbench/app/views/application/_breadcrumb_page_name.html.erb
new file mode 100644
(file)
index 0000000..
67387fd
--- /dev/null
+++ b/
apps/workbench/app/views/application/_breadcrumb_page_name.html.erb
@@ -0,0
+1
@@
+<%= controller.breadcrumb_page_name %>
diff --git
a/apps/workbench/app/views/application/_breadcrumbs.html.erb
b/apps/workbench/app/views/application/_breadcrumbs.html.erb
index fe1c12a01abc11ad6acb623280da4887a5161bfd..26709ad9b8fcb7bfd65eedf1971ec10aca9feb0a 100644
(file)
--- a/
apps/workbench/app/views/application/_breadcrumbs.html.erb
+++ b/
apps/workbench/app/views/application/_breadcrumbs.html.erb
@@
-13,7
+13,8
@@
url_for({controller: params[:controller]})) %>
<span class="divider">/</span>
</li>
url_for({controller: params[:controller]})) %>
<span class="divider">/</span>
</li>
- <li class="active"><%= @object.andand.friendly_link_name %>
+ <li class="active">
+ <%= render partial: 'breadcrumb_page_name' %>
</li>
<% end %>
</ul>
</li>
<% end %>
</ul>
diff --git a/apps/workbench/app/views/links/_breadcrumb_page_name.html.erb
b/apps/workbench/app/views/links/_breadcrumb_page_name.html.erb
new file mode 100644
(file)
index 0000000..
00acb84
--- /dev/null
+++ b/
apps/workbench/app/views/links/_breadcrumb_page_name.html.erb
@@ -0,0
+1,8
@@
+<% if @object %>
+(<%= @object.link_class %>)
+<%= @object.name %>:
+<%= @object.tail_kind.sub 'arvados#', ' ' %>
+→
+<%= @object.head_kind.sub 'arvados#', ' ' %>
+<% end %>
+