switch to JSONAPI for suppliers
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
# return translated title_path if directly set by controller
|
||||
translation_params = {}
|
||||
if model = @get('model')
|
||||
translation_params = model.serialize() if model.serialize
|
||||
translation_params = model.toJSON() if model.toJSON
|
||||
|
||||
# return translated title_path if directly set by options
|
||||
# return translated title_path if directly set by controller
|
||||
@@ -19,6 +19,7 @@
|
||||
#return tspan(@title_path, translation_params).htmlSafe() if @title_path
|
||||
# infer title path based on controller name App.modals.AddSectionController => add_section
|
||||
underscored = `this.constructor.toString().substr(11).replace(/Controller$/, '').underscore()`
|
||||
#underscored = @constructor.toString().replace(/[a-zA-Z_-]+\@controller:modals\//, '').replace(/:$/, '').underscore() # ember cli
|
||||
# find translated title or humanize the controller name
|
||||
if convention_translation = ttry("modal.#{underscored}.title", translation_params)
|
||||
tspan(@get("modal.#{underscored}.title"), translation_params).htmlSafe()
|
||||
|
||||
@@ -16,7 +16,7 @@ App.EmployeesRoute = Ember.Route.extend
|
||||
ac = @controllerFor('application')
|
||||
if ac.get('employee.id') isnt employee.id
|
||||
ac.modal 'confirm',
|
||||
title: t('employee.destroy.modal.title', employee.serialize())
|
||||
title: t('employee.destroy.modal.title', employee.toJSON())
|
||||
ok: -> employee.destroyRecord()
|
||||
else
|
||||
ac.modal 'alert',
|
||||
|
||||
Reference in New Issue
Block a user