demarches-normaliennes/app/views/attachments/show.turbo_stream.haml
Colin Darie 4824363879 refactor(attachment): rename user_can_download -> explicit view_as
- link: shows a simple link to open attachment
- download: shows complete DSFR download UI
2022-12-08 20:36:15 +01:00

5 lines
339 B
Text

= turbo_stream.replace dom_id(@attachment, :edit) do
- if @user_can_edit
= render Attachment::EditComponent.new(attachment: @attachment, attached_file: @attachment.record.public_send(@attachment.name), auto_attach_url: @auto_attach_url, view_as: @view_as)
- else
= render Attachment::ShowComponent.new(attachment: @attachment)