From 40a0d8e08c7f51be68d8d574f61d29ef3d724052 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Bellet Date: Wed, 8 Mar 2023 10:22:54 +0100 Subject: [PATCH] Improve design: make delete not a button but a link + close to file name --- .../admin/enterprises/form/_business_details.html.haml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/views/admin/enterprises/form/_business_details.html.haml b/app/views/admin/enterprises/form/_business_details.html.haml index abd2a4f594..d91d19924f 100644 --- a/app/views/admin/enterprises/form/_business_details.html.haml +++ b/app/views/admin/enterprises/form/_business_details.html.haml @@ -39,17 +39,15 @@ .omega.eight.columns#terms_and_conditions{data: { 'reflex-root': '#terms_and_conditions' } } - if @enterprise.terms_and_conditions.attached? = link_to "#{@enterprise.terms_and_conditions.blob.filename} #{ t('.uploaded_on') } #{@enterprise.terms_and_conditions.blob.created_at}", url_for(@enterprise.terms_and_conditions), target: '_blank' - + %div + %a.icon-trash{ href: '#', data: { action: 'click->terms-and-conditions#remove', "terms-and-conditions-message-value": t('js.admin.enterprises.form.images.immediate_terms_and_conditions_removal_warning'), 'enterprise-id': @enterprise.id}} + = t('.remove_terms_and_conditions') + .pad-top %div .button.small{ data: { controller: 'help-modal-link', action: 'click->help-modal-link#open', "help-modal-link-target-value": "terms_and_conditions_warning_modal" } } = t('.upload') %span{ data: { "terms-and-conditions-target": "filename" } } = f.file_field :terms_and_conditions, accept: 'application/pdf', style: 'display: none;', data: { "terms-and-conditions-target": "fileinput" } - - .pad-top - - if @enterprise.terms_and_conditions.attached? - %a.button.red{ href: '#', data: { action: 'click->terms-and-conditions#remove', "terms-and-conditions-message-value": t('js.admin.enterprises.form.images.immediate_terms_and_conditions_removal_warning'), 'enterprise-id': @enterprise.id}} - = t('.remove_terms_and_conditions') = render HelpModalComponent.new(id: "terms_and_conditions_warning_modal", close_button: false ) do %div