Fix up tab titles.
authorTom Clegg <tom@curoverse.com>
Fri, 7 Feb 2014 01:41:54 +0000 (17:41 -0800)
committerTom Clegg <tom@curoverse.com>
Fri, 7 Feb 2014 01:41:54 +0000 (17:41 -0800)
apps/workbench/app/controllers/api_client_authorizations_controller.rb
apps/workbench/app/controllers/application_controller.rb
apps/workbench/app/controllers/authorized_keys_controller.rb
apps/workbench/app/controllers/collections_controller.rb
apps/workbench/app/controllers/jobs_controller.rb
apps/workbench/app/controllers/pipeline_instances_controller.rb
apps/workbench/app/views/application/_content.html.erb

index 03f0a040dde538a6a54dc8101130d4458fbfb6e0..81e324a46a6b379e5ec06583410d11ec69fcf5bd 100644 (file)
@@ -7,7 +7,7 @@ class ApiClientAuthorizationsController < ApplicationController
   end
 
   def index_pane_list
-    %w(recent help)
+    %w(Recent Help)
   end
 
 end
index 100c5ea0c20daef798233e3cbfb099f96a6463e1..d26a13ef4257790ab09fae94db97f1db8648ac32 100644 (file)
@@ -144,11 +144,11 @@ class ApplicationController < ActionController::Base
   end
 
   def index_pane_list
-    %w(recent)
+    %w(Recent)
   end
 
   def show_pane_list
-    %w(attributes metadata json api)
+    %w(Attributes Metadata JSON API)
   end
 
   protected
index 4cd5280b9fe65e7638490421fa430e0ad9462272..6eaec1ee59f1e954afb1b419dc57e9f9a277a888 100644 (file)
@@ -1,6 +1,6 @@
 class AuthorizedKeysController < ApplicationController
   def index_pane_list
-    %w(recent help)
+    %w(Recent Help)
   end
 
   def new
index d393da0c920117ba38b8c6303536d91b78bbd067..1fe786d04890d96462340e09926ce167aaf1074f 100644 (file)
@@ -3,7 +3,7 @@ class CollectionsController < ApplicationController
   skip_before_filter :check_user_agreements, :only => [:show_file]
 
   def show_pane_list
-    %w(files attributes metadata provenance_graph used_by json api)
+    %w(Files Attributes Metadata Provenance_graph Used_by JSON API)
   end
   def index
     if params[:search].andand.length.andand > 0
index be9fe03bf53c0b9955705f067c265014c6b8df12..d302bffad5359751b213a63afecf4c8dfa39faa9 100644 (file)
@@ -33,13 +33,13 @@ class JobsController < ApplicationController
 
   def index_pane_list
     if params[:uuid]
-      %w(recent provenance)
+      %w(Recent Provenance)
     else
-      %w(recent)
+      %w(Recent)
     end
   end
 
   def show_pane_list
-    %w(attributes provenance metadata json api)
+    %w(Attributes Provenance Metadata JSON API)
   end
 end
index 73668cdf6c7d6de4b427a584094bef424c261aca..7ca4f6a11ed2d6c6f4c5fdead9362d1eee74df0f 100644 (file)
@@ -132,11 +132,11 @@ class PipelineInstancesController < ApplicationController
   end
 
   def show_pane_list
-    %w(components graph attributes metadata json api)
+    %w(Components Graph Attributes Metadata JSON API)
   end
 
   def compare_pane_list 
-    %w(text_compare graph)
+    %w(Compare Graph)
   end 
 
   protected
index 37250cc0299efa0a63aa63688aacf4c7e98d3bfe..e7023643356d467aaf6fc4e840cf00b839d0c14b 100644 (file)
@@ -1,17 +1,22 @@
 <% content_for :tab_panes do %>
 
+<% comparable = controller.respond_to? :compare %>
 <% pane_list ||= %w(recent) %>
+<% panes = Hash[pane_list.map { |pane|
+     [pane, render(partial: 'show_' + pane.downcase,
+                   locals: { comparable: comparable })]
+   }.compact] %>
 
 <ul class="nav nav-tabs">
-  <% pane_list.each_with_index do |pane, i| %>
-    <li class="<%= 'active' if i==0 %>"><a href="#<%= pane %>" data-toggle="tab" id="<%= pane %>-tab"> <%= pane.capitalize.gsub('_', ' ') %></a></li>
+  <% panes.each_with_index do |(pane, content), i| %>
+    <li class="<%= 'active' if i==0 %>"><a href="#<%= pane %>" data-toggle="tab" id="<%= pane %>-tab"> <%= pane.gsub('_', ' ') %></a></li>
   <% end %>
 </ul>
 <div class="tab-content">
-<% pane_list.each_with_index do |pane, i| %>
+<% panes.each_with_index do |(pane, content), i| %>
   <div id="<%= pane %>" class="tab-pane fade <%= 'in active' if i==0 %>">
     <div class="smart-scroll">
-      <%= render partial: 'show_' + pane %>
+      <%= content %>
     </div>
   </div>
 <% end %>