[ARVADOS] updated: 55777101504449fd7784511f304870c3706bed60
git at public.curoverse.com
git at public.curoverse.com
Wed Jan 15 13:53:15 EST 2014
Summary of changes:
.../app/controllers/user_agreements_controller.rb | 2 +-
.../app/views/user_agreements/index.html.erb | 67 ++++++++------------
.../config/environments/development.rb.example | 2 +
.../config/environments/production.rb.example | 2 +
apps/workbench/config/environments/test.rb.example | 2 +
5 files changed, 34 insertions(+), 41 deletions(-)
via 55777101504449fd7784511f304870c3706bed60 (commit)
via a19ca95f031bf285cbb4db6d8d8bd1c216e3cfe3 (commit)
from c3c2786ca6301e2617ae922562e11e71aca968fd (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 55777101504449fd7784511f304870c3706bed60
Author: Tom Clegg <tom at curoverse.com>
Date: Wed Jan 15 10:52:21 2014 -0800
Do not show user agreement inline unless site config says so. Remove
superfluous dialog box presentation, and use agreement filename as
page title if there is only one.
refs #1694
diff --git a/apps/workbench/app/views/user_agreements/index.html.erb b/apps/workbench/app/views/user_agreements/index.html.erb
index 53a37a2..ed758af 100644
--- a/apps/workbench/app/views/user_agreements/index.html.erb
+++ b/apps/workbench/app/views/user_agreements/index.html.erb
@@ -1,55 +1,42 @@
-<h1>User agreements</h1>
-
-<p>You must read and sign all applicable user agreements before continuing.</p>
-
-<button data-toggle="modal" href="#open_user_agreement" class="btn btn-primary">Show details</button>
-
<% n_files = @required_user_agreements.collect(&:files).flatten(1).count %>
-
+<% content_for :page_title do %>
<% if n_files == 1 %>
-<% content_for :css do %>
-#open_user_agreement { width: 900px; margin-left: -450px; }
-#open_user_agreement .modal-body { max-height: 900px; }
+<%= @required_user_agreements.first.files.first[1].sub(/\.[a-z]{3,4}$/,'') %>
+<% else %>
+User agreements
<% end %>
<% end %>
-<div id="open_user_agreement" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="uaModalLabel" aria-hidden="true" data-show="true">
- <%= form_for(@required_user_agreements.first, {url: {action: 'sign', controller: 'user_agreements'}}) do |f| %>
- <%= hidden_field_tag :return_to, request.url %>
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
- <h3 id="uaModalLabel">User agreement<%= 's' if n_files != 1 %></h3>
+<%= form_for(@required_user_agreements.first, {url: {action: 'sign', controller: 'user_agreements'}}) do |f| %>
+<%= hidden_field_tag :return_to, request.url %>
+<div id="open_user_agreement">
+ <div class="alert alert-info">
+ <strong>Please check <%= n_files > 1 ? 'each' : 'the' %> box below</strong> to indicate that you have read and accepted the user agreement<%= 's' if n_files > 1 %>.
</div>
- <div class="modal-body">
- <% if n_files == 1 %>
- <% ua = @required_user_agreements.first; file = ua.files.first %>
- <object data="<%= url_for(controller: 'collections', action: 'show_file', uuid: ua.uuid, file: "#{file[0]}/#{file[1]}") %>" type="<%= Rack::Mime::MIME_TYPES[file[1].match(/\.\w+$/)[0]] rescue '' %>" width="100%" height="400px">
- </object>
+ <% if n_files == 1 and (Rails.configuration.show_user_agreement_inline rescue false) %>
+ <% ua = @required_user_agreements.first; file = ua.files.first %>
+ <object data="<%= url_for(controller: 'collections', action: 'show_file', uuid: ua.uuid, file: "#{file[0]}/#{file[1]}") %>" type="<%= Rack::Mime::MIME_TYPES[file[1].match(/\.\w+$/)[0]] rescue '' %>" width="100%" height="400px">
+ </object>
+ <% end %>
+ <div>
+ <% @required_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 %>
+ <% end %>
<% end %>
- <div class="alert alert-info">
- <strong>Please check <%= n_files > 1 ? 'each' : 'the' %> box</strong> to indicate that you have read and accepted the agreement.
- </div>
- <div style="margin-left: 4em">
- <% @required_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 %>
- <%= link_to 'open', {controller: 'collections', action: 'show_file', uuid: ua.uuid, file: "#{file[0]}/#{file[1]}"}, {target: '_blank', class: 'label label-info'} %>
- <%= file[1] %>
- <% end %>
- <% end %>
- <% end %>
- </div>
</div>
- <div class="modal-footer">
- <button class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
- <%= f.submit 'Accept', {class: 'btn btn-primary', disabled: true} %>
+ <div style="height: 1em"></div>
+ <div>
+ <%= f.submit 'Continue', {class: 'btn btn-primary', disabled: true} %>
</div>
- <% end %>
</div>
+<% end %>
<% content_for :footer_js do %>
-$('#open_user_agreement').modal();
$('#open_user_agreement input[name="checked[]"]').on('click', function() {
var dialog = $('#open_user_agreement')[0]
$('input[type=submit]', dialog).prop('disabled',false);
diff --git a/apps/workbench/config/environments/development.rb.example b/apps/workbench/config/environments/development.rb.example
index 119089e..ba3dbbe 100644
--- a/apps/workbench/config/environments/development.rb.example
+++ b/apps/workbench/config/environments/development.rb.example
@@ -53,4 +53,6 @@ ArvadosWorkbench::Application.configure do
config.arvados_docsite = 'http://doc.arvados.org'
config.arvados_theme = 'default'
+
+ config.show_user_agreement_inline = false
end
diff --git a/apps/workbench/config/environments/production.rb.example b/apps/workbench/config/environments/production.rb.example
index 5c8f2ba..2b4a39f 100644
--- a/apps/workbench/config/environments/production.rb.example
+++ b/apps/workbench/config/environments/production.rb.example
@@ -85,4 +85,6 @@ ArvadosWorkbench::Application.configure do
config.arvados_docsite = 'http://doc.arvados.org'
config.arvados_theme = 'default'
+
+ config.show_user_agreement_inline = false
end
diff --git a/apps/workbench/config/environments/test.rb.example b/apps/workbench/config/environments/test.rb.example
index 7122c2b..c4a5d22 100644
--- a/apps/workbench/config/environments/test.rb.example
+++ b/apps/workbench/config/environments/test.rb.example
@@ -55,4 +55,6 @@ ArvadosWorkbench::Application.configure do
config.arvados_docsite = 'http://doc.arvados.org'
config.arvados_theme = 'default'
+
+ config.show_user_agreement_inline = false
end
commit a19ca95f031bf285cbb4db6d8d8bd1c216e3cfe3
Author: Tom Clegg <tom at curoverse.com>
Date: Wed Jan 15 10:47:07 2014 -0800
Fix user_agreements.sign when collection uuid has +size hint.
refs #1694
diff --git a/apps/workbench/app/controllers/user_agreements_controller.rb b/apps/workbench/app/controllers/user_agreements_controller.rb
index cc0d3c8..6ab8ae2 100644
--- a/apps/workbench/app/controllers/user_agreements_controller.rb
+++ b/apps/workbench/app/controllers/user_agreements_controller.rb
@@ -8,7 +8,7 @@ class UserAgreementsController < ApplicationController
def sign
params[:checked].each do |checked|
- if r = checked.match(/^([0-9a-f]+)/)
+ if r = checked.match(/^([0-9a-f]+[^\/]*)/)
UserAgreement.sign uuid: r[1]
end
end
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list