[ARVADOS] updated: 1bdb21c0368faa53ec49a7706fba51dcf6416cfd

git at public.curoverse.com git at public.curoverse.com
Tue Feb 4 15:56:11 EST 2014


Summary of changes:
 .../app/assets/javascripts/application.js          |   23 +++++++++++++++-
 .../app/views/application/_index_table.html.erb    |   13 ++++++---
 .../workbench/app/views/application/index.html.erb |   28 ++++++++++++-------
 3 files changed, 49 insertions(+), 15 deletions(-)

       via  1bdb21c0368faa53ec49a7706fba51dcf6416cfd (commit)
      from  0638ff8a5693ec809362225b46b8f579f6edea30 (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 1bdb21c0368faa53ec49a7706fba51dcf6416cfd
Author: Tom Clegg <tom at curoverse.com>
Date:   Tue Feb 4 12:55:38 2014 -0800

    Make "select pipeline instances to compare" work again.
    
    refs #1979

diff --git a/apps/workbench/app/assets/javascripts/application.js b/apps/workbench/app/assets/javascripts/application.js
index f7f1b20..dbc6f86 100644
--- a/apps/workbench/app/assets/javascripts/application.js
+++ b/apps/workbench/app/assets/javascripts/application.js
@@ -54,7 +54,11 @@ jQuery(function($){
                 $(document).trigger('workbench:index:show');
             }
         }).
-        on('click', '.index-table tr[data-object-preview-href]', function() {
+        on('click', '.index-table tr[data-object-preview-href]', function(e) {
+            if (!(e.originalEvent.srcElement instanceof HTMLTableCellElement))
+                // We only want to intercept empty space here, not
+                // other clickable things.
+                return;
             $('.index-detail #index_detail.tab-pane').fadeTo(50, 0.01);
             $.ajax({
                 type: 'GET',
@@ -72,4 +76,21 @@ jQuery(function($){
             });
             $('.loading').show();
         });
+    var showhide_compare = function() {
+        var form = $('form#compare')[0];
+        if (!form) {
+            $('input[name="uuids[]"]').hide();
+            return;
+        }
+        $('input[type=hidden][name="uuids[]"]', form).remove();
+        $('input[type=submit]', form).prop('disabled',true);
+        $('input[name="uuids[]"]').each(function(){
+            if(this.checked) {
+                $('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();
 })(jQuery);
diff --git a/apps/workbench/app/views/application/_index_table.html.erb b/apps/workbench/app/views/application/_index_table.html.erb
index f63ac33..82277f3 100644
--- a/apps/workbench/app/views/application/_index_table.html.erb
+++ b/apps/workbench/app/views/application/_index_table.html.erb
@@ -1,18 +1,19 @@
+<%= form_tag do |f| %>
 <table class="table arv-index">
   <colgroup>
-    <col width="65%" />
+    <col width="3%" />
+    <col width="62%" />
     <col width="15%" />
     <col width="15%" />
     <col width="5%" />
   </colgroup>
   <thead>
     <tr>
+      <th><!-- a column for selecting checkboxes --></th>
       <th><%= controller.model_class.to_s.underscore.gsub '_', ' ' %></th>
       <th>modified</th>
       <th>owner</th>
-      <th>
-        <!-- a column for delete buttons -->
-      </th>
+      <th><!-- a column for delete buttons --></th>
     </tr>
   </thead>
       
@@ -20,6 +21,9 @@
     <% @objects.each do |object| %>
     <tr data-object-uuid="<%= object.uuid %>" data-object-preview-href="<%= url_for(controller: params[:controller], action: 'show', partial: 'preview', id: object.uuid) %>">
       <td>
+        <%= check_box_tag 'uuids[]', object.uuid, false %>
+      </td>
+      <td>
         <%= link_to(
             {action: 'show', id: object.uuid},
             method: :get, remote: true) do %>
@@ -50,3 +54,4 @@
     <% end %>
   </tfoot>
 </table>
+<% end %>
diff --git a/apps/workbench/app/views/application/index.html.erb b/apps/workbench/app/views/application/index.html.erb
index 943f64a..3dde5b7 100644
--- a/apps/workbench/app/views/application/index.html.erb
+++ b/apps/workbench/app/views/application/index.html.erb
@@ -4,19 +4,27 @@
 
 <div class="row-fluid">
 <div class="span12 index-table">
-  <% 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 %>
+  <div class="pull-right">
+    <div style="display:inline-block">
+      <%= form_tag({action: 'compare', controller: params[:controller], method: 'get'}, {method: 'get', id: 'compare', class: 'small-form-margin'}) do |f| %>
+      <%= submit_tag 'Compare selected', {class: 'btn btn-primary', disabled: true, style: 'display: none'} %>
+      <% end rescue nil %>
+    </div>
+    <% if controller.model_class.creatable? %>
+     
+    <div style="display:inline-block">
+      <%= button_to "Add a new #{controller.model_class.to_s.underscore.gsub '_', ' '}", 
+          { action: 'create', return_to: request.url }, 
+          { class: 'btn btn-primary' } %>
+    </div>
+    <% end %>
+  </div>
   <%= render partial: 'index_table' %>
 </div>
 <div class="span4 index-detail" style="display:none">
-  <% panes = Hash[%w(help).map { |pane| [pane, render(partial: 'index_' + pane)] rescue nil }.compact] %>
+  <% panes = Hash[%w(help).map { |pane|
+     [pane, render(partial: 'index_' + pane,
+                   locals: { comparable: comparable })] rescue nil }.compact] %>
   <div class="tabbable">
     <ul class="nav nav-tabs">
       <% panes.each_with_index do |(name, content), i| %>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list