[ARVADOS] updated: 3c0133882412d8dca41ccd016eedb477d6df3430

git at public.curoverse.com git at public.curoverse.com
Sun Aug 24 14:35:42 EDT 2014


Summary of changes:
 apps/workbench/app/assets/javascripts/user_agreements.js | 16 +++++++---------
 apps/workbench/app/views/user_agreements/index.html.erb  | 14 ++++++++------
 2 files changed, 15 insertions(+), 15 deletions(-)

       via  3c0133882412d8dca41ccd016eedb477d6df3430 (commit)
      from  d68db5e4755eb38482f251fec92fa975feae667d (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 3c0133882412d8dca41ccd016eedb477d6df3430
Author: Tom Clegg <tom at curoverse.com>
Date:   Sun Aug 24 14:35:02 2014 -0400

    Fix disabled Continue button on user agreements page. No issue #

diff --git a/apps/workbench/app/assets/javascripts/user_agreements.js b/apps/workbench/app/assets/javascripts/user_agreements.js
index 688bd0b..1b9ce4b 100644
--- a/apps/workbench/app/assets/javascripts/user_agreements.js
+++ b/apps/workbench/app/assets/javascripts/user_agreements.js
@@ -1,9 +1,7 @@
-$('#open_user_agreement input[name="checked[]"]').on('click', function() {
-    var dialog = $('#open_user_agreement')[0]
-    $('input[type=submit]', dialog).prop('disabled',false);
-    $('input[name="checked[]"]', dialog).each(function(){
-        if(!this.checked) {
-            $('input[type=submit]', dialog).prop('disabled',true);
-        }
-    });
-});
+function enable_okbutton() {
+    var $div = $('#open_user_agreement');
+    var allchecked = $('input[name="checked[]"]', $div).not(':checked').length == 0;
+    $('input[type=submit]', $div).prop('disabled', !allchecked);
+}
+$(document).on('click keyup input', '#open_user_agreement input', enable_okbutton);
+$(document).on('ready ajax:complete', enable_okbutton);
diff --git a/apps/workbench/app/views/user_agreements/index.html.erb b/apps/workbench/app/views/user_agreements/index.html.erb
index d373601..d73ccff 100644
--- a/apps/workbench/app/views/user_agreements/index.html.erb
+++ b/apps/workbench/app/views/user_agreements/index.html.erb
@@ -23,17 +23,19 @@ User agreements
   <div>
     <% unsigned_user_agreements.each do |ua| %>
     <% ua.files.each do |file| %>
-    <%= f.label 'checked[]', class: 'checkbox inline' do %>
-    <%= check_box_tag 'checked[]', "#{ua.uuid}/#{file[0]}/#{file[1]}", false %>
-    Accept <%= file[1].sub(/\.[a-z]{3,4}$/,'') %>
-    <%= link_to 'View agreement', {controller: 'collections', action: 'show_file', uuid: ua.uuid, file: "#{file[0]}/#{file[1]}"}, {target: '_blank', class: 'btn btn-mini btn-primary'} %>
-    <% end %>
+    <div class="checkbox">
+      <%= f.label 'checked[]' do %>
+      <%= check_box_tag 'checked[]', "#{ua.uuid}/#{file[0]}/#{file[1]}", false %>
+      Accept <%= file[1].sub(/\.[a-z]{3,4}$/,'') %>
+      <%= link_to 'View agreement', {controller: 'collections', action: 'show_file', uuid: ua.uuid, file: "#{file[0]}/#{file[1]}"}, {target: '_blank', class: 'btn btn-xs btn-info'} %>
+      <% end %>
+    </div>
     <% end %>
     <% end %>
   </div>
   <div style="height: 1em"></div>
   <div>
-    <%= f.submit 'Continue', {class: 'btn btn-primary', disabled: true} %>
+    <%= f.submit 'Continue', {class: 'btn btn-primary'} %>
   </div>
 </div>
 <% end %>

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list