[ARVADOS] updated: cbbfc43117251de9ea8eb858b02b50809b488717

git at public.curoverse.com git at public.curoverse.com
Wed Feb 12 14:51:11 EST 2014


Summary of changes:
 .../views/pipeline_instances/_show_recent.html.erb |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

       via  cbbfc43117251de9ea8eb858b02b50809b488717 (commit)
      from  6acfb92f4e97007dd1b224ff8e74c104f250ddb8 (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 cbbfc43117251de9ea8eb858b02b50809b488717
Author: Tom Clegg <tom at curoverse.com>
Date:   Wed Feb 12 11:51:00 2014 -0800

    Limit "compare" selection mechanism to 2 or 3 pipelines. Closes #2101

diff --git a/apps/workbench/app/views/pipeline_instances/_show_recent.html.erb b/apps/workbench/app/views/pipeline_instances/_show_recent.html.erb
index 4bae11c..bfb3dc8 100644
--- a/apps/workbench/app/views/pipeline_instances/_show_recent.html.erb
+++ b/apps/workbench/app/views/pipeline_instances/_show_recent.html.erb
@@ -1,6 +1,6 @@
 <%= content_for :tab_line_buttons do %>
 <%= 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'} %>
+  <%= submit_tag 'Compare 2 or 3 selected', {class: 'btn btn-primary', disabled: true, style: 'display: none'} %>
    
 <% end rescue nil %>
 <% end %>
@@ -85,13 +85,16 @@
 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[]"]').each(function(){
-        if(this.checked) {
-            $('input[type=submit]', form).prop('disabled',false).show();
-            $(form).append($('<input type="hidden" name="uuids[]"/>').val(this.value));
-        }
-    });
+    $('input[type=submit]', form).prop('disabled',true).show();
+    var checked_inputs = $('input[name="uuids[]"]:checked');
+    if (checked_inputs.length >= 2 && checked_inputs.length <= 3) {
+        checked_inputs.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();

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list