fix refactor dropzone
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<div class="absolute bottom-0 w-full cursor-pointer rounded-xl bg-base-100 border-2 border-base-300 border-dashed hidden z-50" data-target="dashboard-dropzone.fileDropzone" style="<%= local_assigns[:style] %>">
|
||||
<div class="absolute top-0 right-0 left-0 bottom-0 flex justify-center p-2 items-center pointer-events-none">
|
||||
<div class="flex flex-col items-center text-center" data-target="dashboard-dropzone.toggleLoading">
|
||||
<span class="flex flex-col items-center">
|
||||
<span>
|
||||
<%= svg_icon('cloud_upload', class: 'w-9 h-9') %>
|
||||
</span>
|
||||
<div class="font-medium mb-1">
|
||||
<%= t('upload_new_document') %>
|
||||
</div>
|
||||
</span>
|
||||
<span class="flex flex-col items-center hidden" data-target="dashboard-dropzone.fileDropzoneLoading">
|
||||
<%= svg_icon('loader', class: 'w-9 h-9 animate-spin') %>
|
||||
<div class="font-medium mb-1">
|
||||
<%= t('uploading') %>...
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,29 +0,0 @@
|
||||
<%= form_for '', url: local_assigns.fetch(:url, templates_upload_path), id: form_id = SecureRandom.uuid, method: :post, class: 'block hidden', html: { enctype: 'multipart/form-data' }, data: { target: 'dashboard-dropzone.fileDropzone' } do %>
|
||||
<input type="hidden" name="form_id" value="<%= form_id %>">
|
||||
<button type="submit" class="hidden"></button>
|
||||
<label for="dashboard_dropzone_input_<%= form_id %>">
|
||||
<div class="absolute top-0 right-0 left-0 bottom-0 flex justify-center p-2 items-<%= local_assigns.fetch(:position, 'center') %>">
|
||||
<div class="flex flex-col items-center text-center">
|
||||
<% if local_assigns[:icon] %>
|
||||
<span data-target="dashboard-dropzone.icon" class="flex flex-col items-center">
|
||||
<span>
|
||||
<%= svg_icon(local_assigns[:icon], class: 'w-10 h-10') %>
|
||||
</span>
|
||||
<% if local_assigns[:title] %>
|
||||
<div class="font-medium mb-1">
|
||||
<%= local_assigns[:title] %>
|
||||
</div>
|
||||
<% end %>
|
||||
</span>
|
||||
<% end %>
|
||||
<span data-target="dashboard-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">
|
||||
<%= t('uploading') %>...
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
<input id="dashboard_dropzone_input_<%= form_id %>" name="files[]" class="hidden" data-action="change:dashboard-dropzone#onSelectFiles" data-target="dashboard-dropzone.input" type="file" accept="image/*, application/pdf<%= ', .docx, .doc, .xlsx, .xls, .odt, .rtf' if Docuseal.multitenant? %>" multiple>
|
||||
</div>
|
||||
</label>
|
||||
<% end %>
|
||||
@@ -1,12 +1,12 @@
|
||||
<dashboard-dropzone class="block h-36 relative group bg-base-200 border-2 rounded-2xl border-transparent">
|
||||
<a href="<%= template_path(template) %>" class="flex h-full flex-col justify-between pt-6 px-7 w-full peer">
|
||||
<div class="pb-4 text-xl font-semibold" style="overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;">
|
||||
<div class="h-36 relative group">
|
||||
<a href="<%= template_path(template) %>" class="flex h-full flex-col justify-between rounded-2xl pt-6 px-7 w-full bg-base-200 before:border-2 before:border-base-300 before:border-dashed before:absolute before:left-0 before:right-0 before:top-0 before:bottom-0 before:hidden before:rounded-2xl" data-targets="dashboard-dropzone.templateCards">
|
||||
<div class="text-xl font-semibold" style="overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;">
|
||||
<% if template.template_accesses.present? %>
|
||||
<%= svg_icon('lock', class: 'w-6 h-6 inline -translate-y-[4px]') %>
|
||||
<% end %>
|
||||
<% template.name.split(/(_)/).each do |item| %><%= item %><wbr><% end %>
|
||||
</div>
|
||||
<div class="pb-6 pt-1 space-y-1" data-targets="dashboard-dropzone.hiddenOnHover">
|
||||
<div class="pb-6 pt-1 space-y-1" data-targets="dashboard-dropzone.hiddenOnDrag">
|
||||
<p class="flex items-center space-x-1 text-xs text-base-content/60">
|
||||
<%= svg_icon('user', class: 'w-4 h-4') %>
|
||||
<span><%= template.author.full_name.presence || template.author.email.to_s.sub(/\+\w+@/, '@') %></span>
|
||||
@@ -28,8 +28,7 @@
|
||||
</p>
|
||||
</div>
|
||||
</a>
|
||||
<%= render 'templates/dashboard_dropzone_form', url: template_replace_documents_path(template), title: t('upload_new_based_on_template'), icon: 'files', position: 'end' %>
|
||||
<div class="absolute top-0 bottom-0 w-0 flex items-center hidden md:group-hover:flex" style="right: 37px" data-targets="dashboard-dropzone.hiddenOnHover">
|
||||
<div class="absolute top-0 bottom-0 w-0 items-center hidden md:group-hover:flex" style="right: 37px" data-targets="dashboard-dropzone.hiddenOnDrag">
|
||||
<div class="space-y-1">
|
||||
<% if can?(:update, template) && !template.archived_at? && template.account_id == current_account.id %>
|
||||
<span class="tooltip tooltip-left" data-tip="<%= t('move') %>">
|
||||
@@ -69,4 +68,4 @@
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</dashboard-dropzone>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user