- <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]] || 'application/pdf' %>" 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 %>