2022-07-20 18:53:40 +02:00
|
|
|
class Procedure::Card::AttestationComponent < ApplicationComponent
|
|
|
|
def initialize(procedure:)
|
|
|
|
@procedure = procedure
|
|
|
|
end
|
2022-11-09 12:10:19 +01:00
|
|
|
|
|
|
|
private
|
|
|
|
|
2024-05-29 21:47:09 +02:00
|
|
|
def edit_attestation_path
|
|
|
|
if @procedure.attestation_templates_v2.any? || @procedure.feature_enabled?(:attestation_v2)
|
|
|
|
helpers.edit_admin_procedure_attestation_template_v2_path(@procedure)
|
|
|
|
else
|
|
|
|
helpers.edit_admin_procedure_attestation_template_path(@procedure)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2022-11-09 12:10:19 +01:00
|
|
|
def error_messages
|
|
|
|
@procedure.errors.messages_for(:attestation_template).to_sentence
|
|
|
|
end
|
2022-07-20 18:53:40 +02:00
|
|
|
end
|