2024-04-29 00:17:15 +02:00
|
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
2023-04-24 15:47:46 +02:00
|
|
|
|
class Procedure::OneGroupeManagementComponent < ApplicationComponent
|
|
|
|
|
include Logic
|
|
|
|
|
|
|
|
|
|
def initialize(revision:, groupe_instructeur:)
|
|
|
|
|
@revision = revision
|
|
|
|
|
@groupe_instructeur = groupe_instructeur
|
2023-06-12 14:19:22 +02:00
|
|
|
|
@procedure = revision.procedure
|
2023-04-24 15:47:46 +02:00
|
|
|
|
end
|
2024-09-25 13:44:10 +02:00
|
|
|
|
|
|
|
|
|
def csv_template
|
|
|
|
|
template_path.open
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def template_path
|
|
|
|
|
Rails.public_path.join('csv/import-instructeurs-test.csv')
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def template_url
|
|
|
|
|
template_path.to_s
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def template_detail
|
|
|
|
|
"#{File.extname(csv_template.to_path).upcase.delete_prefix('.')} – #{number_to_human_size(csv_template.size)}"
|
|
|
|
|
end
|
2023-04-24 15:47:46 +02:00
|
|
|
|
end
|