All the little details

This commit is contained in:
2015-02-20 19:21:25 +01:00
parent cde551dc7f
commit d9e69beb5f
38 changed files with 256 additions and 57 deletions
@@ -1,12 +1,19 @@
attr = DS.attr
App.EmployeeShift = DS.Model.extend
start_on: attr('date')
end_on: attr('date')
start_from: attr('moment')
end_on: attr('moment')
employee: DS.belongsTo 'employee'
description: attr('string')
calendar_event: (->
id: @id
title: @get('employee.name')
start: @get('start_on')
title: @get('title')
start: @get('start_from')
end: @get('end_on')
color: @get('employee.color')
).property('start_on', 'end_on')
).property('start_from', 'end_on', 'title')
title: Ember.computed 'employee.name', 'description', ->
if @get('description')
[@get('employee.name'), @get('description')].join(' - ')
else
@get 'employee.name'