2024-06-01 22:39:04 +02:00
|
|
|
- if @attestation_template.draft?
|
2024-05-29 18:37:38 +02:00
|
|
|
= turbo_stream.update "sticky-header", render(partial: "sticky_header")
|
2024-05-28 17:47:05 +02:00
|
|
|
|
2024-01-25 14:17:01 +01:00
|
|
|
= turbo_stream.show 'autosave-notice'
|
2024-06-07 10:22:01 +02:00
|
|
|
= turbo_stream.replace('autosave-notice', render(AutosaveNoticeComponent.new(success: !@attestation_template.changed?, label_scope: :attestation)))
|
2024-01-25 14:17:01 +01:00
|
|
|
= turbo_stream.hide 'autosave-notice', delay: 15000
|
|
|
|
|
2023-12-22 14:13:20 +01:00
|
|
|
- if @attestation_template.logo_blob&.previously_new_record?
|
|
|
|
= turbo_stream.update dom_id(@attestation_template, :logo_attachment) do
|
|
|
|
= render(Attachment::EditComponent.new(attached_file: @attestation_template.logo, direct_upload: false))
|
|
|
|
|
|
|
|
- if @attestation_template.signature_blob&.previously_new_record?
|
|
|
|
= turbo_stream.update dom_id(@attestation_template, :signature_attachment) do
|
|
|
|
= render(Attachment::EditComponent.new(attached_file: @attestation_template.signature, direct_upload: false))
|
2024-02-01 18:55:41 +01:00
|
|
|
|
2024-05-28 17:47:05 +02:00
|
|
|
- body_id = "attestation-template-json-body-messages"
|
2024-02-01 18:55:41 +01:00
|
|
|
- if @attestation_template.errors.include?(:json_body)
|
|
|
|
= turbo_stream.update body_id do
|
|
|
|
= render partial: "shared/errors_list", locals: { object: @attestation_template, attribute: :json_body }
|
|
|
|
= turbo_stream.show body_id
|
|
|
|
- else
|
|
|
|
= turbo_stream.hide body_id
|
|
|
|
= turbo_stream.update body_id, nil
|