2020-02-07 17:37:00 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2022-07-11 17:59:56 +02:00
|
|
|
json.array!(@slots) do |slot|
|
2022-07-12 17:46:01 +02:00
|
|
|
json.partial! 'api/availabilities/slot', slot: slot, operator_role: @operator_role
|
2022-07-11 17:59:56 +02:00
|
|
|
json.borderColor trainings_events_border_color(slot)
|
|
|
|
|
|
|
|
json.is_completed slot.full?
|
|
|
|
json.nb_total_places slot.nb_total_places
|
2016-03-23 18:39:41 +01:00
|
|
|
|
|
|
|
json.training do
|
2022-07-11 17:59:56 +02:00
|
|
|
json.id slot.availability.trainings.first.id
|
|
|
|
json.name slot.availability.trainings.first.name
|
|
|
|
json.description slot.availability.trainings.first.description
|
|
|
|
json.machines slot.availability.trainings.first.machines do |m|
|
2016-03-23 18:39:41 +01:00
|
|
|
json.id m.id
|
|
|
|
json.name m.name
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|