aboutsummaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorXinhui2017-04-06 16:15:53 +0200
committerXinhui2017-04-06 16:15:59 +0200
commit4f336496d52cf024de9fbce2c6133592bb300aa5 (patch)
tree36b1efe2c797986ce046d7c60cfa8472c23d388b /app/views
parent45a789aa0041cbfeca535a8679f3d88ccbe01757 (diff)
downloadchouette-core-4f336496d52cf024de9fbce2c6133592bb300aa5.tar.bz2
Refactoring TimeTables#show json format
Diffstat (limited to 'app/views')
-rw-r--r--app/views/time_tables/show.rabl17
1 files changed, 7 insertions, 10 deletions
diff --git a/app/views/time_tables/show.rabl b/app/views/time_tables/show.rabl
index 1e57e069e..8543377a9 100644
--- a/app/views/time_tables/show.rabl
+++ b/app/views/time_tables/show.rabl
@@ -1,26 +1,23 @@
object @time_table
+attributes :id, :comment
node do |tt|
{
time_table_bounding: tt.presenter.time_table_bounding,
- composition_info: tt.presenter.composition_info,
- day_types: %w(monday tuesday wednesday thursday friday saturday sunday).select{ |d| tt.send(d) }.map{ |d| tt.human_attribute_name(d).first(2)}.join('')
+ tags: tt.tags.map(&:name),
+ day_types: %w(monday tuesday wednesday thursday friday saturday sunday).select{ |d| tt.send(d) }.map{ |d| tt.human_attribute_name(d).first(2)}.join(''),
+ periode_range: month_periode_enum(3)
}
end
-attributes :id, :comment
child(:periods, object_root: false) do
- attributes :id, :period_start, :period_end, :position
+ attributes :id, :period_start, :period_end
end
child(:dates, object_root: false) do
- attributes :id, :date, :position, :in_out
+ attributes :id, :date, :in_out
end
child(:calendar) do
- attributes :id, :name, :short_name
-end
-
-child(:tags, object_root: false) do
- attributes :name
+ attributes :id, :name
end