aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/time_tables/show.rabl
blob: a4434c5185b1e57da614923591f868f1a33f2aa5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
object @time_table

attributes :id, :comment
node do |tt|
  {
    time_table_bounding: tt.presenter.time_table_bounding,
    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(''),
    current_month: tt.month_inspect(Date.today),
    periode_range: month_periode_enum(3),
  }
end

child(:periods, object_root: false) do
  attributes :id, :period_start, :period_end
end

child(:dates, object_root: false) do
  attributes :id, :date, :in_out
end

child(:calendar) do
  attributes :id, :name
end