1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-01 12:24:28 +01:00
fab-manager/app/views/api/events/_event.json.jbuilder

40 lines
1.4 KiB
Plaintext
Raw Normal View History

2016-06-29 17:05:42 +02:00
json.extract! event, :id, :title, :description, :age_range_id
2015-05-05 03:10:25 +02:00
json.event_image event.event_image.attachment_url if event.event_image
json.event_files_attributes event.event_files do |f|
json.id f.id
json.attachment f.attachment_identifier
json.attachment_url f.attachment_url
end
json.category_id event.category_id
json.category do
json.id event.category.id
json.name event.category.name
2016-08-11 11:33:55 +02:00
end if event.category
2016-06-29 17:05:42 +02:00
json.event_theme_ids event.event_theme_ids
json.event_themes event.event_themes do |e|
json.name e.name
end
json.age_range_id event.age_range_id
json.age_range do
json.name event.age_range.name
end if event.age_range
2015-05-05 03:10:25 +02:00
json.start_date event.availability.start_at
json.start_time event.availability.start_at
json.end_date event.availability.end_at
json.end_time event.availability.end_at
2016-03-23 18:39:41 +01:00
json.month t('date.month_names')[event.availability.start_at.month]
2015-05-05 03:10:25 +02:00
json.month_id event.availability.start_at.month
json.year event.availability.start_at.year
json.all_day event.availability.start_at.hour == 0 ? 'true' : 'false'
json.availability do
json.id event.availability.id
json.start_at event.availability.start_at
json.end_at event.availability.end_at
end
json.availability_id event.availability_id
json.amount (event.amount / 100.0) if event.amount
json.reduced_amount (event.reduced_amount / 100.0) if event.reduced_amount
json.nb_total_places event.nb_total_places
2016-03-23 18:39:41 +01:00
json.nb_free_places event.nb_free_places || event.nb_total_places
2016-06-29 17:05:42 +02:00