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-20 11:22:00 +02:00
|
|
|
json.partial! 'api/availabilities/slot', slot: slot, operator_role: @operator_role, reservable: slot.availability.trainings.first
|
2022-07-19 11:32:12 +02:00
|
|
|
json.borderColor trainings_events_border_color(slot.availability)
|
2022-07-11 17:59:56 +02:00
|
|
|
|
|
|
|
json.is_completed slot.full?
|
2022-07-19 11:32:12 +02:00
|
|
|
json.nb_total_places slot.availability.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
|