[ARVADOS] updated: f1d8f4de37ff66b21330ffe500c9725620ec9614

git at public.curoverse.com git at public.curoverse.com
Tue Feb 4 05:26:32 EST 2014


Summary of changes:
 .../app/controllers/application_controller.rb      |    4 ++-
 .../app/controllers/authorized_keys_controller.rb  |    4 +++
 .../app/helpers/authorized_keys_helper.rb          |    3 ++
 apps/workbench/app/helpers/repositories_helper.rb  |    3 ++
 .../app/helpers/virtual_machines_helper.rb         |    3 ++
 apps/workbench/app/models/collection.rb            |    4 +++
 .../{index.html.erb => _help.html.erb}             |    2 -
 .../{_index.html.erb => _recent.html.erb}          |    7 -----
 .../workbench/app/views/application/index.html.erb |   27 +++++++++++++++++++-
 .../app/views/authorized_keys/_help.html.erb       |   10 +++++++
 .../app/views/authorized_keys/index.html.erb       |   11 +-------
 apps/workbench/app/views/collections/_nav.html.erb |    8 ------
 .../{index.html.erb => _recent.html.erb}           |    2 -
 apps/workbench/app/views/collections/show.html.erb |    2 -
 .../jobs/{index.html.erb => _recent.html.erb}      |    0
 .../app/views/layouts/application.html.erb         |    4 +-
 .../links/{index.html.erb => _recent.html.erb}     |    0
 .../{index.html.erb => _recent.html.erb}           |   17 +++++++-----
 .../app/views/pipeline_instances/compare.html.erb  |    2 +-
 .../{index.html.erb => _recent.html.erb}           |    0
 .../{index.html.erb => _help.html.erb}             |    2 -
 .../{index.html.erb => _help.html.erb}             |    4 ---
 22 files changed, 70 insertions(+), 49 deletions(-)
 rename apps/workbench/app/views/api_client_authorizations/{index.html.erb => _help.html.erb} (93%)
 rename apps/workbench/app/views/application/{_index.html.erb => _recent.html.erb} (90%)
 create mode 100644 apps/workbench/app/views/authorized_keys/_help.html.erb
 delete mode 100644 apps/workbench/app/views/collections/_nav.html.erb
 rename apps/workbench/app/views/collections/{index.html.erb => _recent.html.erb} (96%)
 rename apps/workbench/app/views/jobs/{index.html.erb => _recent.html.erb} (100%)
 rename apps/workbench/app/views/links/{index.html.erb => _recent.html.erb} (100%)
 rename apps/workbench/app/views/pipeline_instances/{index.html.erb => _recent.html.erb} (84%)
 rename apps/workbench/app/views/pipeline_templates/{index.html.erb => _recent.html.erb} (100%)
 rename apps/workbench/app/views/repositories/{index.html.erb => _help.html.erb} (94%)
 rename apps/workbench/app/views/virtual_machines/{index.html.erb => _help.html.erb} (92%)

       via  f1d8f4de37ff66b21330ffe500c9725620ec9614 (commit)
      from  2d6b7dc675515cda26872dad430cf9195b648370 (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 f1d8f4de37ff66b21330ffe500c9725620ec9614
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Feb 4 02:25:45 2014 -0800

    Move all index content into Recent and Help tabs.
    
    refs #1979

diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb
index 6d013d7..8d6d494 100644
--- a/apps/workbench/app/controllers/application_controller.rb
+++ b/apps/workbench/app/controllers/application_controller.rb
@@ -54,7 +54,9 @@ class ApplicationController < ActionController::Base
     self.render_error status: 404
   end
 
-
+  def helper
+    (self.class.to_s.sub(/Controller$/,'')+'Helper').constantize
+  end
   def index
     @objects ||= model_class.limit(1000).all
     respond_to do |f|
diff --git a/apps/workbench/app/controllers/authorized_keys_controller.rb b/apps/workbench/app/controllers/authorized_keys_controller.rb
index 6bbb01d..2e3d8b1 100644
--- a/apps/workbench/app/controllers/authorized_keys_controller.rb
+++ b/apps/workbench/app/controllers/authorized_keys_controller.rb
@@ -1,4 +1,8 @@
 class AuthorizedKeysController < ApplicationController
+  def index_pane_list
+    %w(recent setup)
+  end
+
   def new
     super
     @object.authorized_user_uuid = current_user.uuid if current_user
diff --git a/apps/workbench/app/helpers/authorized_keys_helper.rb b/apps/workbench/app/helpers/authorized_keys_helper.rb
index 9a486f2..1ea45c1 100644
--- a/apps/workbench/app/helpers/authorized_keys_helper.rb
+++ b/apps/workbench/app/helpers/authorized_keys_helper.rb
@@ -1,2 +1,5 @@
 module AuthorizedKeysHelper
+  def index_pane_list
+    %w(recent help)
+  end
 end
diff --git a/apps/workbench/app/helpers/repositories_helper.rb b/apps/workbench/app/helpers/repositories_helper.rb
index 2860b5a..c8d1590 100644
--- a/apps/workbench/app/helpers/repositories_helper.rb
+++ b/apps/workbench/app/helpers/repositories_helper.rb
@@ -1,2 +1,5 @@
 module RepositoriesHelper
+  def index_pane_list
+    %w(recent help)
+  end
 end
diff --git a/apps/workbench/app/helpers/virtual_machines_helper.rb b/apps/workbench/app/helpers/virtual_machines_helper.rb
index cbb398d..69a3e21 100644
--- a/apps/workbench/app/helpers/virtual_machines_helper.rb
+++ b/apps/workbench/app/helpers/virtual_machines_helper.rb
@@ -1,2 +1,5 @@
 module VirtualMachinesHelper
+  def index_pane_list
+    %w(recent help)
+  end
 end
diff --git a/apps/workbench/app/models/collection.rb b/apps/workbench/app/models/collection.rb
index 94a2b95..cdd148c 100644
--- a/apps/workbench/app/models/collection.rb
+++ b/apps/workbench/app/models/collection.rb
@@ -13,6 +13,10 @@ class Collection < ArvadosBase
     false
   end
 
+  def self.creatable?
+    false
+  end
+
   def provenance
     $arvados_api_client.api "collections/#{self.uuid}/", "provenance"
   end
diff --git a/apps/workbench/app/views/api_client_authorizations/index.html.erb b/apps/workbench/app/views/api_client_authorizations/_help.html.erb
similarity index 93%
rename from apps/workbench/app/views/api_client_authorizations/index.html.erb
rename to apps/workbench/app/views/api_client_authorizations/_help.html.erb
index 03f4ea0..1481721 100644
--- a/apps/workbench/app/views/api_client_authorizations/index.html.erb
+++ b/apps/workbench/app/views/api_client_authorizations/_help.html.erb
@@ -12,5 +12,3 @@ export ARVADOS_API_HOST_INSECURE=true
 unset ARVADOS_API_HOST_INSECURE
 <% end %>
 </pre>
-
-<%= render partial: 'index' %>
diff --git a/apps/workbench/app/views/application/_index.html.erb b/apps/workbench/app/views/application/_recent.html.erb
similarity index 90%
rename from apps/workbench/app/views/application/_index.html.erb
rename to apps/workbench/app/views/application/_recent.html.erb
index 64b94c8..6ea3818 100644
--- a/apps/workbench/app/views/application/_index.html.erb
+++ b/apps/workbench/app/views/application/_recent.html.erb
@@ -1,9 +1,3 @@
-<% 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">
@@ -65,4 +59,3 @@
 </table>
 
 <% end %>
-
diff --git a/apps/workbench/app/views/application/index.html.erb b/apps/workbench/app/views/application/index.html.erb
index 6256b28..99cf64f 100644
--- a/apps/workbench/app/views/application/index.html.erb
+++ b/apps/workbench/app/views/application/index.html.erb
@@ -1 +1,26 @@
-<%= render partial: 'index' %>
+<% 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 %>
+<%= form_tag({action: 'compare', controller: params[:controller], method: 'get'}, {method: 'get', id: 'compare', class: 'pull-right small-form-margin'}) do |f| %>
+<%= submit_tag 'Compare selected', {class: 'btn btn-primary', disabled: true, style: 'display: none'} %>
+ 
+<% end rescue nil %>
+
+<% pane_list = (controller.class.to_s.sub(/Controller$/,'')+'Helper').constantize.index_pane_list rescue %w(recent) %>
+
+<div class="tabbable">
+<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"><%= pane.capitalize %></a></li>
+  <% end %>
+</ul>
+
+<div class="tab-content">
+  <% pane_list.each_with_index do |pane, i| %>
+  <div id="<%= pane %>" class="tab-pane fade in <%= 'active' if i==0 %>">
+    <%= render partial: pane %>
+  </div>
+  <% end %>
+</div>
diff --git a/apps/workbench/app/views/authorized_keys/_help.html.erb b/apps/workbench/app/views/authorized_keys/_help.html.erb
new file mode 100644
index 0000000..db4d4dc
--- /dev/null
+++ b/apps/workbench/app/views/authorized_keys/_help.html.erb
@@ -0,0 +1,10 @@
+<p>
+  More information about how to log in to VMs:
+</p>
+<ul>
+  <li>
+    <%= link_to raw('Arvados Docs → User Guide → SSH access'),
+        "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access.html",
+        target: "_blank"%>.
+  </li>
+</ul>
diff --git a/apps/workbench/app/views/authorized_keys/index.html.erb b/apps/workbench/app/views/authorized_keys/index.html.erb
index 4332977..37e8fce 100644
--- a/apps/workbench/app/views/authorized_keys/index.html.erb
+++ b/apps/workbench/app/views/authorized_keys/index.html.erb
@@ -1,10 +1 @@
-<%= render partial: 'application/index' %>
-
-<hr />
-
-<p>
-  See also:
-  <%= link_to raw('Arvados Docs → User Guide → SSH access'),
-  "#{Rails.configuration.arvados_docsite}/user/getting_started/ssh-access.html",
-  target: "_blank"%>.
-</p>
+<%= render template: 'application/index' %>
diff --git a/apps/workbench/app/views/collections/_nav.html.erb b/apps/workbench/app/views/collections/_nav.html.erb
deleted file mode 100644
index 678d8eb..0000000
--- a/apps/workbench/app/views/collections/_nav.html.erb
+++ /dev/null
@@ -1,8 +0,0 @@
-<ul class="nav nav-pills">
-  <% [['Table', collections_path],
-     ['Graph', collections_graph_path],
-     ['Inspect', @object ? collection_path(@object.uuid) : '#']].
-     each do |name, path| %>
-  <li class="<%= 'active' if request.fullpath == path %> <%= 'disabled' if path == '#' %>"><%= link_to name, path %></li>
-  <% end %>
-</ul>
diff --git a/apps/workbench/app/views/collections/index.html.erb b/apps/workbench/app/views/collections/_recent.html.erb
similarity index 96%
rename from apps/workbench/app/views/collections/index.html.erb
rename to apps/workbench/app/views/collections/_recent.html.erb
index 7a83418..4f383f3 100644
--- a/apps/workbench/app/views/collections/index.html.erb
+++ b/apps/workbench/app/views/collections/_recent.html.erb
@@ -1,5 +1,3 @@
-<%#= render :partial => 'nav' %>
-
 <div class="pull-right">
   <%= form_tag collections_path, method: 'get', remote: true, class: 'form-search' do %>
   <div class="input-append">
diff --git a/apps/workbench/app/views/collections/show.html.erb b/apps/workbench/app/views/collections/show.html.erb
index 120af6f..f1943c3 100644
--- a/apps/workbench/app/views/collections/show.html.erb
+++ b/apps/workbench/app/views/collections/show.html.erb
@@ -14,8 +14,6 @@
 
 <% end %>
 
-<%#= render :partial => 'nav' %>
-
 <div class="tabbable">
 <ul class="nav nav-tabs">
   <li class="active"><a href="#files" data-toggle="tab">Files (<%= @object.files ? @object.files.size : 0 %>)</a></li>
diff --git a/apps/workbench/app/views/jobs/index.html.erb b/apps/workbench/app/views/jobs/_recent.html.erb
similarity index 100%
rename from apps/workbench/app/views/jobs/index.html.erb
rename to apps/workbench/app/views/jobs/_recent.html.erb
diff --git a/apps/workbench/app/views/layouts/application.html.erb b/apps/workbench/app/views/layouts/application.html.erb
index afa03ba..4b5ce20 100644
--- a/apps/workbench/app/views/layouts/application.html.erb
+++ b/apps/workbench/app/views/layouts/application.html.erb
@@ -22,7 +22,7 @@
   <%= yield :js %>
   <% end %>
   <style>
-    .container  {
+    body > div.container-fluid {
     padding-top: 60px; /* 60px to make the container go all the way to the
     bottom of the topbar */
     }
@@ -95,7 +95,7 @@
     </div>
   </div>
 
-  <div class="container">
+  <div class="container-fluid">
 
     <div class="body-content">
       <%= yield %>
diff --git a/apps/workbench/app/views/links/index.html.erb b/apps/workbench/app/views/links/_recent.html.erb
similarity index 100%
rename from apps/workbench/app/views/links/index.html.erb
rename to apps/workbench/app/views/links/_recent.html.erb
diff --git a/apps/workbench/app/views/pipeline_instances/index.html.erb b/apps/workbench/app/views/pipeline_instances/_recent.html.erb
similarity index 84%
rename from apps/workbench/app/views/pipeline_instances/index.html.erb
rename to apps/workbench/app/views/pipeline_instances/_recent.html.erb
index ad941da..481d276 100644
--- a/apps/workbench/app/views/pipeline_instances/index.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_recent.html.erb
@@ -1,10 +1,9 @@
-<%= form_tag({action: 'compare', controller: 'pipeline_instances', method: 'get'}, {method: 'get', id: 'compare'}) do |f| %>
+<%= form_tag do |f| %>
 
 <table class="table table-hover">
   <thead>
     <tr class="contain-align-left">
       <th>
-	<%= submit_tag 'Compare', {class: 'btn btn-primary', disabled: true} %>
       </th><th>
 	status
       </th><th>
@@ -76,13 +75,17 @@
 <% end %>
 
 <% content_for :footer_js do %>
-$('form#compare input[name="uuids[]"]').on('click', function() {
-    var form = $('form#compare')[0]
+var showhide_compare = function() {
+    var form = $('form#compare')[0];
+    $('input[type=hidden][name="uuids[]"]', form).remove();
     $('input[type=submit]', form).prop('disabled',true);
-    $('input[name="uuids[]"]', form).each(function(){
+    $('input[name="uuids[]"]').each(function(){
         if(this.checked) {
-            $('input[type=submit]', form).prop('disabled',false);
+            $('input[type=submit]', form).prop('disabled',false).show();
+            $(form).append($('<input type="hidden" name="uuids[]"/>').val(this.value));
         }
     });
-});
+};
+$('form input[name="uuids[]"]').on('click', showhide_compare);
+showhide_compare();
 <% end %>
diff --git a/apps/workbench/app/views/pipeline_instances/compare.html.erb b/apps/workbench/app/views/pipeline_instances/compare.html.erb
index 08128a1..8739c8d 100644
--- a/apps/workbench/app/views/pipeline_instances/compare.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/compare.html.erb
@@ -11,7 +11,7 @@
 }
 <% end %>
 
-<% pi_span = [(10.0/(@objects.count)).floor,1].max %>
+<% pi_span = [(10.0/[@objects.count,1].max).floor,1].max %>
 <div>
 <% [['Instance', :uuid], ['Template', :pipeline_template_uuid]].each do |label, attr| %>
 <div class="row headrow">
diff --git a/apps/workbench/app/views/pipeline_templates/index.html.erb b/apps/workbench/app/views/pipeline_templates/_recent.html.erb
similarity index 100%
rename from apps/workbench/app/views/pipeline_templates/index.html.erb
rename to apps/workbench/app/views/pipeline_templates/_recent.html.erb
diff --git a/apps/workbench/app/views/repositories/index.html.erb b/apps/workbench/app/views/repositories/_help.html.erb
similarity index 94%
rename from apps/workbench/app/views/repositories/index.html.erb
rename to apps/workbench/app/views/repositories/_help.html.erb
index 564738d..2830da5 100644
--- a/apps/workbench/app/views/repositories/index.html.erb
+++ b/apps/workbench/app/views/repositories/_help.html.erb
@@ -1,5 +1,3 @@
-<%= render partial: 'application/index' %>
-
 <% if (example = @objects.select(&:push_url).first) %>
 
 <p>
diff --git a/apps/workbench/app/views/virtual_machines/index.html.erb b/apps/workbench/app/views/virtual_machines/_help.html.erb
similarity index 92%
rename from apps/workbench/app/views/virtual_machines/index.html.erb
rename to apps/workbench/app/views/virtual_machines/_help.html.erb
index 63a9f7c..abf76b0 100644
--- a/apps/workbench/app/views/virtual_machines/index.html.erb
+++ b/apps/workbench/app/views/virtual_machines/_help.html.erb
@@ -1,7 +1,3 @@
-<%= render partial: 'application/index' %>
-
-<hr />
-
 <p>
 Sample <code>~/.ssh/config</code> section:
 </p>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list