-define(['jQuery',
-        'Underscore',
-        'Backbone',
+define(['jQuery'
+        'Underscore'
+        'Backbone'
         'collections/schedule-sections'
-        'models/course',
-        'models/section'], ($,_, Backbone, ScheduleSections, Course, Section) ->
+        'models/course'
+        'models/section'
+        'text!tmpl/schedule/downloads/ics.ejs'], ($,_, Backbone, ScheduleSections, Course, Section, icsTemplate) ->
 
   class Schedule extends Backbone.Model
 

    addSection: (section) ->
      @.get('sections').add (section)

    removeSection: (section) ->
      @.get('sections').remove(@.get('sections').get(section.get('_id')))

    contains: (section) ->
      @.get('sections').where({_id: section.get('_id')}).length > 0

  Schedule
)
    defaults:
      name: ""
      sections: new ScheduleSections

    initialize: ->
      @icsDownloadTemplate = _.template icsTemplate.replace(/\n/g, '#\n').trim()

    new: ->
      @.unset('__v')
