mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-10 21:24:20 +01:00
0d072291c7
Also: fix reservation change behavior
20 lines
667 B
Ruby
20 lines
667 B
Ruby
# frozen_string_literal: true
|
|
|
|
json.array!(@slots) do |slot|
|
|
json.partial! 'api/availabilities/slot', slot: slot, operator_role: @operator_role, reservable: slot.availability.trainings.first
|
|
json.borderColor trainings_events_border_color(slot.availability)
|
|
|
|
json.is_completed slot.full?
|
|
json.nb_total_places slot.availability.nb_total_places
|
|
|
|
json.training do
|
|
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|
|
|
json.id m.id
|
|
json.name m.name
|
|
end
|
|
end
|
|
end
|