mirror of https://github.com/docusealco/docuseal
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							34 lines
						
					
					
						
							2.1 KiB
						
					
					
				
			
		
		
	
	
							34 lines
						
					
					
						
							2.1 KiB
						
					
					
				| <% attachment_field_uuids = @submitter.submission.template.fields.select { |f| f['type'].in?(%w[image signature file]) }.pluck('uuid') %>
 | |
| <% values = @submitter.submission.submitters.reduce({}) { |acc, e| acc.merge(e.values) } %>
 | |
| <% attachments = ActiveStorage::Attachment.where(uuid: values.values_at(*attachment_field_uuids).flatten).preload(:blob) %>
 | |
| <div class="mx-auto block pb-72 select-none" style="max-width: 1000px">
 | |
|   <div class="mt-4 flex">
 | |
|     <a href="<%= root_path %>" class="mx-auto text-2xl md:text-3xl font-bold items-center flex space-x-3">
 | |
|       <%= render 'shared/logo', class: 'w-9 h-9 md:w-12 md:h-12' %>
 | |
|       <span>DocuSeal</span>
 | |
|     </a>
 | |
|   </div>
 | |
|   <% @submitter.submission.template.schema.each do |item| %>
 | |
|     <% document = @submitter.submission.template.documents.find { |a| a.uuid == item['attachment_uuid'] } %>
 | |
|     <% document.preview_images.sort_by { |a| a.filename.base.to_i }.each_with_index do |page, index| %>
 | |
|       <div class="relative my-4 shadow-md">
 | |
|         <img src="<%= page.url %>" width="<%= page.metadata['width'] %>" height="<%= page.metadata['height'] %>" loading="lazy">
 | |
|         <div id="page-<%= [document.uuid, index].join('-') %>" class="top-0 bottom-0 left-0 right-0 absolute"></div>
 | |
|       </div>
 | |
|     <% end %>
 | |
|   <% end %>
 | |
|   <div class="text-center px-2">
 | |
|     Powered by
 | |
|     <a href="https://www.docuseal.co" class="underline">DocuSeal</a> - open source documents software
 | |
|   </div>
 | |
| </div>
 | |
| <div class="fixed bottom-0 w-full h-0 z-20">
 | |
|   <div class="mx-auto" style="max-width: 1000px">
 | |
|     <div class="relative md:mx-32">
 | |
|       <div class="shadow-md bg-base-100 absolute bottom-0 md:bottom-4 w-full border border-base-200 p-4 rounded">
 | |
|         <submission-form data-submitter-uuid="<%= @submitter.uuid %>" data-submitter-slug="<%= @submitter.slug %>" data-attachments="<%= attachments.to_json(only: %i[uuid], methods: %i[url filename content_type]) %>" data-fields="<%= @submitter.submission.template.fields.to_json %>" data-values="<%= values.to_json %>" data-authenticity-token="<%= form_authenticity_token %>"></submission-form>
 | |
|       </div>
 | |
|     </div>
 | |
|   </div>
 | |
| </div>
 |