intermediate commit

This commit is contained in:
2015-07-17 15:26:59 +02:00
parent af6edfd0aa
commit bd9dfa7c77
11 changed files with 172 additions and 62674 deletions
@@ -1,5 +1,7 @@
Ember.Handlebars.registerHelper 'can', (operation, resource, options)->
if operation is 'manage' and @get('current_employee.manager')
#if operation is 'manage' and @get('current_employee.manager')
#App.__container__.lookup('globals:current').get('employee.manager')
if operation is 'manage' and options.data.view and options.data.view.get('controller.current_employee.manager')
options.fn @
else
options.inverse @
options.inverse @ if options.inverse
@@ -0,0 +1,8 @@
App.initializer
name: 'injectCurrent'
initialize: (container, app)->
container.optionsForType 'globals', instantiate: false, singleton: true
container.register 'globals:current', Em.Object.create()
container.typeInjection 'controller', 'current', 'globals:current'
container.typeInjection 'route', 'current', 'globals:current'
@@ -14,6 +14,7 @@ App.ApplicationRoute = Ember.Route.extend
setupController: (controller)->
controller.set 'supplier', @supplier
controller.set 'employee', @employee
controller.set 'current.employee', @employee
# @set 'supplier', @store.find('supplier', supplier_id)
#controller.set 'sections', @sections
#controller.set 'product_categories', @product_categories
@@ -1,8 +1,12 @@
App.ApplicationSerializer = DS.ActiveModelSerializer
App.ApplicationStore = DS.Store.extend
adapter: DS.ActiveModelAdapter.extend
namespace: 'supplier'
## user underscored paths
#pathForType: (type)->
#Ember.String.pluralize(Ember.String.decamelize(type))
App.ApplicationStore = DS.Store
#adapter: DS.ActiveModelAdapter.extend
#namespace: 'supplier'
## user underscored paths
#pathForType: (type)->
#Ember.String.pluralize(Ember.String.decamelize(type))
App.ApplicationAdapter = DS.ActiveModelAdapter.extend
namespace: 'supplier'
#headers:
#"Accept": "application/json, text/javascript; q=0.01"