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.
docuseal/app/views/personalization_settings/_logo_form.html.erb

35 lines
1.8 KiB

<% if current_account.logo.attached? %>
<div class="mb-4">
<div class="flex items-center space-x-4">
<img src="<%= url_for(current_account.logo) %>" class="max-h-16 max-w-xs rounded">
<%= button_to t('remove'), settings_account_logo_path, method: :delete, class: 'btn btn-sm btn-error btn-outline', data: { turbo_confirm: t('are_you_sure_') } %>
</div>
</div>
<% end %>
<%= form_with url: settings_account_logo_path, method: :post, html: { autocomplete: 'off', enctype: 'multipart/form-data' } do |f| %>
<file-dropzone data-submit-on-upload="true" class="w-full">
<label for="logo_file" class="w-full block h-32 relative bg-base-200 hover:bg-base-200/70 rounded-md border border-base-content border-dashed">
<div class="absolute top-0 right-0 left-0 bottom-0 flex items-center justify-center p-2">
<div class="flex flex-col items-center text-center">
<span data-target="file-dropzone.icon">
<%= svg_icon('cloud_upload', class: 'w-10 h-10') %>
</span>
<span data-target="file-dropzone.loading" class="hidden">
<%= svg_icon('loader', class: 'w-10 h-10 animate-spin') %>
</span>
<div class="font-medium mb-1">
<%= t('upload_logo') %>
</div>
<div class="text-xs">
<%= t('click_to_upload_or_drag_and_drop_html') %>
</div>
</div>
<input id="logo_file" name="file" class="hidden" data-action="change:file-dropzone#onSelectFiles" data-target="file-dropzone.input" type="file" accept="image/png,image/jpeg,image/jpg,image/gif,image/svg+xml">
</div>
</label>
</file-dropzone>
<div class="form-control mt-4">
<%= f.button button_title(title: t('save'), disabled_with: t('saving')), class: 'base-button' %>
</div>
<% end %>