c521724cf4
Co-authored-by: Colin Darie <colin@darie.eu>
29 lines
544 B
Ruby
29 lines
544 B
Ruby
class Dossiers::EditFooterComponent < ApplicationComponent
|
|
def initialize(dossier:, annotation:)
|
|
@dossier = dossier
|
|
@annotation = annotation
|
|
end
|
|
|
|
private
|
|
|
|
def owner?
|
|
controller.current_user.owns?(@dossier)
|
|
end
|
|
|
|
def annotation?
|
|
@annotation.present?
|
|
end
|
|
|
|
def button_options
|
|
{
|
|
class: 'fr-btn fr-btn--sm',
|
|
disabled: !owner?,
|
|
method: :post,
|
|
data: { 'disable-with': t('.submitting'), controller: 'autosave-submit' }
|
|
}
|
|
end
|
|
|
|
def render?
|
|
!@dossier.for_procedure_preview?
|
|
end
|
|
end
|