mirror of https://github.com/docusealco/docuseal
				
				
				
			
							parent
							
								
									ccc06fcc3d
								
							
						
					
					
						commit
						6156623f0e
					
				| @ -1,101 +1,80 @@ | |||||||
| <% if Docuseal.demo? %><%= render 'shared/demo_alert' %><% end %> | <% if Docuseal.demo? %><%= render 'shared/demo_alert' %><% end %> | ||||||
| <% if @pagy.count > 0 || params[:q].present? || @template_folders.present? %> | <div class="flex justify-between mb-4 items-center"> | ||||||
|   <div class="flex justify-between mb-4 items-center"> |   <h1 class="text-4xl font-bold"><span class="hidden md:inline">Document</span> Templates</h1> | ||||||
|     <h1 class="text-4xl font-bold"><span class="hidden md:inline">Document</span> Templates</h1> |   <div class="flex space-x-2"> | ||||||
|     <div class="flex space-x-2"> |     <% if params[:q].present? || @pagy.pages > 1 || @template_folders.present? %> | ||||||
|       <% if params[:q].present? || @pagy.pages > 1 || @template_folders.present? %> |       <%= render 'shared/search_input' %> | ||||||
|         <%= render 'shared/search_input' %> |     <% end %> | ||||||
|       <% end %> |     <% if can?(:create, ::Template) %> | ||||||
|       <% if can?(:create, ::Template) %> |       <%= render 'templates/upload_button' %> | ||||||
|         <%= render 'templates/upload_button' %> |       <%= link_to new_template_path, class: 'white-button !border gap-2', data: { turbo_frame: :modal } do %> | ||||||
|         <%= link_to new_template_path, class: 'white-button !border gap-2', data: { turbo_frame: :modal } do %> |         <%= svg_icon('plus', class: 'w-6 h-6 stroke-2') %> | ||||||
|           <%= svg_icon('plus', class: 'w-6 h-6 stroke-2') %> |         <span class="hidden md:block">Create</span> | ||||||
|           <span class="hidden md:block">Create</span> |  | ||||||
|         <% end %> |  | ||||||
|       <% end %> |       <% end %> | ||||||
|     </div> |  | ||||||
|   </div> |  | ||||||
|   <% view_archived_html = capture do %> |  | ||||||
|     <% if current_account.templates.where.not(archived_at: nil).exists? %> |  | ||||||
|       <div> |  | ||||||
|         <a href="<%= templates_archived_index_path %>" class="link text-sm">View Archived</a> |  | ||||||
|       </div> |  | ||||||
|     <% end %> |     <% end %> | ||||||
|   <% end %> |   </div> | ||||||
|   <% if @template_folders.present? %> | </div> | ||||||
|     <div class="grid gap-4 md:grid-cols-3 <%= 'mb-6' if @templates.present? %>"> | <% view_archived_html = capture do %> | ||||||
|       <%= render partial: 'template_folders/folder', collection: @template_folders, as: :folder %> |   <% if current_account.templates.where.not(archived_at: nil).exists? %> | ||||||
|     </div> |     <div> | ||||||
|   <% end %> |       <a href="<%= templates_archived_index_path %>" class="link text-sm">View Archived</a> | ||||||
|   <% if @templates.present? %> |  | ||||||
|     <div class="grid gap-4 md:grid-cols-3"> |  | ||||||
|       <%= render partial: 'templates/template', collection: @templates %> |  | ||||||
|     </div> |     </div> | ||||||
|   <% end %> |   <% end %> | ||||||
|   <% if params[:q].blank? && @pagy.pages == 1 && ((@template_folders.size < 10 && @templates.size.zero?) || (@template_folders.size < 7 && @templates.size < 4) || (@template_folders.size < 4 && @templates.size < 7)) %> | <% end %> | ||||||
|     <%= form_for '', url: templates_upload_path, id: form_id = SecureRandom.uuid, method: :post, class: 'mt-8 block', html: { enctype: 'multipart/form-data' } do %> | <% if @template_folders.present? %> | ||||||
|       <input type="hidden" name="form_id" value="<%= form_id %>"> |   <div class="grid gap-4 md:grid-cols-3 <%= 'mb-6' if @templates.present? %>"> | ||||||
|       <button type="submit" class="hidden"></button> |     <%= render partial: 'template_folders/folder', collection: @template_folders, as: :folder %> | ||||||
|       <file-dropzone data-submit-on-upload="true" class="w-full"> |   </div> | ||||||
|         <label for="file_dropzone_input" class="w-full block h-52 relative hover:bg-base-200/30 rounded-xl border border-2 border-base-300 border-dashed"> | <% end %> | ||||||
|           <div class="absolute top-0 right-0 left-0 bottom-0 flex items-center justify-center"> | <% if @templates.present? %> | ||||||
|             <div class="flex flex-col items-center"> |   <div class="grid gap-4 md:grid-cols-3"> | ||||||
|               <span data-target="file-dropzone.icon" class="flex flex-col items-center"> |     <%= render partial: 'templates/template', collection: @templates %> | ||||||
|                 <span> |   </div> | ||||||
|                   <%= svg_icon('cloud_upload', class: 'w-10 h-10') %> | <% end %> | ||||||
|                 </span> | <% if params[:q].blank? && @pagy.pages == 1 && ((@template_folders.size < 10 && @templates.size.zero?) || (@template_folders.size < 7 && @templates.size < 4) || (@template_folders.size < 4 && @templates.size < 7)) %> | ||||||
|                 <div class="font-medium mb-1"> |   <%= form_for '', url: templates_upload_path, id: form_id = SecureRandom.uuid, method: :post, class: 'mt-8 block', html: { enctype: 'multipart/form-data' } do %> | ||||||
|                   Upload New Document |     <input type="hidden" name="form_id" value="<%= form_id %>"> | ||||||
|                 </div> |     <button type="submit" class="hidden"></button> | ||||||
|                 <div class="text-xs"> |     <file-dropzone data-submit-on-upload="true" class="w-full"> | ||||||
|                   <span class="font-medium">Click to upload</span> or drag and drop |       <label for="file_dropzone_input" class="w-full block h-52 relative hover:bg-base-200/30 rounded-xl border border-2 border-base-300 border-dashed"> | ||||||
|                 </div> |         <div class="absolute top-0 right-0 left-0 bottom-0 flex items-center justify-center"> | ||||||
|               </span> |           <div class="flex flex-col items-center"> | ||||||
|               <span data-target="file-dropzone.loading" class="flex flex-col items-center hidden"> |             <span data-target="file-dropzone.icon" class="flex flex-col items-center"> | ||||||
|                 <%= svg_icon('loader', class: 'w-10 h-10 animate-spin') %> |               <span> | ||||||
|                 <div class="font-medium mb-1"> |                 <%= svg_icon('cloud_upload', class: 'w-10 h-10') %> | ||||||
|                   Uploading... |  | ||||||
|                 </div> |  | ||||||
|               </span> |               </span> | ||||||
|             </div> |               <div class="font-medium mb-1"> | ||||||
|             <input id="file_dropzone_input" name="files[]" class="hidden" data-action="change:file-dropzone#onSelectFiles" data-target="file-dropzone.input" type="file" accept="image/*, application/pdf<%= ', .docx, .doc, .xlsx, .xls' if Docuseal.multitenant? %>" multiple> |                 Upload New Document | ||||||
|  |               </div> | ||||||
|  |               <div class="text-xs"> | ||||||
|  |                 <span class="font-medium">Click to upload</span> or drag and drop | ||||||
|  |               </div> | ||||||
|  |             </span> | ||||||
|  |             <span data-target="file-dropzone.loading" class="flex flex-col items-center hidden"> | ||||||
|  |               <%= svg_icon('loader', class: 'w-10 h-10 animate-spin') %> | ||||||
|  |               <div class="font-medium mb-1"> | ||||||
|  |                 Uploading... | ||||||
|  |               </div> | ||||||
|  |             </span> | ||||||
|           </div> |           </div> | ||||||
|         </label> |           <input id="file_dropzone_input" name="files[]" class="hidden" data-action="change:file-dropzone#onSelectFiles" data-target="file-dropzone.input" type="file" accept="image/*, application/pdf<%= ', .docx, .doc, .xlsx, .xls' if Docuseal.multitenant? %>" multiple> | ||||||
|       </file-dropzone> |         </div> | ||||||
|     <% end %> |       </label> | ||||||
|  |     </file-dropzone> | ||||||
|   <% end %> |   <% end %> | ||||||
|   <% if @templates.present? || params[:q].blank? %> | <% end %> | ||||||
|     <% if @pagy.pages > 1 %> | <% if @templates.present? || params[:q].blank? %> | ||||||
|       <%= render 'shared/pagination', pagy: @pagy, items_name: 'templates', left_additional_html: view_archived_html %> |   <% if @pagy.pages > 1 %> | ||||||
|     <% else %> |     <%= render 'shared/pagination', pagy: @pagy, items_name: 'templates', left_additional_html: view_archived_html %> | ||||||
|       <div class="mt-2"> |   <% else %> | ||||||
|         <%= view_archived_html %> |     <div class="mt-2"> | ||||||
|       </div> |       <%= view_archived_html %> | ||||||
|     <% end %> |  | ||||||
|   <% elsif params[:q].present? %> |  | ||||||
|     <div class="text-center"> |  | ||||||
|       <div class="mt-16 text-3xl font-semibold"> |  | ||||||
|         Templates not Found |  | ||||||
|       </div> |  | ||||||
|     </div> |     </div> | ||||||
|   <% end %> |   <% end %> | ||||||
| <% else %> | <% elsif params[:q].present? %> | ||||||
|   <div class="card bg-base-200 h-96 mb-2"> |   <div class="text-center"> | ||||||
|     <div class="card-body text-center"> |     <div class="mt-16 text-3xl font-semibold"> | ||||||
|       <div class="flex items-center h-full"> |       Templates not Found | ||||||
|         <div class="mx-auto"> |  | ||||||
|           <div class="max-w-xl mx-auto"> |  | ||||||
|             <h1 class="text-5xl font-bold text-base-content">👋 Welcome to <%= Docuseal.product_name %></h1> |  | ||||||
|           </div> |  | ||||||
|           <div class="max-w-lg mx-auto"> |  | ||||||
|             <p class="py-6 text-gray-600">Streamline document workflows, from creating customizable templates to filling and signing document forms</p> |  | ||||||
|             <%= link_to new_template_path, class: 'base-button', data: { turbo_frame: :modal } do %> |  | ||||||
|               <%= svg_icon('plus', class: 'w-6 h-6 stroke-2') %> |  | ||||||
|               <span class="mr-1">Create Template</span> |  | ||||||
|             <% end %> |  | ||||||
|           </div> |  | ||||||
|         </div> |  | ||||||
|       </div> |  | ||||||
|     </div> |     </div> | ||||||
|   </div> |   </div> | ||||||
| <% end %> | <% end %> | ||||||
|  | |||||||
					Loading…
					
					
				
		Reference in new issue