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.
 
 
 
 
 

39 lines
1.4 KiB

<%= form_with(model: [ :admin, asset ], class: 'form-plain has--key-ctrls') do |form| %>
<div class="form-section">
<%= render partial: 'file', locals: { asset: asset } %>
<%= tag.div class: 'field' do %>
<div>
<%= label_tag nil, t("assets.replace"), for: nil %>
</div>
<div>
<%= tag.label class: "dropzone",
title: t(:'assets.replace'),
data: {
controller: 'upload',
upload_url_value: rails_direct_uploads_url,
upload_create_url_value: url_for(controller: 'assets', action: 'replace', id: asset),
upload_target_value: 'asset_preview',
upload_limit_value: 1,
action: "dragover->upload#dragover dragleave->upload#dragleave drop->upload#drop"
} do %>
<span>arrow_upward</span>
<input type="file" data-action="change->upload#upload">
<% end %>
</div>
<% end %>
</div>
<div class="form-section">
<%= render partial: 'material/text_field', locals: { f: form, attr: :title } %>
</div>
<div class="form-ctrls">
<%= link_to t(:'ui.cancel'), url_for(controller: 'assets', action: 'index'), data: {turbo_action: 'advance'} %>
<%= form.submit t(:'ui.save') %>
</div>
<% end %>