8784: Fix test for latest firefox.
[arvados.git] / apps / workbench / app / views / user_agreements / index.html.erb
1 <% content_for :breadcrumbs do raw '<!-- -->' end %>
2
3 <% n_files = unsigned_user_agreements.collect(&:files).flatten(1).count %>
4 <% content_for :page_title do %>
5 <% if n_files == 1 %>
6 <%= unsigned_user_agreements.first.files.first[1].sub(/\.[a-z]{3,4}$/,'') %>
7 <% else %>
8 User agreements
9 <% end %>
10 <% end %>
11
12 <%= form_for(unsigned_user_agreements.first, {url: {action: 'sign', controller: 'user_agreements'}, method: :post}) do |f| %>
13 <%= hidden_field_tag :return_to, request.url %>
14 <div id="open_user_agreement">
15   <div class="alert alert-info">
16     <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 %>.
17   </div>
18   <% if n_files == 1 and (Rails.configuration.show_user_agreement_inline rescue false) %>
19   <% ua = unsigned_user_agreements.first; file = ua.files.first %>
20   <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">
21   </object>
22   <% end %>
23   <div>
24     <% unsigned_user_agreements.each do |ua| %>
25     <% ua.files.each do |file| %>
26     <div class="checkbox">
27       <%= f.label 'checked[]' do %>
28       <%= check_box_tag 'checked[]', "#{ua.uuid}/#{file[0]}/#{file[1]}", false %>
29       Accept <%= file[1].sub(/\.[a-z]{3,4}$/,'') %>
30       <%= 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'} %>
31       <% end %>
32     </div>
33     <% end %>
34     <% end %>
35   </div>
36   <div style="height: 1em"></div>
37   <div>
38     <%= f.submit 'Continue', {class: 'btn btn-primary'} %>
39   </div>
40 </div>
41 <% end %>