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