ControllerExtensions = Ember.Mixin.create
  # conveniance wrapper for open modal. Use like:
  #   @modal "edit_table", model: table
  # modal: (name, options={})->
  #   @send "openModal", "modals/#{name}", options.model || Ember.Object.create(),
  #     controller: 'modal'
  #     ok: options.ok
  #     close: options.close
  modal: (name, options={})->
    options.model ||= Ember.Object.create()
    @send "openModal", name, options

  all_sections: (-> @store.peekAll('section')).property()

Ember.Controller.reopen ControllerExtensions
