diff --git a/Gruntfile.js b/Gruntfile.js index bb8a162..494475a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -25,7 +25,8 @@ module.exports = function(grunt) { 'src/application/routes/**/*.coffee', 'src/application/controllers/**/*.coffee', 'src/application/form_config.coffee', - 'src/application/adapters/*.coffee' + 'src/application/adapters/*.coffee', + 'src/application/decorators/*.coffee' ] } } @@ -52,7 +53,7 @@ module.exports = function(grunt) { options: { mangle: false, compress: false }, dist: { - src: ['src/ember-easyForm.js', 'vendor/jquery.cookie/jquery.cookie.js', 'dist/ember-admin.js', 'dist/templates.js'], + src: ['src/ember-easyForm.js', 'src/ember-easy-decorator.js', 'vendor/jquery.cookie/jquery.cookie.js', 'dist/ember-admin.js', 'dist/templates.js'], dest: 'dist/ember-admin.min.js' } }, diff --git a/dist/ember-admin.js b/dist/ember-admin.js index 69f0eed..8344c84 100644 --- a/dist/ember-admin.js +++ b/dist/ember-admin.js @@ -1013,7 +1013,15 @@ params: }).call(this); (function() { - Admin.Base.Controllers.AdminBaseController = Ember.ObjectController.extend(Admin.Mixins.Controllers.BaseActionsMixin, Admin.Mixins.Controllers.FileUploadMixin, Admin.Mixins.Controllers.AttributesMixin, Admin.Mixins.Controllers.PaginationMixin, Admin.Mixins.Controllers.BatchActionsMixin, Admin.Mixins.Controllers.FormActionsMixin); + Admin.Base.Controllers.AdminBaseController = Ember.ObjectController.extend(Admin.Mixins.Controllers.BaseActionsMixin, Admin.Mixins.Controllers.FileUploadMixin, Admin.Mixins.Controllers.AttributesMixin, Admin.Mixins.Controllers.PaginationMixin, Admin.Mixins.Controllers.BatchActionsMixin, Admin.Mixins.Controllers.FormActionsMixin, { + decorator: (function() { + if (this.get('model')) { + return Admin.BaseDecorator.create({ + model: this.get('model') + }); + } + }).property('model') + }); }).call(this); @@ -1025,144 +1033,6 @@ params: }).call(this); (function() { - Ember.Handlebars.registerHelper("input-field", function(property, options) { - var config, configs, context, i, inputOptions, inputType, optionName, propertyType, type; - options = Ember.EasyForm.processOptions(property, options); - context = this; - if (options.hash.propertyBinding) { - options.hash.property = Ember.Handlebars.get(this, options.hash.propertyBinding, options); - } - if (options.hash.inputOptionsBinding) { - options.hash.inputOptions = Ember.Handlebars.get(this, options.hash.inputOptionsBinding, options); - } - property = options.hash.property; - propertyType = function(property) { - var e; - try { - return (context.get("content") || context).constructor.metaForProperty(property).type; - } catch (_error) { - e = _error; - return null; - } - }; - options.hash.valueBinding = property; - options.hash.viewName = "input-field-" + options.data.view.elementId; - if (options.hash.inputOptions) { - inputOptions = options.hash.inputOptions; - optionName = void 0; - for (optionName in inputOptions) { - if (inputOptions.hasOwnProperty(optionName)) { - options.hash[optionName] = inputOptions[optionName]; - } - } - delete options.hash.inputOptions; - } - if (options.hash.inputConfig) { - configs = options.hash.inputConfig.split(";"); - i = configs.length; - while (i--) { - config = configs[i].split(":"); - options.hash[config[0]] = config[1]; - } - } - if (options.hash.as === "text") { - return Ember.Handlebars.helpers.view.call(context, Ember.EasyForm.TextArea, options); - } else if (options.hash.as === "select") { - delete options.hash.valueBinding; - type = context.get("model").constructor; - if (Admin.DSL.Attributes.relations(type).indexOf(property) >= 0) { - options.hash.attribute = property; - options.hash.content = context.store.findAll(property); - options.hash.selection = context.get(property); - options.hash.optionValuePath = "context.id"; - options.hash.optionLabelPath = "context.title"; - options.hash.prompt = "Place select %@".fmt(property); - } else { - options.hash.contentBinding = options.hash.collection; - options.hash.selectionBinding = options.hash.selection; - options.hash.valueBinding = options.hash.value; - } - return Ember.Handlebars.helpers.view.call(context, Ember.EasyForm.Select, options); - } else { - if (!options.hash.as) { - if (property.match(/password/)) { - options.hash.type = "password"; - } else if (property.match(/email/)) { - options.hash.type = "email"; - } else if (property.match(/url/)) { - options.hash.type = "url"; - } else if (property.match(/color/)) { - options.hash.type = "color"; - } else if (property.match(/^tel/)) { - options.hash.type = "tel"; - } else if (property.match(/search/)) { - options.hash.type = "search"; - } else { - if (propertyType(property) === "number" || typeof (context.get(property)) === "number") { - options.hash.type = "number"; - } else if (propertyType(property) === "date" || (!Ember.isNone(context.get(property)) && context.get(property).constructor === Date)) { - options.hash.type = "date"; - } else if (propertyType(property) === "boolean" || (!Ember.isNone(context.get(property)) && context.get(property).constructor === Boolean)) { - options.hash.checkedBinding = property; - return Ember.Handlebars.helpers.view.call(context, Ember.EasyForm.Checkbox, options); - } - } - } else { - inputType = Ember.EasyForm.Config.getInputType(options.hash.as); - if (inputType) { - options.hash.property = property; - return Ember.Handlebars.helpers.view.call(context, inputType, options); - } - options.hash.type = options.hash.as; - } - return Ember.Handlebars.helpers.view.call(context, Ember.EasyForm.TextField, options); - } - }); - - Ember.Handlebars.registerHelper("input", function(property, options) { - options = Ember.EasyForm.processOptions(property, options); - if (Admin.Forms.Filters.fileupload(options, property)) { - return; - } - if (Admin.Forms.Filters.mapField(options, property)) { - return; - } - Admin.Forms.Filters.as(options, property); - options.hash.property = property; - options.hash.isBlock = !!options.fn; - return Ember.Handlebars.helpers.view.call(this, Ember.EasyForm.Input, options); - }); - - Ember.Handlebars.registerBoundHelper("bound-input", function(property, options) { - options = Ember.EasyForm.processOptions(property, options); - if (Admin.Forms.Filters.fileupload(options, property)) { - return; - } - if (Admin.Forms.Filters.mapField(options, property)) { - return; - } - Admin.Forms.Filters.as(options, property); - options.hash.property = property; - options.hash.isBlock = !!options.fn; - return Ember.Handlebars.helpers.view.call(this, Ember.EasyForm.Input, options); - }); - - Ember.Handlebars.registerHelper('input-map', function(property, options) { - options = Ember.EasyForm.processOptions(property, options); - options.hash.property = property; - options.hash.isBlock = !!options.fn; - return Admin.Forms.Filters.map(options, property); - }); - - Ember.EasyForm.Select = Ember.Select.extend({ - attributeBindings: ["attribute"], - change: function() { - var path; - path = "context.%@".fmt(this.get("attribute")); - return this.set(path, this.get("selection")); - } - }); - Ember.EasyForm.Form.reopen({ submit: function(event) { var promise, _this; @@ -1191,43 +1061,6 @@ params: }).call(this); -(function() { - Admin.Forms.Filters = Ember.Object.extend().reopenClass({ - fileupload: function(options, property) { - var context; - context = options.contexts[0]; - return context.get("fileuploads") !== undefined && context.get("fileuploads").getEach("name").indexOf(property) >= 0; - }, - mapField: function(options, property) { - var context, exist; - context = options.contexts[0]; - exist = context.get("asGoogleMap") !== undefined && context.get("asGoogleMap").indexOf(property) >= 0; - if (exist) { - return exist; - } - return context.get("asYandexMap") !== undefined && context.get("asYandexMap").indexOf(property) >= 0; - }, - as: function(options, property) { - var type; - type = options.contexts[0].get("model").constructor; - if (Admin.DSL.Attributes.relations(type).indexOf(property) >= 0) { - return options.hash.as = "select"; - } - }, - map: function(options, property) { - var context; - context = options.contexts[0]; - if (context.get('asGoogleMap')) { - return Ember.Handlebars.helpers.view.call(context, Admin.Base.Views.GmapView, options); - } - if (context.get('asYandexMap')) { - return Ember.Handlebars.helpers.view.call(context, Admin.Base.Views.YandexMapView, options); - } - } - }); - -}).call(this); - (function() { Ember.Handlebars.registerHelper("fileupload", function(property, options) { options.hash.inputOptions = Ember.copy(options.hash); @@ -1243,6 +1076,21 @@ params: }).call(this); +(function() { + Ember.Handlebars.registerHelper("input-map", function(property, options) { + options = Ember.EasyForm.processOptions(property, options); + options.hash.property = property; + options.hash.isBlock = !!options.fn; + if (this.get('model.asGoogleMap')) { + return Ember.Handlebars.helpers.view.call(this.get('model'), Admin.Base.Views.GmapView, options); + } + if (this.get('model.asYandexMap')) { + return Ember.Handlebars.helpers.view.call(this.get('model'), Admin.Base.Views.YandexMapView, options); + } + }); + +}).call(this); + (function() { Admin.Base.Views.ActionView = Admin.Base.Views.BaseActionView.extend({ classNameBindings: ["class"], @@ -2047,3 +1895,53 @@ params: }); }).call(this); + +(function() { + Admin.BaseDecorator = EmberEasyDecorator.extend({ + unknownProperty: function(propertyName) { + var modelProperty; + if (/Value$/.test(propertyName)) { + modelProperty = propertyName.substr(0, propertyName.length - 5); + return this.get('model.%@'.fmt(modelProperty)); + } + if (/SectionFields$/.test(propertyName)) { + return this._createSectionComputed(propertyName); + } + if (this.get('model.%@'.fmt(propertyName))) { + if (this._checkMapProperty(propertyName) || this._checkFileupload(propertyName)) { + return { + options: { + isVisible: false + } + }; + } + if (Admin.DSL.Attributes.isBelongsTo(this.get("model").constructor, propertyName)) { + this.set('%@Collection'.fmt(propertyName), this.get('model.store').findAll(propertyName)); + return { + html: { + optionLabelPath: 'content.title' + }, + type: 'select', + options: { + relation: true + } + }; + } else { + return this.get('model.%@'.fmt(propertyName)); + } + } + }, + _checkMapProperty: function(property) { + var exist; + exist = this.get("model.asGoogleMap") !== undefined && this.get("model.asGoogleMap").indexOf(property) >= 0; + if (exist) { + return exist; + } + return this.get("model.asYandexMap") !== undefined && this.get("model.asYandexMap").indexOf(property) >= 0; + }, + _checkFileupload: function(property) { + return this.get("model.fileuploads") !== undefined && this.get("model.fileuploads").indexOf(property) >= 0; + } + }); + +}).call(this); diff --git a/dist/ember-admin.min.js b/dist/ember-admin.min.js index 4b28152..6dfd777 100644 --- a/dist/ember-admin.min.js +++ b/dist/ember-admin.min.js @@ -1,4 +1,4 @@ -(function(){Ember.EasyForm=Ember.Namespace.create({VERSION:"1.0.0.beta.1"})})();(function(){Ember.EasyForm.Config=Ember.Namespace.create({_wrappers:{"default":{formClass:"",fieldErrorClass:"fieldWithErrors",inputClass:"input",errorClass:"error",hintClass:"hint",labelClass:"",wrapControls:false,controlsWrapperClass:""}},_inputTypes:{},registerWrapper:function(name,wrapper){this._wrappers[name]=Ember.$.extend({},this._wrappers["default"],wrapper)},getWrapper:function(name){var wrapper=this._wrappers[name];Ember.assert("The wrapper '"+name+"' was not registered.",wrapper);return wrapper},registerInputType:function(name,type){this._inputTypes[name]=type},getInputType:function(name){return this._inputTypes[name]}})})();(function(){Ember.Handlebars.registerHelper("error-field",function(property,options){options=Ember.EasyForm.processOptions(property,options);if(options.hash.propertyBinding){options.hash.property=Ember.Handlebars.get(this,options.hash.propertyBinding,options)}return Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Error,options)})})();(function(){Ember.Handlebars.registerHelper("form-for",function(object,options){options.hash.contentBinding=object;return Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Form,options)})})();(function(){Ember.Handlebars.registerHelper("hint-field",function(property,options){options=Ember.EasyForm.processOptions(property,options);if(options.hash.text||options.hash.textBinding){return Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Hint,options)}})})();(function(){Ember.Handlebars.registerHelper("input",function(property,options){options=Ember.EasyForm.processOptions(property,options);options.hash.isBlock=!!options.fn;return Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Input,options)})})();(function(){Ember.Handlebars.registerHelper("input-field",function(property,options){options=Ember.EasyForm.processOptions(property,options);if(options.hash.propertyBinding){options.hash.property=Ember.Handlebars.get(this,options.hash.propertyBinding,options)}if(options.hash.inputOptionsBinding){options.hash.inputOptions=Ember.Handlebars.get(this,options.hash.inputOptionsBinding,options)}property=options.hash.property;var context=this,propertyType=function(property){var constructor=(context.get("content")||context).constructor;if(constructor.proto){return Ember.meta(constructor.proto(),false).descs[property]}else{return null}};options.hash.valueBinding=property;options.hash.viewName="input-field-"+options.data.view.elementId;if(options.hash.inputOptions){var inputOptions=options.hash.inputOptions,optionName;for(optionName in inputOptions){if(inputOptions.hasOwnProperty(optionName)){options.hash[optionName]=inputOptions[optionName]}}delete options.hash.inputOptions}if(options.hash.as==="text"){return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.TextArea,options)}else if(options.hash.as==="select"){delete options.hash.valueBinding;options.hash.contentBinding=options.hash.collection;options.hash.selectionBinding=options.hash.selection;options.hash.valueBinding=options.hash.value;if(Ember.isNone(options.hash.selectionBinding)&&Ember.isNone(options.hash.valueBinding)){options.hash.selectionBinding=property}return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.Select,options)}else if(options.hash.as==="checkbox"){if(Ember.isNone(options.hash.checkedBinding)){options.hash.checkedBinding=property}return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.Checkbox,options)}else{if(!options.hash.as){if(property.match(/password/)){options.hash.type="password"}else if(property.match(/email/)){options.hash.type="email"}else if(property.match(/url/)){options.hash.type="url"}else if(property.match(/color/)){options.hash.type="color"}else if(property.match(/^tel/)){options.hash.type="tel"}else if(property.match(/search/)){options.hash.type="search"}else{if(propertyType(property)==="number"||typeof context.get(property)==="number"){options.hash.type="number"}else if(propertyType(property)==="date"||!Ember.isNone(context.get(property))&&context.get(property).constructor===Date){options.hash.type="date"}else if(propertyType(property)==="boolean"||!Ember.isNone(context.get(property))&&context.get(property).constructor===Boolean){options.hash.checkedBinding=property;return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.Checkbox,options)}}}else{var inputType=Ember.EasyForm.Config.getInputType(options.hash.as);if(inputType){return Ember.Handlebars.helpers.view.call(context,inputType,options)}options.hash.type=options.hash.as}return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.TextField,options)}})})();(function(){Ember.Handlebars.registerHelper("label-field",function(property,options){options=Ember.EasyForm.processOptions(property,options);options.hash.viewName="label-field-"+options.data.view.elementId;return Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Label,options)})})();(function(){Ember.Handlebars.registerHelper("submit",function(value,options){if(typeof value==="object"){options=value;value=undefined}options.hash.context=this;options.hash.value=value||"Submit";return options.hash.as==="button"?Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Button,options):Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Submit,options)})})();(function(){})();(function(){Ember.EasyForm.BaseView=Ember.View.extend({getWrapperConfig:function(configName){var wrapper=Ember.EasyForm.Config.getWrapper(this.get("wrapper"));return wrapper[configName]},wrapper:Ember.computed(function(){var parentView=this.get("parentView");while(parentView){var config=parentView.get("wrapper");if(config)return config;parentView=parentView.get("parentView")}return"default"})})})();(function(){Ember.EasyForm.Checkbox=Ember.Checkbox.extend()})();(function(){Ember.EasyForm.Error=Ember.EasyForm.BaseView.extend({tagName:"span",init:function(){this._super();this.classNames.push(this.getWrapperConfig("errorClass"));Ember.Binding.from("context.errors."+this.property).to("errors").connect(this)},templateName:"easyForm/error"})})();(function(){Ember.EasyForm.Form=Ember.EasyForm.BaseView.extend({tagName:"form",attributeBindings:["novalidate"],novalidate:"novalidate",wrapper:"default",init:function(){this._super();this.classNames.push(this.getWrapperConfig("formClass"));this.action=this.action||"submit"},submit:function(event){var _this=this,promise;if(event){event.preventDefault()}if(Ember.isNone(this.get("context.validate"))){this.get("controller").send(this.action)}else{if(!Ember.isNone(this.get("context").validate)){promise=this.get("context").validate()}else{promise=this.get("context.content").validate()}promise.then(function(){if(_this.get("context.isValid")){_this.get("controller").send(_this.action)}})}}})})();(function(){Ember.EasyForm.Hint=Ember.EasyForm.BaseView.extend({tagName:"span",init:function(){this._super();this.classNames.push(this.getWrapperConfig("hintClass"))},render:function(buffer){buffer.push(Handlebars.Utils.escapeExpression(this.get("text")))},textChanged:function(){this.rerender()}.observes("text")})})();(function(){Ember.EasyForm.Input=Ember.EasyForm.BaseView.extend({init:function(){this._super();this.classNameBindings.push("showError:"+this.getWrapperConfig("fieldErrorClass"));this.classNames.push(this.getWrapperConfig("inputClass"));Ember.defineProperty(this,"showError",Ember.computed.and("canShowValidationError","context.errors."+this.property+".firstObject"));if(!this.isBlock){if(this.getWrapperConfig("wrapControls")){this.set("templateName","easyForm/wrapped_input")}else{this.set("templateName","easyForm/input")}}},setupValidationDependencies:function(){var keys=this.get("context._dependentValidationKeys"),key;if(keys){for(key in keys){if(keys[key].contains(this.property)){this._keysForValidationDependencies.pushObject(key)}}}}.on("init"),_keysForValidationDependencies:Ember.A(),dependentValidationKeyCanTrigger:false,tagName:"div",classNames:["string"],didInsertElement:function(){this.set("label-field-"+this.elementId+".for",this.get("input-field-"+this.elementId+".elementId"))},concatenatedProperties:["inputOptions","bindableInputOptions"],inputOptions:["as","collection","optionValuePath","optionLabelPath","selection","value"],bindableInputOptions:["placeholder","prompt"],controlsWrapperClass:function(){return this.getWrapperConfig("controlsWrapperClass")}.property(),inputOptionsValues:function(){var options={},i,key,keyBinding,inputOptions=this.inputOptions,bindableInputOptions=this.bindableInputOptions;for(i=0;i= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var hashTypes,hashContexts,escapeExpression=this.escapeExpression;hashTypes={};hashContexts={};data.buffer.push(escapeExpression(helpers._triageMustache.call(depth0,"text",{hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})))}),attributeBindings:["type","disabled"],type:"submit",disabled:function(){return this.get("context.isInvalid")}.property("context.isInvalid"),init:function(){this._super();this.set("context.text",this.value)}})})();(function(){Ember.EasyForm.TextArea=Ember.TextArea.extend()})();(function(){Ember.EasyForm.TextField=Ember.TextField.extend()})();(function(){})();(function(){Ember.TEMPLATES["easyForm/error"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var hashTypes,hashContexts,escapeExpression=this.escapeExpression;hashTypes={};hashContexts={};data.buffer.push(escapeExpression(helpers._triageMustache.call(depth0,"view.errors.firstObject",{hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})))})})();(function(){Ember.TEMPLATES["easyForm/input"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,hashContexts,hashTypes,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression;hashContexts={propertyBinding:depth0,textBinding:depth0};hashTypes={propertyBinding:"STRING",textBinding:"STRING"};options={hash:{propertyBinding:"view.property",textBinding:"view.label"},contexts:[],types:[],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers["label-field"]||depth0["label-field"],stack1?stack1.call(depth0,options):helperMissing.call(depth0,"label-field",options))));hashTypes={};hashContexts={};options={hash:{},contexts:[depth0],types:["STRING"],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers.partial||depth0.partial,stack1?stack1.call(depth0,"easyForm/inputControls",options):helperMissing.call(depth0,"partial","easyForm/inputControls",options))));return buffer})})();(function(){Ember.TEMPLATES["easyForm/inputControls"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,stack2,hashContexts,hashTypes,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var stack1,hashContexts,hashTypes,options;hashContexts={propertyBinding:depth0};hashTypes={propertyBinding:"STRING"};options={hash:{propertyBinding:"view.property"},contexts:[],types:[],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers["error-field"]||depth0["error-field"],stack1?stack1.call(depth0,options):helperMissing.call(depth0,"error-field",options))))}function program3(depth0,data){var stack1,hashContexts,hashTypes,options;hashContexts={propertyBinding:depth0,textBinding:depth0};hashTypes={propertyBinding:"STRING",textBinding:"STRING"};options={hash:{propertyBinding:"view.property",textBinding:"view.hint"},contexts:[],types:[],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers["hint-field"]||depth0["hint-field"],stack1?stack1.call(depth0,options):helperMissing.call(depth0,"hint-field",options))))}hashContexts={propertyBinding:depth0,inputOptionsBinding:depth0};hashTypes={propertyBinding:"STRING",inputOptionsBinding:"STRING"};options={hash:{propertyBinding:"view.property",inputOptionsBinding:"view.inputOptionsValues"},contexts:[],types:[],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers["input-field"]||depth0["input-field"],stack1?stack1.call(depth0,options):helperMissing.call(depth0,"input-field",options))));hashTypes={};hashContexts={};stack2=helpers["if"].call(depth0,"view.showError",{hash:{},inverse:self.noop,fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data});if(stack2||stack2===0){data.buffer.push(stack2)}hashTypes={};hashContexts={};stack2=helpers["if"].call(depth0,"view.hint",{hash:{},inverse:self.noop,fn:self.program(3,program3,data),contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data});if(stack2||stack2===0){data.buffer.push(stack2)}return buffer})})();(function(){Ember.TEMPLATES["easyForm/wrapped_input"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,hashContexts,hashTypes,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression;hashContexts={propertyBinding:depth0,textBinding:depth0};hashTypes={propertyBinding:"STRING",textBinding:"STRING"};options={hash:{propertyBinding:"view.property",textBinding:"view.label"},contexts:[],types:[],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers["label-field"]||depth0["label-field"],stack1?stack1.call(depth0,options):helperMissing.call(depth0,"label-field",options))));data.buffer.push('
');hashTypes={};hashContexts={};options={hash:{},contexts:[depth0],types:["STRING"],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers.partial||depth0.partial,stack1?stack1.call(depth0,"easyForm/inputControls",options):helperMissing.call(depth0,"partial","easyForm/inputControls",options))));data.buffer.push("
");return buffer})})();(function(){Ember.EasyForm.TEMPLATES={}})();(function(){Ember.EasyForm.objectNameFor=function(object){var constructorArray=object.constructor.toString().split(".");return constructorArray[constructorArray.length-1].underscore()};Ember.EasyForm.processOptions=function(property,options){if(options){options.hash.property=property}else{options=property}return options}})();(function(){})();(function($,document,undefined){var pluses=/\+/g;function raw(s){return s}function decoded(s){return unRfc2068(decodeURIComponent(s.replace(pluses," ")))}function unRfc2068(value){if(value.indexOf('"')===0){value=value.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}return value}function fromJSON(value){return config.json?JSON.parse(value):value}var config=$.cookie=function(key,value,options){if(value!==undefined){options=$.extend({},config.defaults,options);if(value===null){options.expires=-1}if(typeof options.expires==="number"){var days=options.expires,t=options.expires=new Date;t.setDate(t.getDate()+days)}value=config.json?JSON.stringify(value):String(value);return document.cookie=[encodeURIComponent(key),"=",config.raw?value:encodeURIComponent(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}var decode=config.raw?raw:decoded;var cookies=document.cookie.split("; ");var result=key?null:{};for(var i=0,l=cookies.length;i=0},_checkResourceController:function(name){return this._pattern().test(name)},_replaceForResource:function(name){return name.replace(this._pattern(),"")},_setNames:function(parsedName){parsedName.fullName=this._replaceForResource(parsedName.fullName);parsedName.fullNameWithoutType=this._replaceForResource(parsedName.fullNameWithoutType);return parsedName.name=this._replaceForResource(parsedName.name)},_pattern:function(){return/([Ss]how)|([Ee]dit)|([Nn]ew)/}})}).call(this);(function(){window.Admin=Ember.Application.extend({Resolver:window.AdminResolver,Router:Ember.Router.extend()})}).call(this);(function(){if(!window.Admin){window.Admin=Ember.Namespace.create()}window.Admin.DSL=Ember.Namespace.create();window.Admin.Logics=Ember.Namespace.create();window.Admin.Base=Ember.Namespace.create();window.Admin.Base.Controllers=Ember.Namespace.create();window.Admin.Base.Views=Ember.Namespace.create();window.Admin.Base.Views.Table=Ember.Namespace.create();window.Admin.Mixins=Ember.Namespace.create();window.Admin.Mixins.Controllers=Ember.Namespace.create();window.Admin.Mixins.Routes=Ember.Namespace.create();window.Admin.Fileupload=Ember.Namespace.create();window.Admin.Adapters=Ember.Namespace.create();window.Admin.Forms=Ember.Namespace.create()}).call(this);(function(){Admin.DSL.Attributes=function(){function Attributes(){}Attributes.detect=function(modelType){return this.withId(modelType)};Attributes.withId=function(modelType){var attrs;attrs=this.withoutId(modelType);attrs.unshift("id");return attrs};Attributes.withoutId=function(modelType){var attributes,_this=this;attributes=[];modelType.eachComputedProperty(function(attribute,meta){if(meta.isAttribute&&_this.systemAttrs(modelType).indexOf(attribute)<0){return attributes.push(attribute)}});this.relations(modelType,attributes,false);return attributes};Attributes.relations=function(modelType,attrs,hasMany){var _this=this;if(attrs==null){attrs=[]}if(hasMany==null){hasMany=true}modelType.eachRelationship(function(attribute,meta){if(hasMany){return attrs.push(attribute)}else{if(meta.kind!=="hasMany"){return attrs.push(attribute)}}});return attrs};Attributes.isBelongsTo=function(modelType,property){var _belongsTo,_this=this;_belongsTo=false;modelType.eachRelationship(function(attribute,meta){if(meta.key===property&&meta.kind==="belongsTo"){return _belongsTo=true}});return _belongsTo};Attributes.relationForType=function(modelType,relation){var type,_this=this;type=void 0;modelType.eachRelationship(function(attribute,meta){if(meta.key===relation){return type=meta.type}});return type};Attributes.systemAttrs=function(modelType){return["created_at","updated_at"]};return Attributes}()}).call(this);(function(){Admin.MetaRoute=function(){function MetaRoute(){}MetaRoute.map=function(router,callback){this.router=router;return callback.call(new Admin.MetaRoute)};MetaRoute.prototype.resources=function(name){var self;self=this;return Admin.MetaRoute.router.map(function(){this.route(name,{path:"/"+name});this.route(""+name+".edit",{path:self._action_edit_path(name)});this.route(""+name+".show",{path:self._action_show_path(name)});return this.route(""+name+".new",{path:self._new_path(name)})})};MetaRoute.prototype._action_show_path=function(name){return"/"+name+"/:id/show"};MetaRoute.prototype._action_edit_path=function(name){return"/"+name+"/:id/edit"};MetaRoute.prototype._new_path=function(name){return"/"+name+"/new"};return MetaRoute}()}).call(this);(function(){Admin.DSL.Navigation=function(){Navigation.content=[];function Navigation(container,parentId){this.parentId=parentId;this.container=container||[]}Navigation.map=function(callback){var navigation;navigation=new Admin.DSL.Navigation;callback.call(navigation);return this.content=navigation.container};Navigation.prototype.navigate=function(title,options,callback){var emberObject,navigateObject;navigateObject={title:title,children:[],divider:false,id:this._uid()};if(this.parentId){navigateObject.parentId=this.parentId}if(options&&typeof options!=="function"){navigateObject=$.extend(navigateObject,options)}this._makeRoute(navigateObject);emberObject=Ember.Object.create(navigateObject);this.container.push(emberObject);if(typeof options==="function"){callback=options}if(callback){emberObject.set("hasChildren",true);callback.call(new Admin.DSL.Navigation(emberObject.get("children"),emberObject.get("id")))}return this.container};Navigation.prototype._makeRoute=function(options){if(options==null){options={}}if(options.route===void 0){return options.route=options.title.underscore()}};Navigation.prototype._uid=function(){return Math.random().toString(36).substr(2,9)};Navigation.findParent=function(obj){var _this=this;return this.content.find(function(item){return item.id===obj.parentId})};return Navigation}()}).call(this);(function(){Admin.Asset=DS.Model.extend({original_filename:DS.attr("string"),content_type:DS.attr("string",{defaultValue:""}),guid:DS.attr("string",{defaultValue:""}),assetable_id:DS.attr("string"),assetable_type:DS.attr("string"),thumb_url:DS.attr("string"),url:DS.attr("string"),type:DS.attr("string",{defaultValue:"Asset"}),is_main:DS.attr("boolean",{defaultValue:false})})}).call(this);(function(){Admin.Logics.Breadcrumbs=Ember.Object.extend();Admin.Logics.Breadcrumbs.reopenClass({setup:function(action,controller,model,breadcrumbs_controller){var content,name,obj;content=[];obj=Ember.Object.create({name:"dashboard",url:this._url("#/"),"class":"first",active:false});content.pushObject(obj);obj=Ember.Object.create({name:controller.get("__controller_name"),url:this._url("#/"+controller.get("__controller_name")),"class":"active",active:true});if(action&&action!=="page"&&model){obj.set("class","");obj.set("active",false);content.pushObject(obj);name=model.get("id")||action;obj=Ember.Object.create({name:name,"class":"active",active:true});content.pushObject(obj)}else{if(controller.get("__controller_name")){content.pushObject(obj)}}breadcrumbs_controller.set("content",content);return this._actions(action,controller)},_url:function(url){if(Admin.Logics.Config.get("namescpace")){return"/%@%@".fmt(Admin.Logics.Config.get("namescpace"),url)}else{return url}},_actions:function(action,controller){var actions;actions=[];switch(action){case"edit":actions.push(this._createAction());actions.push(this._showAction());actions.push(this._destroyAction());break;case"show":actions.push(this._createAction());actions.push(this._editAction());actions.push(this._destroyAction());break;default:actions.push(this._createAction())}return controller.set("__breadcrumbsActionsArray",actions)},_createAction:function(){return"new"},_editAction:function(){return"edit"},_destroyAction:function(){return"destroy"},_showAction:function(){return"show"}})}).call(this);(function(){Admin.Logics.Pagination=Ember.Object.extend();Admin.Logics.Pagination.reopenClass({setup:function(controller,page){var nextPage,prevPage;if(page){nextPage=page+1;prevPage=page-1<1?1:page-1;controller.set("__nextPage",nextPage);return controller.set("__prevPage",prevPage)}else{controller.set("__nextPage",void 0);return controller.set("__prevPage",void 0)}}})}).call(this);(function(){Admin.Logics.SiteTile=Ember.Object.extend();Admin.Logics.SiteTile.reopenClass({setup:function(controllerName,model,action){if(action){if(model.get("id")){return document.title="%@ - %@ - %@".fmt(controllerName,model.get("id"),action)}else{return document.title="%@ - %@".fmt(controllerName,action)}}else{return document.title="%@ - list".fmt(controllerName)}}})}).call(this);(function(){Admin.Mixins.Controllers.AttributesMixin=Ember.Mixin.create({formAttributes:function(){var attrs,_this=this;attrs=this.get("model.formFields")||Admin.DSL.Attributes.withoutId(this.get("model").constructor);return attrs.map(function(attr){return{name:attr}})}.property("modelAttributes.@each"),tableAttributes:function(){return this.get("modelAttributes")}.property("modelAttributes.@each"),fileuploads:function(){if(this.get("model.fileuploads")){return this.get("model.fileuploads").map(function(attr){return{name:attr}})}}.property("model.fileuploads")})}).call(this);(function(){Admin.Mixins.Controllers.BaseActionsMixin=Ember.Mixin.create({collectionActions:[{title:"Edit","class":"btn btn-small btn-primary",action:"edit",iconClass:"glyphicon glyphicon-pencil"},{title:"Show","class":"btn btn-small btn-success",action:"show",iconClass:"glyphicon glyphicon-info-sign"},{title:"Delete",confirm:"are you shure to delete this?","class":"btn btn-small btn-danger",action:"destroy",iconClass:"glyphicon glyphicon-trash"}],actionNew:function(){return{title:"New","class":"btn btn-primary",action:"new",iconClass:"glyphicon glyphicon-plus"}}.property("model"),breadcrumbsActions:function(){return this.get("__breadcrumbsActionsArray")}.property("__breadcrumbsActionsArray"),actions:{"new":function(){return this.transitionToRoute(this._path("new"))},edit:function(model){return this.transitionToRoute(this._path(model,"edit"))},update:function(model){return model.save()},destroy:function(model,batch){if(batch==null){batch=false}if(this.get("model.__list")){model.deleteRecord();this.get("model.items").removeObject(model);if(!batch){this.get("__batches").removeObject(model)}return model.save()}else{return this._destroyItem(model)}},show:function(model){return this.transitionToRoute(this._path(model,"show"))}},_destroyItem:function(model){var _this=this;model.deleteRecord();return model.save().then(function(){return _this.transitionToRoute(_this.get("__controller_name"))})},_path:function(model,type){if(type){return"/%@/%@/%@".fmt(this.get("__controller_name"),model.get("id"),type)}else{return"/%@/%@".fmt(this.get("__controller_name"),model)}}})}).call(this);(function(){Admin.Mixins.Controllers.BatchActionsMixin=Ember.Mixin.create({__batches:[],batchActions:[{title:"delete",confirm:"Are you sure to delete this?",action:"destroy"}],actions:{baseBatchAction:function(action){var _this=this;this.get("__batches").forEach(function(model){return _this.send(action,model,true)});return this.set("__batches",[])}}})}).call(this);(function(){Admin.Mixins.Controllers.FileUploadMixin=Ember.Mixin.create({actions:{createAsset:function(asset,property,view){var _this=this;return asset.save().then(function(){view.set("creating",false);view.clearInput();if(view.get("single")){return _this._createBelongsTo(asset,property)}else{return _this._createHasMany(asset,property)}})},deleteAsset:function(asset,single,property){asset.deleteRecord();asset.save();if(single){return this._deleteBelongsTo(asset,property)}else{return this._deleteHasMany(asset,property)}}},_createBelongsTo:function(asset,property){var state;this.get("model").set(property,asset);if(this.get("model.isDirty")){if(this.get("model.id")){state=DS.RootState.loaded.saved;return this.get("model").set("currentState",state)}}},_createHasMany:function(asset,property){return this.get("model."+property).pushObject(asset)},_deleteBelongsTo:function(asset,property){var _this=this;return asset.one("didDelete",function(){var state;_this.get("model").set(property,null);if(_this.get("model.isDirty")){state=DS.RootState.loaded;return _this.get("model").set("currentState",state.saved)}})},_deleteHasMany:function(asset,property){return this.get("model."+property).removeObject(asset)}})}).call(this);(function(){Admin.Mixins.Controllers.FormActionsMixin=Ember.Mixin.create({actions:{submit:function(redirect){if(redirect==null){redirect=true}if(this.get("model.id")){return this._updateModel(redirect)}else{return this._createModel(redirect)}},cancel:function(){if(this.get("model.isDirty")){this.get("model").rollback()}return this._redirectToTable()}},_redirectToTable:function(){return window.history.back()},_updateModel:function(redirect){var _this=this;return this.get("model").save().then(function(){if(redirect){return _this._redirectToTable()}})},_createModel:function(redirect){var _this=this;return this.get("model").save().then(function(){if(redirect){return _this._redirectToTable()}else{return _this.send("edit",_this.get("model"))}})}})}).call(this);(function(){Admin.Mixins.Controllers.PaginationMixin=Ember.Mixin.create({queryParams:["page","perPage"],page:1,perPage:25,numberOfPages:function(){return Math.ceil(this.get("total")/this.get("perPage")) -}.property("perPage"),actions:{nextPage:function(){if(this.get("page")1){return this.decrementProperty("page")}},changePerPage:function(perPage){return this.set("perPage",perPage)},changePage:function(page){return this.set("page",Number(page))}}})}).call(this);(function(){Admin.Mixins.Routes.ControllerMixin=Ember.Mixin.create({_getForm:function(controller){var form;form="%@_form".fmt(this._controllerName(controller).decamelize());if(Ember.TEMPLATES[form]){return form}return"form"},_getControllerTemplate:function(controller){var name;name=this._controllerName(controller);if(this.action){name="%@/%@".fmt(name,this.action)}if(Ember.TEMPLATES[name]||Ember.TEMPLATES["ember-admin/%@".fmt(name)]){return name}else{if(this.action&&this.action!=="page"){return this.action}else{return"main"}}},_controllerName:function(controller){return controller._debugContainerKey.split(":")[1].replace(/(Show)|(Edit)|(New)|(Page)/,"")},_setActiveRoute:function(controller){var url;url=this._controllerName(controller);if(url==="dashboard"){url=""}return this.controllerFor("navigation").set("activeMenu",url)},_setAction:function(action){if(action!=="index"){return this.action=action}},_checkAction:function(options,target){if(/\./.test(target)){target=target.split(".")[1];if(target){return options.action=target}}},_setupBreadscrumbs:function(controller,model){return Admin.Logics.Breadcrumbs.setup(this.action,controller,model,this.controllerFor("breadcrumbs"))},_setSiteTitle:function(controller,model){return Admin.Logics.SiteTile.setup(this._controllerName(controller),model,this.action)}})}).call(this);(function(){Admin.Mixins.Routes.ModelMixin=Ember.Mixin.create({_find_model:function(modelName,options){if(options.action==="new"){return this.store.createRecord(modelName,{})}if(!options.id){return this.pagination(modelName)}return this.store.find(modelName,options.id)},_setModel:function(controller,model){if(!model){return}if(model.type){return controller.set("model",Ember.Object.create({items:model,__list:true,total:model.meta.total}))}return controller.set("model",model)},_modelName:function(name){if(/\./.test(name)){name=name.split(".")[0]}return Ember.String.singularize(name)}})}).call(this);(function(){Admin.Mixins.Routes.PaginationMixin=Ember.Mixin.create({queryParams:{page:{refreshModel:true},perPage:{refreshModel:true}},pagination:function(modelName){return this.store.find(modelName,{page:this.page,per_page:this.perPage})},_setPage:function(page){return this.page=parseInt(page)||1},_setPerPage:function(perPage){return this.perPage=parseInt(perPage)||25},_setupPaginationInfo:function(controller){controller.set("__controller_name",this._controllerName(controller));return controller.set("__model_name",this.modelName)}})}).call(this);(function(){Admin.MainRoute=Ember.Route.extend(Admin.Mixins.Routes.PaginationMixin,Admin.Mixins.Routes.ModelMixin,Admin.Mixins.Routes.ControllerMixin,{beforeModel:function(transition){this.action=void 0;this.page=void 0;this.perPage=void 0;return this.modelName=this._modelName(transition.targetName)},model:function(options,transition){var e;if(options){if(options.page){this.page=options.page}if(options.perPage){this.perPage=options.perPage}}this._checkAction(options,transition.targetName);if(options.action){this._setAction(options.action)}if(!this.action){this._setPage(this.page);this._setPerPage(this.perPage)}try{if(this.store.modelFor(this.modelName)){return this._find_model(this.modelName,options)}}catch(_error){e=_error}},setupController:function(controller,model){var type;this._setSiteTitle(controller,model);if(model){this._setModel(controller,model);type=model.type||model.constructor;this._setupPaginationInfo(controller);controller.set("modelAttributes",Admin.DSL.Attributes.detect(type));return controller.set("batches",[])}},renderTemplate:function(controller,model){this._setActiveRoute(controller);this._setupBreadscrumbs(controller,model);this.render(this._getControllerTemplate(controller),{outlet:"main",controller:controller});this._renderNavigation(controller,model);this.controllerFor("breadcrumbs").set("resource",model);this._renderBreadcrumbs(controller,model);this._renderActions(controller,model);return this._renderForm(controller,model)},_renderNavigation:function(controller,model){return this.render("navigation",{outlet:"navigation",controller:"navigation"})},_renderBreadcrumbs:function(controller,model){return this.render("breadcrumbs",{outlet:"breadcrumbs",controller:"breadcrumbs"})},_renderActions:function(controller,model){if(model){return this.render("actions",{outlet:"actions",controller:controller})}},_renderForm:function(controller,model){if(this.action&&(this.action==="edit"||this.action==="new")&&this._getControllerTemplate(controller).split("/").length<2){return this.render(this._getForm(controller),{into:this.action,outlet:"form",controller:controller})}}})}).call(this);(function(){Admin.Logics.Config=Ember.Object.create({});Admin.Logics.Config.set("siteTitle","Ember Admin");Admin.Logics.Config.set("mapCenter","50.44067063154785,30.52654266357422")}).call(this);(function(){Admin.Base.Views.BaseActionView=Ember.View.extend({actions:{confirm:function(){return Ember.View.views["ActionModal"].$().modal("hide")}},_showConfirmation:function(){var action,modalView;action=this.get("action")||this.get("context");modalView=Ember.View.views["ActionModal"];modalView.set("action",action);modalView.set("target",this);return modalView.$().modal({})}})}).call(this);(function(){Admin.Base.Controllers.AdminBaseController=Ember.ObjectController.extend(Admin.Mixins.Controllers.BaseActionsMixin,Admin.Mixins.Controllers.FileUploadMixin,Admin.Mixins.Controllers.AttributesMixin,Admin.Mixins.Controllers.PaginationMixin,Admin.Mixins.Controllers.BatchActionsMixin,Admin.Mixins.Controllers.FormActionsMixin)}).call(this);(function(){Admin.Base.Controllers.AdminTableViewController=Admin.Base.Controllers.AdminBaseController.extend({__table:true})}).call(this);(function(){Ember.Handlebars.registerHelper("input-field",function(property,options){var config,configs,context,i,inputOptions,inputType,optionName,propertyType,type;options=Ember.EasyForm.processOptions(property,options);context=this;if(options.hash.propertyBinding){options.hash.property=Ember.Handlebars.get(this,options.hash.propertyBinding,options)}if(options.hash.inputOptionsBinding){options.hash.inputOptions=Ember.Handlebars.get(this,options.hash.inputOptionsBinding,options)}property=options.hash.property;propertyType=function(property){var e;try{return(context.get("content")||context).constructor.metaForProperty(property).type}catch(_error){e=_error;return null}};options.hash.valueBinding=property;options.hash.viewName="input-field-"+options.data.view.elementId;if(options.hash.inputOptions){inputOptions=options.hash.inputOptions;optionName=void 0;for(optionName in inputOptions){if(inputOptions.hasOwnProperty(optionName)){options.hash[optionName]=inputOptions[optionName]}}delete options.hash.inputOptions}if(options.hash.inputConfig){configs=options.hash.inputConfig.split(";");i=configs.length;while(i--){config=configs[i].split(":");options.hash[config[0]]=config[1]}}if(options.hash.as==="text"){return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.TextArea,options)}else if(options.hash.as==="select"){delete options.hash.valueBinding;type=context.get("model").constructor;if(Admin.DSL.Attributes.relations(type).indexOf(property)>=0){options.hash.attribute=property;options.hash.content=context.store.findAll(property);options.hash.selection=context.get(property);options.hash.optionValuePath="context.id";options.hash.optionLabelPath="context.title";options.hash.prompt="Place select %@".fmt(property)}else{options.hash.contentBinding=options.hash.collection;options.hash.selectionBinding=options.hash.selection;options.hash.valueBinding=options.hash.value}return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.Select,options)}else{if(!options.hash.as){if(property.match(/password/)){options.hash.type="password"}else if(property.match(/email/)){options.hash.type="email"}else if(property.match(/url/)){options.hash.type="url"}else if(property.match(/color/)){options.hash.type="color"}else if(property.match(/^tel/)){options.hash.type="tel"}else if(property.match(/search/)){options.hash.type="search"}else{if(propertyType(property)==="number"||typeof context.get(property)==="number"){options.hash.type="number"}else if(propertyType(property)==="date"||!Ember.isNone(context.get(property))&&context.get(property).constructor===Date){options.hash.type="date"}else if(propertyType(property)==="boolean"||!Ember.isNone(context.get(property))&&context.get(property).constructor===Boolean){options.hash.checkedBinding=property;return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.Checkbox,options)}}}else{inputType=Ember.EasyForm.Config.getInputType(options.hash.as);if(inputType){options.hash.property=property;return Ember.Handlebars.helpers.view.call(context,inputType,options)}options.hash.type=options.hash.as}return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.TextField,options)}});Ember.Handlebars.registerHelper("input",function(property,options){options=Ember.EasyForm.processOptions(property,options);if(Admin.Forms.Filters.fileupload(options,property)){return}if(Admin.Forms.Filters.mapField(options,property)){return}Admin.Forms.Filters.as(options,property);options.hash.property=property;options.hash.isBlock=!!options.fn;return Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Input,options)});Ember.Handlebars.registerBoundHelper("bound-input",function(property,options){options=Ember.EasyForm.processOptions(property,options);if(Admin.Forms.Filters.fileupload(options,property)){return}if(Admin.Forms.Filters.mapField(options,property)){return}Admin.Forms.Filters.as(options,property);options.hash.property=property;options.hash.isBlock=!!options.fn;return Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Input,options)});Ember.Handlebars.registerHelper("input-map",function(property,options){options=Ember.EasyForm.processOptions(property,options);options.hash.property=property;options.hash.isBlock=!!options.fn;return Admin.Forms.Filters.map(options,property)});Ember.EasyForm.Select=Ember.Select.extend({attributeBindings:["attribute"],change:function(){var path;path="context.%@".fmt(this.get("attribute"));return this.set(path,this.get("selection"))}});Ember.EasyForm.Form.reopen({submit:function(event){var promise,_this;_this=this;promise=void 0;event.preventDefault();if(this.get("context.isValid")){return this.get("controller").send(this.action)}if(Ember.isNone(this.get("context.isValid"))){return this.get("controller").send(this.action)}else{if(!Ember.isNone(this.get("context").validate)){promise=this.get("context").validate()}else{promise=this.get("context.content").validate()}return promise.then(function(){if(_this.get("context.isValid")){return _this.get("controller").send(_this.action)}})}}})}).call(this);(function(){Admin.Forms.Filters=Ember.Object.extend().reopenClass({fileupload:function(options,property){var context;context=options.contexts[0];return context.get("fileuploads")!==undefined&&context.get("fileuploads").getEach("name").indexOf(property)>=0},mapField:function(options,property){var context,exist;context=options.contexts[0];exist=context.get("asGoogleMap")!==undefined&&context.get("asGoogleMap").indexOf(property)>=0;if(exist){return exist}return context.get("asYandexMap")!==undefined&&context.get("asYandexMap").indexOf(property)>=0},as:function(options,property){var type;type=options.contexts[0].get("model").constructor;if(Admin.DSL.Attributes.relations(type).indexOf(property)>=0){return options.hash.as="select"}},map:function(options,property){var context;context=options.contexts[0];if(context.get("asGoogleMap")){return Ember.Handlebars.helpers.view.call(context,Admin.Base.Views.GmapView,options)}if(context.get("asYandexMap")){return Ember.Handlebars.helpers.view.call(context,Admin.Base.Views.YandexMapView,options)}}})}).call(this);(function(){Ember.Handlebars.registerHelper("fileupload",function(property,options){options.hash.inputOptions=Ember.copy(options.hash);options.hash.property=property;return Ember.Handlebars.helpers.view.call(this,Admin.Fileupload.DragAndDropZoneView,options)});Ember.Handlebars.registerBoundHelper("bound-fileupload",function(property,options){options.hash.inputOptions=Ember.copy(options.hash);options.hash.property=property;return Ember.Handlebars.helpers.view.call(this,Admin.Fileupload.DragAndDropZoneView,options)})}).call(this);(function(){Admin.Base.Views.ActionView=Admin.Base.Views.BaseActionView.extend({classNameBindings:["class"],attributeBindings:["title"],"class":function(){return this.get("action.class")}.property("action"),click:function(){var model;model=this.get("model")||this.get("controller.model");if(this.get("action.confirm")){return this._showConfirmation()}else{return this.get("controller").send(this.get("action.action"),model)}},actions:{confirm:function(){var model;model=this.get("model")||this.get("controller.model");this.get("controller").send(this.get("action.action"),model);return this._super()}},action:function(){if(this.get("breadcrumbAction")){switch(this.get("breadcrumbAction")){case"new":return this.get("controller.actionNew");case"edit":return this._findAction("Edit");case"destroy":return this._findAction("Delete");case"show":return this._findAction("Show");default:return""}}else{return this.get("context")}}.property("context"),title:function(){return this.get("action.title")}.property("action"),_findAction:function(title){var _this=this;return this.get("controller.collectionActions").find(function(action){return action.title===title})},_findAdditionalActions:function(title){var _this=this;return this.get("controller.__additionalActions").find(function(action){return action.title===title})}})}).call(this);(function(){Admin.Base.Views.BatchActionView=Admin.Base.Views.BaseActionView.extend({tagName:"li",click:function(event){event.preventDefault();if(this.get("controller.__batches.length")<1){return}if(this.get("context.confirm")){return this._showConfirmation()}else{return this._batchAction()}},actions:{confirm:function(){this._batchAction();return this._super()}},_batchAction:function(){this.get("controller").send("baseBatchAction",this.get("context.action"));return Ember.View.views["select-all-batches"].set("checked",false)}})}).call(this);(function(){Admin.Base.Views.CheckboxBatchView=Ember.Checkbox.extend({selectAll:false,pushItem:function(){if(this.get("selectAll")){return this._selectAllAction()}if(this.get("checked")){return this._addItem(this.get("context"))}else{return this.get("controller.__batches").removeObject(this.get("context"))}}.observes("checked"),_selectAllAction:function(){var _this=this;this.set("controller.__batches",[]);if(!this.get("checked")){return}return this.get("controller.model.items").forEach(function(item){return _this._addItem(item)})},_addItem:function(item){if(!(this.get("controller.__batches").indexOf(item)>=0)){return this.get("controller.__batches").pushObject(item)}},changeBatchList:function(){if(this.get("selectAll")){return}return this.get("controller.__batches").indexOf(this.get("context"))>=0}.property("controller.__batches.@each"),createObserverOnBatch:function(){this.get("changeBatchList");return this.addObserver("changeBatchList",this,function(){if(this.get("selectAll")){return}if(this.get("changeBatchList")){return this.set("checked",true)}else{return this.set("checked",false)}})}.on("didInsertElement")})}).call(this);(function(){Admin.Base.Views.ButtonView=Ember.View.extend({tagName:"button",classNames:["btn btn-default"],action:"",click:function(){return this.get("controller").send(this.get("action"),this.get("context"))}})}).call(this);(function(){Admin.Base.Views.TextInputView=Ember.TextField.extend({classNames:["form-control"],attributeBindings:["value","readonly"],readonly:function(){return this.get("attributeName")==="id"}.property(),value:function(){return this.get(this.path())}.property("context","attributeName"),path:function(){return"context.%@".fmt(this.get("attributeName"))},focusOut:function(event){return this.get("context").set(this.get("attributeName"),this.get("value"))}})}).call(this);(function(){Admin.Base.Views.AbstractMapView=Ember.View.extend({templateName:"base/_geo",lan:function(){return this.get("context."+this.get("lanAttr"))}.property(),setLan:function(value){return this.get("context").set(this.get("lanAttr"),value)},lanAttr:function(){return this.get("context."+this.get("mapType"))[0]}.property(),lng:function(){return this.get("context."+this.get("lngAttr"))}.property(),lngAttr:function(){return this.get("context."+this.get("mapType"))[1]}.property(),setLng:function(value){return this.get("context").set(this.get("lngAttr"),value)},zoom:function(){return this.get("context."+this.get("zoomAttr"))||8}.property(),zoomAttr:function(){return this.get("context."+this.get("mapType"))[2]}.property(),setZoom:function(value){return this.get("context").set(this.get("zoomAttr"),value)},centerCoords:function(){if(this.get("lan")&&this.get("lng")){return[this.get("lan"),this.get("lng")]}else{return Admin.Logics.Config.get("mapCenter").split(",")}},setAttrs:function(pos){if(pos["push"]){this.setLan(pos[0]);return this.setLng(pos[1])}else{this.setLan(pos.ob);return this.setLng(pos.pb)}}})}).call(this);(function(){Admin.Base.Views.GmapView=Admin.Base.Views.AbstractMapView.extend({templateName:"base/_geo",mapType:"asGoogleMap",initialize:function(){var map,marker,options,_this=this;options={zoom:this.get("zoom"),center:this.get("center"),mapTypeId:this.get("mapTypeId")};map=new google.maps.Map(this.$().find(".map")[0],options);marker=this.initMarker(map);this.initAutocomplete(map,marker);return google.maps.event.addListener(map,"zoom_changed",function(){return _this.setZoom(map.getZoom())})}.on("didInsertElement"),center:function(){var coord;coord=this.centerCoords();return new google.maps.LatLng(coord[0],coord[1])}.property(),mapTypeId:function(){return google.maps.MapTypeId.ROADMAP}.property(),initMarker:function(map){var marker,options,_this=this;options={position:this.get("center"),map:map,draggable:true};marker=new google.maps.Marker(options);google.maps.event.addListener(marker,"dragend",function(event){var pos;map.setCenter(event.latLng);pos=marker.getPosition();return _this.setAttrs(pos)});return marker},initAutocomplete:function(map,marker){var autocomplete,autocompleteView,input,_this=this;autocompleteView=this.get("MapAutocomplete");input=autocompleteView.$()[0];autocomplete=new google.maps.places.Autocomplete(input,{types:["geocode"]});return google.maps.event.addListener(autocomplete,"place_changed",function(){var place,pos;place=autocomplete.getPlace();if(!place.geometry){return}pos=place.geometry.location;if(place.geometry.viewport){map.fitBounds(place.geometry.viewport)}else{map.setCenter(pos);map.setZoom(17)}marker.setPosition(pos);return _this.setAttrs(pos)})}})}).call(this);(function(){Admin.Base.Views.MapAutocompleteView=Ember.TextField.extend({keyPress:function(event){if(event.keyCode===13){return event.preventDefault()}}})}).call(this);(function(){Admin.Base.Views.YandexMapView=Admin.Base.Views.AbstractMapView.extend({mapType:"asYandexMap",templateName:"base/_geo",didInsertElement:function(){var self,_this=this;self=this;console.log(ymaps);return ymaps.ready(function(){return _this.initMap.call(self)})},initMap:function(){var map;map=new ymaps.Map("map_container",{center:this.get("center"),zoom:this.get("zoom")});this.initMarker(map);map.controls.add("zoomControl",{left:5,top:5}).add("typeSelector").add("mapTools",{left:35,top:5});return this.initAutocomplete()},center:function(){return this.centerCoords()}.property(),initMarker:function(map){var mark,_this=this;mark=new ymaps.Placemark(this.get("center"),{iconContent:"1",balloonContent:"",hintContent:""},{preset:"twirl#violetIcon",draggable:true});map.geoObjects.add(mark);return mark.events.add("dragend",function(e){return _this.setAttrs(mark.geometry.getCoordinates())})},initAutocomplete:function(map,marker){var autocompleteView,input;autocompleteView=this.get("MapAutocomplete");return input=autocompleteView.$().hide()}})}).call(this);(function(){Admin.Base.Views.PaginationLinkView=Ember.View.extend({attributeBindings:["href"],tagName:"a",href:"#",click:function(e){e.preventDefault();if(this.get("type")==="next"){this.get("controller").send("nextPage")}else{this.get("controller").send("prevPage")}return window.scrollTo(0,0)}})}).call(this);(function(){Admin.Base.Views.PaginationNumberView=Ember.View.extend({attributeBindings:["href"],tagName:"a",classNameBindings:["isActive:active"],href:"#",isActive:function(){return this.get("controller.page")===this.get("number")}.property("controller.page"),click:function(e){e.preventDefault();if(this.get("number")!=="..."){this.get("controller").send("changePage",this.get("number"));return window.scrollTo(0,0)}}})}).call(this);(function(){Admin.Base.Views.PaginationPagesListView=Ember.View.extend({onePage:function(){return this.get("controller").get("numberOfPages")===1}.property("controller.numberOfPages"),step:5,pages:function(){var currentPage,i,leftEdge,numberOfPages,pages,rightEdge,step;pages=[];numberOfPages=this.get("controller").get("numberOfPages");currentPage=this.get("controller").get("page");step=this.get("step");if(numberOfPages>step+1){leftEdge=currentPage;rightEdge=currentPage+step-1;if(rightEdge>=numberOfPages){rightEdge=numberOfPages;leftEdge=numberOfPages-step+1}i=leftEdge;while(i<=rightEdge){pages.push(i);i++}if(leftEdge>1){pages.unshift("...");pages.unshift(1)}if(rightEdge=0){this.get("fileuploads").forEach(function(attr){return _this.addObserver("context."+_this.get("attributeName")+"."+attr,function(){return this.notifyPropertyChange("value")})});return}if(Admin.DSL.Attributes.relations(this.get("context").constructor).indexOf(this.get("attributeName"))>=0){this.get("relations").forEach(function(attr){return _this.addObserver("context."+_this.get("attributeName")+"."+attr,_this,function(){return this.notifyPropertyChange("value")})});return}return this.addObserver("context."+this.get("attributeName"),this,function(){return this.notifyPropertyChange("value")})}.on("didInsertElement"),value:function(){var record;record=this.get(this.path());if(!record||(!record["get"]||!record.get("id"))){return record}return this.relation(record,this.get("attributeName"))}.property("context"),image_object:function(){return this.get("context."+this.get("attributeName"))}.property("value"),color:function(){if(this.get("attributeName").match(/color/)){this.set("text",true);return this.set("style","color: "+this.get("_value")+";")}}.property("value"),image:function(){if(this.get("context.fileuploads")&&this.get("context.fileuploads").indexOf(this.get("attributeName"))>=0){this.set("text",false);return true}}.property("value"),text:function(){return true}.property("value"),path:function(){return"context.%@".fmt(this.get("attributeName"))},relation:function(record){var value,_this=this;if(!record){return}value="";if(this.get("context.fileuploads")&&this.get("context.fileuploads").indexOf(this.get("attributeName"))>=0){this.get("fileuploads").forEach(function(attr){if(record.get(attr)){return value=record.get(attr)}})}if(Admin.DSL.Attributes.relations(this.get("context").constructor).indexOf(this.get("attributeName"))>=0){this.get("relations").forEach(function(attr){if(record.get(attr)){return value=record.get(attr)}})}return value}})}).call(this);(function(){Admin.Fileupload.AssetView=Admin.Base.Views.BaseActionView.extend({attributeBindings:["templateName","property"],actions:{deleteAsset:function(){return this._showConfirmation()},confirm:function(){this._deleteAsset(this.get("asset"),this.get("parentView.single"));return this._super()}},_deleteAsset:function(asset,single){return this.get("controller").send("deleteAsset",asset,single,this.get("property"))},action:function(){return{title:"Delete",confirm:"Are you shure delete this?"}}.property()})}).call(this);(function(){Admin.Fileupload.DragAndDropZoneView=Ember.View.extend({attributeBindings:["property","assetTemplate"],assetTemplate:"fileuploads/asset",templateName:"fileuploads/drag_and_drop_zone",didInsertElement:function(){return this.get("single")},single:function(){return Admin.DSL.Attributes.isBelongsTo(this.get("context.model").constructor,this.get("property"))}.property("context"),assets:function(){Ember.defineProperty(this,"_assets",Ember.computed(function(){return this.get("context."+this.get("property"))}).property("context."+this.get("property")));return this.get("_assets")}.property("_assets"),asset:function(){Ember.defineProperty(this,"_asset",Ember.computed(function(){return this.get("context."+this.get("property"))}).property("context."+this.get("property")));return this.get("_asset")}.property("_asset"),actions:{selectFile:function(){var file,files,_i,_len,_results;files=event.target.files;_results=[];for(_i=0,_len=files.length;_i<_len;_i++){file=files[_i];_results.push(this.createAsset(file))}return _results}},drop:function(e){var file,files,_i,_len,_results;e.stopPropagation();e.preventDefault();files=e.dataTransfer.files;_results=[];for(_i=0,_len=files.length;_i<_len;_i++){file=files[_i];_results.push(this.createAsset(file))}return _results},dragOver:function(e){e.stopPropagation();e.preventDefault();return e.dataTransfer.dropEffect="copy"},dragLeave:function(e){e.stopPropagation();return e.preventDefault()},dragEnter:function(e){e.stopPropagation();return e.preventDefault()},createAsset:function(file){this.set("creating",true);if(this.get("single")){if(this.get("controller.model."+this.get("property"))){this.get("controller.model."+this.get("property")).deleteRecord();this.get("controller.model."+this.get("property")).save()}return this._createAsset(this._params(file),file)}else{return this._createAsset(this._params(file),file)}},_createAsset:function(params,file){var asset,store;store=this.get("controller.store");asset=store.createRecord(Ember.String.singularize(this.get("property")),$.extend({},params));asset.set("file",file);return this.get("controller").send("createAsset",asset,this.get("property"),this)},_params:function(file){var params;params={assetable_type:this.get("controller.model.__model_name").classify(),content_type:file.type,original_filename:file.name,is_main:true};if(this.get("context.id")){params.assetable_id=this.get("context.id")}if(!this.get("single")){params.is_main=false}return params},clearInput:function(){return this.$().find("input[type=file]").val("")}})}).call(this);(function(){Admin.Fileupload.ImageLinkView=Ember.View.extend({tagName:"a",attributeBindings:["href"],href:"#",templateName:"fileuploads/link_to_image",click:function(e){var imageView;e.preventDefault();imageView=Ember.View.views["FileUploadModal"];imageView.set("image",this.get("image"));return imageView.$().modal({})}})}).call(this);(function(){Admin.NavigationContentView=Ember.View.extend({tagName:"li",classNameBindings:["isActive:active"],isActive:function(){if(this.get("context.route")===this.get("controller.activeMenu")){return true}return this._hasChild()}.property("context","context.children","controller.activeMenu"),url:function(){return"/#%@".fmt(this.get("context.route"))}.property("context.route"),_hasChild:function(){var hasChild,_this=this;if(!this.get("context.children")){return false}hasChild=false;this.get("context.children").forEach(function(item){if(item.route===_this.get("controller.activeMenu")){return hasChild=true}});return hasChild}})}).call(this);(function(){Admin.ApplicationController=Admin.Base.Controllers.AdminTableViewController.extend()}).call(this);(function(){Admin.BreadcrumbsController=Ember.ArrayController.extend()}).call(this);(function(){Admin.DashboardController=Ember.Controller.extend()}).call(this);(function(){Admin.NavigationController=Ember.ArrayController.extend({activeMenu:"dashboard",model:function(){return Admin.DSL.Navigation.content}.property()})}).call(this);(function(){Ember.EasyForm.Config.registerWrapper("twitter-bootstrap",{formClass:"form-horizontal",fieldErrorClass:"has-error",errorClass:"help-inline",hintClass:"help-block",labelClass:"control-label",inputClass:"form-group",wrapControls:true,controlsWrapperClass:"controls"})}).call(this);(function(){Admin.FileuploadAdapterMixin=Ember.Mixin.create({createRecord:function(store,type,record){var adapter,url;url=this.buildURL(type.typeKey);adapter=this;return new Ember.RSVP.Promise(function(resolve,reject){var data,request,str,_this=this;data={};data[type.typeKey]=store.serializerFor(type.typeKey).serialize(record,{includeId:true});if(record["_excludeParams"]){str=$.param(record._excludeParams(data[type.typeKey]))}else{str=$.param(data[type.typeKey])}url="%@?%@".fmt(url,str);data.context=adapter;request=new XMLHttpRequest;request.open("POST",url,true);request.setRequestHeader("Content-Type",record.get("content_type"));request.onreadystatechange=function(){if(request.readyState===4&&(request.status===201||request.status===200)){data=JSON.parse(request.response);return Ember.run(null,resolve,data)}};return request.send(record.get("file"))})}})}).call(this);Ember.TEMPLATES["ember-admin/_form_buttons"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",helper,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression;data.buffer.push(escapeExpression((helper=helpers.submit||depth0&&depth0.submit,options={hash:{"class":"btn btn-default"},hashTypes:{"class":"STRING"},hashContexts:{"class":depth0},contexts:[],types:[],data:data},helper?helper.call(depth0,options):helperMissing.call(depth0,"submit",options))));data.buffer.push("');return buffer});Ember.TEMPLATES["ember-admin/actions"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,self=this;function program1(depth0,data){var stack1;stack1=helpers.view.call(depth0,"Admin.Base.Views.ActionView",{hash:{tagName:"button",href:"#",breadcrumbActionBinding:"action",controllerBinding:"controller"},hashTypes:{tagName:"STRING",href:"STRING",breadcrumbActionBinding:"STRING",controllerBinding:"STRING"},hashContexts:{tagName:depth0,href:depth0,breadcrumbActionBinding:depth0,controllerBinding:depth0},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0],types:["ID"],data:data}); -if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program2(depth0,data){var stack1;stack1=helpers._triageMustache.call(depth0,"view.title",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program4(depth0,data){var buffer="";return buffer}stack1=helpers.each.call(depth0,"action","in","controller.breadcrumbsActions",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/application"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression;data.buffer.push('
');data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"base/modals",options):helperMissing.call(depth0,"partial","base/modals",options))));data.buffer.push('
');stack1=(helper=helpers.outlet||depth0&&depth0.outlet,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"navigation",options):helperMissing.call(depth0,"outlet","navigation",options));if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push('
');stack1=(helper=helpers.outlet||depth0&&depth0.outlet,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"main",options):helperMissing.call(depth0,"outlet","main",options));if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push('
');stack1=(helper=helpers.outlet||depth0&&depth0.outlet,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"footer",options):helperMissing.call(depth0,"outlet","footer",options));if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
");return buffer});Ember.TEMPLATES["ember-admin/base/_geo"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",escapeExpression=this.escapeExpression;data.buffer.push('Geo Input
');data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Base.Views.MapAutocompleteView",{hash:{viewName:"MapAutocomplete"},hashTypes:{viewName:"STRING"},hashContexts:{viewName:depth0},contexts:[depth0],types:["ID"],data:data})));data.buffer.push('
');return buffer});Ember.TEMPLATES["ember-admin/base/_modals"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var buffer="",stack1;data.buffer.push('");return buffer}function program3(depth0,data){var buffer="";return buffer}function program5(depth0,data){var buffer="";data.buffer.push('');return buffer}stack1=helpers.view.call(depth0,"Ember.View",{hash:{elementId:"ActionModal","class":"modal fade"},hashTypes:{elementId:"STRING","class":"STRING"},hashContexts:{elementId:depth0,"class":depth0},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers.view.call(depth0,"Ember.View",{hash:{"class":"file_upload modal fade",elementId:"FileUploadModal"},hashTypes:{"class":"STRING",elementId:"STRING"},hashContexts:{"class":depth0,elementId:depth0},inverse:self.program(3,program3,data),fn:self.program(5,program5,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}return buffer});Ember.TEMPLATES["ember-admin/base/_pagination"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,self=this;function program1(depth0,data){data.buffer.push("25")}function program3(depth0,data){var buffer="";return buffer}function program5(depth0,data){data.buffer.push("50")}function program7(depth0,data){data.buffer.push("100")}function program9(depth0,data){var stack1;stack1=helpers.unless.call(depth0,"view.onePage",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(18,program18,data),fn:self.program(10,program10,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program10(depth0,data){var buffer="",stack1;data.buffer.push('
  • ');stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationLinkView",{hash:{type:"prev"},hashTypes:{type:"STRING"},hashContexts:{type:depth0},inverse:self.program(3,program3,data),fn:self.program(11,program11,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
  • ");stack1=helpers.each.call(depth0,"page","in","view.pages",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(13,program13,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
  • ");stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationLinkView",{hash:{type:"next"},hashTypes:{type:"STRING"},hashContexts:{type:depth0},inverse:self.program(3,program3,data),fn:self.program(16,program16,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
");return buffer}function program11(depth0,data){data.buffer.push("Previous")}function program13(depth0,data){var buffer="",stack1;data.buffer.push("
  • ");stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationNumberView",{hash:{number:"page"},hashTypes:{number:"ID"},hashContexts:{number:depth0},inverse:self.program(3,program3,data),fn:self.program(14,program14,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
  • ");return buffer}function program14(depth0,data){var stack1;stack1=helpers._triageMustache.call(depth0,"view.number",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program16(depth0,data){data.buffer.push("Next")}function program18(depth0,data){data.buffer.push('
    •  
    ')}data.buffer.push('
    ');stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationPerPageView",{hash:{count:25},hashTypes:{count:"INTEGER"},hashContexts:{count:depth0},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationPerPageView",{hash:{count:50},hashTypes:{count:"INTEGER"},hashContexts:{count:depth0},inverse:self.program(3,program3,data),fn:self.program(5,program5,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationPerPageView",{hash:{count:100},hashTypes:{count:"INTEGER"},hashContexts:{count:depth0},inverse:self.program(3,program3,data),fn:self.program(7,program7,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    ");stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationPagesListView",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(9,program9,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push('
    Page ');stack1=helpers._triageMustache.call(depth0,"controller.page",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    ");return buffer});Ember.TEMPLATES["ember-admin/base/_table"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,self=this;function program1(depth0,data){var buffer="",stack1;data.buffer.push("");stack1=helpers._triageMustache.call(depth0,"attributeName",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("");return buffer}function program3(depth0,data){var buffer="";return buffer}function program5(depth0,data){var buffer="",stack1,helper,options;data.buffer.push("");data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Base.Views.CheckboxBatchView",{hash:{contextBinding:"item"},hashTypes:{contextBinding:"STRING"},hashContexts:{contextBinding:depth0},contexts:[depth0],types:["ID"],data:data})));data.buffer.push("");stack1=helpers.each.call(depth0,"attributeName","in","controller.tableAttributes",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(6,program6,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push('');stack1=helpers["if"].call(depth0,"controller.collectionActions",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(8,program8,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"base/actions/_addition_actions",options):helperMissing.call(depth0,"partial","base/actions/_addition_actions",options))));data.buffer.push("");return buffer}function program6(depth0,data){data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Base.Views.Table.TdView",{hash:{contextBinding:"item",attributeNameBinding:"attributeName"},hashTypes:{contextBinding:"STRING",attributeNameBinding:"STRING"},hashContexts:{contextBinding:depth0,attributeNameBinding:depth0},contexts:[depth0],types:["ID"],data:data})))}function program8(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"base/actions/_base_actions",options):helperMissing.call(depth0,"partial","base/actions/_base_actions",options))))}function program10(depth0,data){var stack1;stack1=helpers["if"].call(depth0,"controller.model.items.isLoaded",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(13,program13,data),fn:self.program(11,program11,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program11(depth0,data){data.buffer.push('Empty')}function program13(depth0,data){data.buffer.push('')}data.buffer.push('');data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"base/actions/_batch_actions",options):helperMissing.call(depth0,"partial","base/actions/_batch_actions",options))));data.buffer.push("");stack1=helpers.each.call(depth0,"attributeName","in","controller.tableAttributes",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("");stack1=helpers.each.call(depth0,"item","in","controller.model.items",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(10,program10,data),fn:self.program(5,program5,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    ");data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Base.Views.CheckboxBatchView",{hash:{selectAll:true,elementId:"select-all-batches"},hashTypes:{selectAll:"BOOLEAN",elementId:"STRING"},hashContexts:{selectAll:depth0,elementId:depth0},contexts:[depth0],types:["ID"],data:data})));data.buffer.push("Actions
    ");data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"base/_pagination",options):helperMissing.call(depth0,"partial","base/_pagination",options))));return buffer});Ember.TEMPLATES["ember-admin/base/_td_template"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Fileupload.ImageLinkView",{hash:{imageBinding:"view.image_object"},hashTypes:{imageBinding:"STRING"},hashContexts:{imageBinding:depth0},contexts:[depth0],types:["ID"],data:data})))}function program3(depth0,data){var buffer="";return buffer}function program5(depth0,data){var stack1;stack1=helpers._triageMustache.call(depth0,"view.value",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}stack1=helpers["if"].call(depth0,"view.image",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers["if"].call(depth0,"view.text",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(5,program5,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}return buffer});Ember.TEMPLATES["ember-admin/base/actions/_addition_actions"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var stack1;stack1=helpers.view.call(depth0,"Admin.Base.Views.ActionView",{hash:{tagName:"button",href:"#",contextBinding:"action",modelBinding:"item",titleBinding:"action.title"},hashTypes:{tagName:"STRING",href:"STRING",contextBinding:"STRING",modelBinding:"STRING",titleBinding:"STRING"},hashContexts:{tagName:depth0,href:depth0,contextBinding:depth0,modelBinding:depth0,titleBinding:depth0},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program2(depth0,data){var buffer="";data.buffer.push("");return buffer}function program4(depth0,data){var buffer="";return buffer}stack1=helpers.each.call(depth0,"action","in","controller.additionalActions",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/base/actions/_base_actions"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var stack1;stack1=helpers.view.call(depth0,"Admin.Base.Views.ActionView",{hash:{tagName:"button",href:"#",contextBinding:"action",modelBinding:"item",titleBinding:"action.title"},hashTypes:{tagName:"STRING",href:"STRING",contextBinding:"STRING",modelBinding:"STRING",titleBinding:"STRING"},hashContexts:{tagName:depth0,href:depth0,contextBinding:depth0,modelBinding:depth0,titleBinding:depth0},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program2(depth0,data){var buffer="";data.buffer.push("");return buffer}function program4(depth0,data){var buffer="";return buffer}stack1=helpers.each.call(depth0,"action","in","controller.collectionActions",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/base/actions/_batch_actions"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,self=this;function program1(depth0,data){var stack1;stack1=helpers.view.call(depth0,"Admin.Base.Views.BatchActionView",{hash:{contextBinding:"action"},hashTypes:{contextBinding:"STRING"},hashContexts:{contextBinding:depth0},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program2(depth0,data){var buffer="",stack1;data.buffer.push('');stack1=helpers._triageMustache.call(depth0,"action.title",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("");return buffer}function program4(depth0,data){var buffer="";return buffer}data.buffer.push('
    batch actions
    ");return buffer});Ember.TEMPLATES["ember-admin/breadcrumbs"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var stack1;stack1=helpers["if"].call(depth0,"breadcrumb.active",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program2(depth0,data){var buffer="",stack1;data.buffer.push('");return buffer}function program4(depth0,data){var buffer="",stack1;data.buffer.push('");return buffer}function program6(depth0,data){var buffer="";return buffer}data.buffer.push('");return buffer});Ember.TEMPLATES["ember-admin/dashboard"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};data.buffer.push("

    Dashboard

    ")});Ember.TEMPLATES["ember-admin/edit"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,helperMissing=helpers.helperMissing;data.buffer.push("

    Edit

    ");stack1=(helper=helpers.outlet||depth0&&depth0.outlet,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"form",options):helperMissing.call(depth0,"outlet","form",options));if(stack1||stack1===0){data.buffer.push(stack1)}return buffer});Ember.TEMPLATES["ember-admin/fileuploads/asset"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",escapeExpression=this.escapeExpression;data.buffer.push('');return buffer});Ember.TEMPLATES["ember-admin/fileuploads/drag_and_drop_zone"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var stack1;stack1=helpers["if"].call(depth0,"view.asset",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program2(depth0,data){data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Fileupload.AssetView",{hash:{templateNameBinding:"view.assetTemplate",assetBinding:"view.asset",propertyBinding:"view.property"},hashTypes:{templateNameBinding:"STRING",assetBinding:"STRING",propertyBinding:"STRING"},hashContexts:{templateNameBinding:depth0,assetBinding:depth0,propertyBinding:depth0},contexts:[depth0],types:["ID"],data:data})))}function program4(depth0,data){var buffer="";return buffer}function program6(depth0,data){var stack1;stack1=helpers.each.call(depth0,"asset","in","view.assets",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(7,program7,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program7(depth0,data){data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Fileupload.AssetView",{hash:{templateNameBinding:"view.assetTemplate",assetBinding:"asset",propertyBinding:"view.property"},hashTypes:{templateNameBinding:"STRING",assetBinding:"STRING",propertyBinding:"STRING"},hashContexts:{templateNameBinding:depth0,assetBinding:depth0,propertyBinding:depth0},contexts:[depth0],types:["ID"],data:data})))}function program9(depth0,data){data.buffer.push('')}data.buffer.push('
    ');stack1=helpers["if"].call(depth0,"view.single",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(6,program6,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("');stack1=helpers["if"].call(depth0,"view.creating",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(9,program9,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    ");return buffer});Ember.TEMPLATES["ember-admin/fileuploads/link_to_image"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var buffer="";data.buffer.push("');return buffer}function program3(depth0,data){var buffer="";return buffer}stack1=helpers["if"].call(depth0,"view.image",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/form"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,helper,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var buffer="",stack1,helper,options;stack1=helpers.each.call(depth0,"attribute","in","controller.formAttributes",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers.each.call(depth0,"attribute","in","controller.fileuploads",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(6,program6,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers._triageMustache.call(depth0,"input-map",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"form_buttons",options):helperMissing.call(depth0,"partial","form_buttons",options))));return buffer}function program2(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers["bound-input"]||depth0&&depth0["bound-input"],options={hash:{inputConfig:"class:form-control"},hashTypes:{inputConfig:"STRING"},hashContexts:{inputConfig:depth0},contexts:[depth0],types:["ID"],data:data},helper?helper.call(depth0,"attribute.name",options):helperMissing.call(depth0,"bound-input","attribute.name",options)))) -}function program4(depth0,data){var buffer="";return buffer}function program6(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers["bound-fileupload"]||depth0&&depth0["bound-fileupload"],options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data},helper?helper.call(depth0,"attribute.name",options):helperMissing.call(depth0,"bound-fileupload","attribute.name",options))))}stack1=(helper=helpers["form-for"]||depth0&&depth0["form-for"],options={hash:{wrapper:"twitter-bootstrap"},hashTypes:{wrapper:"STRING"},hashContexts:{wrapper:depth0},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data},helper?helper.call(depth0,"controller.model",options):helperMissing.call(depth0,"form-for","controller.model",options));if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/main"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"base/_table",options):helperMissing.call(depth0,"partial","base/_table",options))))}function program3(depth0,data){var buffer="";return buffer}stack1=helpers["if"].call(depth0,"controller.__table",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/navigation"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"navigation/item",options):helperMissing.call(depth0,"partial","navigation/item",options))))}function program3(depth0,data){var buffer="";return buffer}data.buffer.push('");return buffer});Ember.TEMPLATES["ember-admin/navigation/_collection"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var buffer="",stack1;data.buffer.push('');stack1=helpers._triageMustache.call(depth0,"navigation.title",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push('");return buffer}function program2(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"navigation/item",options):helperMissing.call(depth0,"partial","navigation/item",options))))}function program4(depth0,data){var buffer="";return buffer}stack1=helpers.view.call(depth0,"Admin.NavigationContentView",{hash:{"class":"dropdown",contextBinding:"navigation"},hashTypes:{"class":"STRING",contextBinding:"STRING"},hashContexts:{"class":depth0,contextBinding:depth0},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/navigation/_item"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){data.buffer.push('
  • ')}function program3(depth0,data){var buffer="";return buffer}function program5(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"navigation/collection",options):helperMissing.call(depth0,"partial","navigation/collection",options))))}function program7(depth0,data){var stack1;stack1=helpers.view.call(depth0,"Admin.NavigationContentView",{hash:{contextBinding:"navigation"},hashTypes:{contextBinding:"STRING"},hashContexts:{contextBinding:depth0},inverse:self.program(3,program3,data),fn:self.program(8,program8,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program8(depth0,data){var buffer="",stack1;data.buffer.push("");stack1=helpers._triageMustache.call(depth0,"navigation.title",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("");return buffer}stack1=helpers["if"].call(depth0,"navigation.divider",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers["if"].call(depth0,"navigation.hasChildren",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(7,program7,data),fn:self.program(5,program5,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}return buffer});Ember.TEMPLATES["ember-admin/navigation/_user"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="";return buffer});Ember.TEMPLATES["ember-admin/new"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,helperMissing=helpers.helperMissing;data.buffer.push("

    New");stack1=helpers._triageMustache.call(depth0,"controller.__type",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("

    ");stack1=(helper=helpers.outlet||depth0&&depth0.outlet,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"form",options):helperMissing.call(depth0,"outlet","form",options));if(stack1||stack1===0){data.buffer.push(stack1)}return buffer});Ember.TEMPLATES["ember-admin/show"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var buffer="",stack1;data.buffer.push("");stack1=helpers._triageMustache.call(depth0,"attribute.name",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("");data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Base.Views.Table.TdView",{hash:{contextBinding:"model",attributeNameBinding:"attribute.name"},hashTypes:{contextBinding:"STRING",attributeNameBinding:"STRING"},hashContexts:{contextBinding:depth0,attributeNameBinding:depth0},contexts:[depth0],types:["ID"],data:data})));data.buffer.push("");return buffer}function program3(depth0,data){var buffer="";return buffer}data.buffer.push('

    Show

    ');stack1=helpers.each.call(depth0,"attribute","in","controller.formAttributes",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    ");return buffer}); \ No newline at end of file +(function(){Ember.EasyForm=Ember.Namespace.create({VERSION:"1.0.0.beta.1"})})();(function(){Ember.EasyForm.Config=Ember.Namespace.create({_wrappers:{"default":{formClass:"",fieldErrorClass:"fieldWithErrors",inputClass:"input",errorClass:"error",hintClass:"hint",labelClass:"",wrapControls:false,controlsWrapperClass:""}},_inputTypes:{},registerWrapper:function(name,wrapper){this._wrappers[name]=Ember.$.extend({},this._wrappers["default"],wrapper)},getWrapper:function(name){var wrapper=this._wrappers[name];Ember.assert("The wrapper '"+name+"' was not registered.",wrapper);return wrapper},registerInputType:function(name,type){this._inputTypes[name]=type},getInputType:function(name){return this._inputTypes[name]}})})();(function(){Ember.Handlebars.registerHelper("error-field",function(property,options){options=Ember.EasyForm.processOptions(property,options);if(options.hash.propertyBinding){options.hash.property=Ember.Handlebars.get(this,options.hash.propertyBinding,options)}return Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Error,options)})})();(function(){Ember.Handlebars.registerHelper("form-for",function(object,options){options.hash.contentBinding=object;return Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Form,options)})})();(function(){Ember.Handlebars.registerHelper("hint-field",function(property,options){options=Ember.EasyForm.processOptions(property,options);if(options.hash.text||options.hash.textBinding){return Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Hint,options)}})})();(function(){Ember.Handlebars.registerHelper("input",function(property,options){options=Ember.EasyForm.processOptions(property,options);options.hash.isBlock=!!options.fn;return Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Input,options)})})();(function(){Ember.Handlebars.registerHelper("input-field",function(property,options){options=Ember.EasyForm.processOptions(property,options);if(options.hash.propertyBinding){options.hash.property=Ember.Handlebars.get(this,options.hash.propertyBinding,options)}if(options.hash.inputOptionsBinding){options.hash.inputOptions=Ember.Handlebars.get(this,options.hash.inputOptionsBinding,options)}property=options.hash.property;var context=this,propertyType=function(property){var constructor=(context.get("content")||context).constructor;if(constructor.proto){return Ember.meta(constructor.proto(),false).descs[property]}else{return null}};options.hash.valueBinding=property;options.hash.viewName="input-field-"+options.data.view.elementId;if(options.hash.inputOptions){var inputOptions=options.hash.inputOptions,optionName;for(optionName in inputOptions){if(inputOptions.hasOwnProperty(optionName)){options.hash[optionName]=inputOptions[optionName]}}delete options.hash.inputOptions}if(options.hash.as==="text"){return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.TextArea,options)}else if(options.hash.as==="select"){delete options.hash.valueBinding;options.hash.contentBinding=options.hash.collection;options.hash.selectionBinding=options.hash.selection;options.hash.valueBinding=options.hash.value;if(Ember.isNone(options.hash.selectionBinding)&&Ember.isNone(options.hash.valueBinding)){options.hash.selectionBinding=property}return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.Select,options)}else if(options.hash.as==="checkbox"){if(Ember.isNone(options.hash.checkedBinding)){options.hash.checkedBinding=property}return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.Checkbox,options)}else{if(!options.hash.as){if(property.match(/password/)){options.hash.type="password"}else if(property.match(/email/)){options.hash.type="email"}else if(property.match(/url/)){options.hash.type="url"}else if(property.match(/color/)){options.hash.type="color"}else if(property.match(/^tel/)){options.hash.type="tel"}else if(property.match(/search/)){options.hash.type="search"}else{if(propertyType(property)==="number"||typeof context.get(property)==="number"){options.hash.type="number"}else if(propertyType(property)==="date"||!Ember.isNone(context.get(property))&&context.get(property).constructor===Date){options.hash.type="date"}else if(propertyType(property)==="boolean"||!Ember.isNone(context.get(property))&&context.get(property).constructor===Boolean){options.hash.checkedBinding=property;return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.Checkbox,options)}}}else{var inputType=Ember.EasyForm.Config.getInputType(options.hash.as);if(inputType){return Ember.Handlebars.helpers.view.call(context,inputType,options)}options.hash.type=options.hash.as}return Ember.Handlebars.helpers.view.call(context,Ember.EasyForm.TextField,options)}})})();(function(){Ember.Handlebars.registerHelper("label-field",function(property,options){options=Ember.EasyForm.processOptions(property,options);options.hash.viewName="label-field-"+options.data.view.elementId;return Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Label,options)})})();(function(){Ember.Handlebars.registerHelper("submit",function(value,options){if(typeof value==="object"){options=value;value=undefined}options.hash.context=this;options.hash.value=value||"Submit";return options.hash.as==="button"?Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Button,options):Ember.Handlebars.helpers.view.call(this,Ember.EasyForm.Submit,options)})})();(function(){})();(function(){Ember.EasyForm.BaseView=Ember.View.extend({getWrapperConfig:function(configName){var wrapper=Ember.EasyForm.Config.getWrapper(this.get("wrapper"));return wrapper[configName]},wrapper:Ember.computed(function(){var parentView=this.get("parentView");while(parentView){var config=parentView.get("wrapper");if(config)return config;parentView=parentView.get("parentView")}return"default"})})})();(function(){Ember.EasyForm.Checkbox=Ember.Checkbox.extend()})();(function(){Ember.EasyForm.Error=Ember.EasyForm.BaseView.extend({tagName:"span",init:function(){this._super();this.classNames.push(this.getWrapperConfig("errorClass"));Ember.Binding.from("context.errors."+this.property).to("errors").connect(this)},templateName:"easyForm/error"})})();(function(){Ember.EasyForm.Form=Ember.EasyForm.BaseView.extend({tagName:"form",attributeBindings:["novalidate"],novalidate:"novalidate",wrapper:"default",init:function(){this._super();this.classNames.push(this.getWrapperConfig("formClass"));this.action=this.action||"submit"},submit:function(event){var _this=this,promise;if(event){event.preventDefault()}if(Ember.isNone(this.get("context.validate"))){this.get("controller").send(this.action)}else{if(!Ember.isNone(this.get("context").validate)){promise=this.get("context").validate()}else{promise=this.get("context.content").validate()}promise.then(function(){if(_this.get("context.isValid")){_this.get("controller").send(_this.action)}})}}})})();(function(){Ember.EasyForm.Hint=Ember.EasyForm.BaseView.extend({tagName:"span",init:function(){this._super();this.classNames.push(this.getWrapperConfig("hintClass"))},render:function(buffer){buffer.push(Handlebars.Utils.escapeExpression(this.get("text")))},textChanged:function(){this.rerender()}.observes("text")})})();(function(){Ember.EasyForm.Input=Ember.EasyForm.BaseView.extend({init:function(){this._super();this.classNameBindings.push("showError:"+this.getWrapperConfig("fieldErrorClass"));this.classNames.push(this.getWrapperConfig("inputClass"));Ember.defineProperty(this,"showError",Ember.computed.and("canShowValidationError","context.errors."+this.property+".firstObject"));if(!this.isBlock){if(this.getWrapperConfig("wrapControls")){this.set("templateName","easyForm/wrapped_input")}else{this.set("templateName","easyForm/input")}}},setupValidationDependencies:function(){var keys=this.get("context._dependentValidationKeys"),key;if(keys){for(key in keys){if(keys[key].contains(this.property)){this._keysForValidationDependencies.pushObject(key)}}}}.on("init"),_keysForValidationDependencies:Ember.A(),dependentValidationKeyCanTrigger:false,tagName:"div",classNames:["string"],didInsertElement:function(){this.set("label-field-"+this.elementId+".for",this.get("input-field-"+this.elementId+".elementId"))},concatenatedProperties:["inputOptions","bindableInputOptions"],inputOptions:["as","collection","optionValuePath","optionLabelPath","selection","value"],bindableInputOptions:["placeholder","prompt"],controlsWrapperClass:function(){return this.getWrapperConfig("controlsWrapperClass")}.property(),inputOptionsValues:function(){var options={},i,key,keyBinding,inputOptions=this.inputOptions,bindableInputOptions=this.bindableInputOptions;for(i=0;i= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var hashTypes,hashContexts,escapeExpression=this.escapeExpression;hashTypes={};hashContexts={};data.buffer.push(escapeExpression(helpers._triageMustache.call(depth0,"text",{hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})))}),attributeBindings:["type","disabled"],type:"submit",disabled:function(){return this.get("context.isInvalid")}.property("context.isInvalid"),init:function(){this._super();this.set("context.text",this.value)}})})();(function(){Ember.EasyForm.TextArea=Ember.TextArea.extend()})();(function(){Ember.EasyForm.TextField=Ember.TextField.extend()})();(function(){})();(function(){Ember.TEMPLATES["easyForm/error"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var hashTypes,hashContexts,escapeExpression=this.escapeExpression;hashTypes={};hashContexts={};data.buffer.push(escapeExpression(helpers._triageMustache.call(depth0,"view.errors.firstObject",{hash:{},contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data})))})})();(function(){Ember.TEMPLATES["easyForm/input"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,hashContexts,hashTypes,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression;hashContexts={propertyBinding:depth0,textBinding:depth0};hashTypes={propertyBinding:"STRING",textBinding:"STRING"};options={hash:{propertyBinding:"view.property",textBinding:"view.label"},contexts:[],types:[],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers["label-field"]||depth0["label-field"],stack1?stack1.call(depth0,options):helperMissing.call(depth0,"label-field",options))));hashTypes={};hashContexts={};options={hash:{},contexts:[depth0],types:["STRING"],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers.partial||depth0.partial,stack1?stack1.call(depth0,"easyForm/inputControls",options):helperMissing.call(depth0,"partial","easyForm/inputControls",options))));return buffer})})();(function(){Ember.TEMPLATES["easyForm/inputControls"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,stack2,hashContexts,hashTypes,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var stack1,hashContexts,hashTypes,options;hashContexts={propertyBinding:depth0};hashTypes={propertyBinding:"STRING"};options={hash:{propertyBinding:"view.property"},contexts:[],types:[],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers["error-field"]||depth0["error-field"],stack1?stack1.call(depth0,options):helperMissing.call(depth0,"error-field",options))))}function program3(depth0,data){var stack1,hashContexts,hashTypes,options;hashContexts={propertyBinding:depth0,textBinding:depth0};hashTypes={propertyBinding:"STRING",textBinding:"STRING"};options={hash:{propertyBinding:"view.property",textBinding:"view.hint"},contexts:[],types:[],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers["hint-field"]||depth0["hint-field"],stack1?stack1.call(depth0,options):helperMissing.call(depth0,"hint-field",options))))}hashContexts={propertyBinding:depth0,inputOptionsBinding:depth0};hashTypes={propertyBinding:"STRING",inputOptionsBinding:"STRING"};options={hash:{propertyBinding:"view.property",inputOptionsBinding:"view.inputOptionsValues"},contexts:[],types:[],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers["input-field"]||depth0["input-field"],stack1?stack1.call(depth0,options):helperMissing.call(depth0,"input-field",options))));hashTypes={};hashContexts={};stack2=helpers["if"].call(depth0,"view.showError",{hash:{},inverse:self.noop,fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data});if(stack2||stack2===0){data.buffer.push(stack2)}hashTypes={};hashContexts={};stack2=helpers["if"].call(depth0,"view.hint",{hash:{},inverse:self.noop,fn:self.program(3,program3,data),contexts:[depth0],types:["ID"],hashContexts:hashContexts,hashTypes:hashTypes,data:data});if(stack2||stack2===0){data.buffer.push(stack2)}return buffer})})();(function(){Ember.TEMPLATES["easyForm/wrapped_input"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,hashContexts,hashTypes,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression;hashContexts={propertyBinding:depth0,textBinding:depth0};hashTypes={propertyBinding:"STRING",textBinding:"STRING"};options={hash:{propertyBinding:"view.property",textBinding:"view.label"},contexts:[],types:[],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers["label-field"]||depth0["label-field"],stack1?stack1.call(depth0,options):helperMissing.call(depth0,"label-field",options))));data.buffer.push('
    ');hashTypes={};hashContexts={};options={hash:{},contexts:[depth0],types:["STRING"],hashContexts:hashContexts,hashTypes:hashTypes,data:data};data.buffer.push(escapeExpression((stack1=helpers.partial||depth0.partial,stack1?stack1.call(depth0,"easyForm/inputControls",options):helperMissing.call(depth0,"partial","easyForm/inputControls",options))));data.buffer.push("
    ");return buffer})})();(function(){Ember.EasyForm.TEMPLATES={}})();(function(){Ember.EasyForm.objectNameFor=function(object){var constructorArray=object.constructor.toString().split(".");return constructorArray[constructorArray.length-1].underscore()};Ember.EasyForm.processOptions=function(property,options){if(options){options.hash.property=property}else{options=property}return options}})();(function(){})();(function(){window.EmberEasyDecorator=Ember.Object.extend(Ember.Evented,Ember.ActionHandler,{init:function(){return this._super()},attributes:Ember.computed(function(){return Ember.get(this.constructor,"attributes")}).property(),unknownProperty:function(propertyName){var modelProperty;if(/Value$/.test(propertyName)){modelProperty=propertyName.substr(0,propertyName.length-5);return this.get("model.%@".fmt(modelProperty))}if(/SectionFields$/.test(propertyName)){return this._createSectionComputed(propertyName)}},_createSectionComputed:function(propertyName){var fields,section;section=propertyName.substr(0,propertyName.length-13);console.log(section);fields=this.get("attributes").keys.list.filter(function(_this){return function(key){return _this.get("attributes").get(key).options.section===section}}(this));fields=fields.map(function(_this){return function(field){return _this.get("attributes").get(field)}}(this));fields=this._sort(fields);this.set(propertyName,fields);return fields},_sort:function(array,type){if(type==null){type="asc"}switch(type){case"asc":return array.sort(function(a,b){return a.options.order-b.options.order});case"desc":return array.sort(function(a,b){return b.options.order-a.options.order})}}});EmberEasyDecorator.reopenClass({attributes:Ember.computed(function(){var map;map=Ember.Map.create();this.eachComputedProperty(function(name,meta){if(meta.isAttribute){meta.name=name;return map.set(name,meta)}});return map})});EmberEasyDecorator.element=function(type,options,html){var meta;options=options||{};html=html||{};meta={type:type,isAttribute:true,html:html,options:options};return Ember.computed(function(key){return this.get("attributes").get(key)}).property().meta(meta)};window.EED=EmberEasyDecorator;Ember.Handlebars.helper("decorator-input",function(property,options){var element,_ref;options=$.extend({},options);element=this.get("decorator.%@".fmt(property));if((element!=null?(_ref=element.options)!=null?_ref.isVisible:void 0:void 0)===false){return}$.extend(options.hash,element.html);if(element.type==="nested_attributes"){options.hash.templateName=element.options.templateName;options.hash.contextBinding="controller.decorator";options.hash.controllerBinding="controller.decorator";return Ember.Handlebars.helpers.view.call(this,Ember.View,options)}options.hash.as=element.type;if(element.type==="select"){options.hash.collection=options.hash.collection||"controller.decorator.%@Collection".fmt(property);if(element.options.relation){options.hash.optionValuePath=options.hash.optionValuePath||"content.id";options.hash.optionLabelPath=options.hash.optionLabelPath||"content.value"}else{options.hash.optionValuePath=options.hash.optionValuePath||"content";options.hash.optionLabelPath=options.hash.optionLabelPath||"content"}}return Ember.Handlebars.helpers["input"].call(this,property,options)});Ember.Handlebars.helper("decorator-section",function(section,options){var elements;elements=this.get("decorator.%@SectionFields".fmt(section));return elements.forEach(function(_this){return function(element){options=$.extend({},options);"collection optionValuePath optionLabelPath placeholder value prompt readonly label type".w().forEach(function(attr){return delete options.hash[attr]});return Ember.Handlebars.helpers["decorator-input"].call(_this,element.name,options)}}(this))})}).call(this);(function($,document,undefined){var pluses=/\+/g;function raw(s){return s}function decoded(s){return unRfc2068(decodeURIComponent(s.replace(pluses," ")))}function unRfc2068(value){if(value.indexOf('"')===0){value=value.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\")}return value}function fromJSON(value){return config.json?JSON.parse(value):value}var config=$.cookie=function(key,value,options){if(value!==undefined){options=$.extend({},config.defaults,options);if(value===null){options.expires=-1}if(typeof options.expires==="number"){var days=options.expires,t=options.expires=new Date;t.setDate(t.getDate()+days)}value=config.json?JSON.stringify(value):String(value);return document.cookie=[encodeURIComponent(key),"=",config.raw?value:encodeURIComponent(value),options.expires?"; expires="+options.expires.toUTCString():"",options.path?"; path="+options.path:"",options.domain?"; domain="+options.domain:"",options.secure?"; secure":""].join("")}var decode=config.raw?raw:decoded;var cookies=document.cookie.split("; ");var result=key?null:{};for(var i=0,l=cookies.length;i=0},_checkResourceController:function(name){return this._pattern().test(name)},_replaceForResource:function(name){return name.replace(this._pattern(),"")},_setNames:function(parsedName){parsedName.fullName=this._replaceForResource(parsedName.fullName);parsedName.fullNameWithoutType=this._replaceForResource(parsedName.fullNameWithoutType);return parsedName.name=this._replaceForResource(parsedName.name)},_pattern:function(){return/([Ss]how)|([Ee]dit)|([Nn]ew)/}})}).call(this);(function(){window.Admin=Ember.Application.extend({Resolver:window.AdminResolver,Router:Ember.Router.extend()})}).call(this);(function(){if(!window.Admin){window.Admin=Ember.Namespace.create()}window.Admin.DSL=Ember.Namespace.create();window.Admin.Logics=Ember.Namespace.create();window.Admin.Base=Ember.Namespace.create();window.Admin.Base.Controllers=Ember.Namespace.create();window.Admin.Base.Views=Ember.Namespace.create();window.Admin.Base.Views.Table=Ember.Namespace.create();window.Admin.Mixins=Ember.Namespace.create();window.Admin.Mixins.Controllers=Ember.Namespace.create();window.Admin.Mixins.Routes=Ember.Namespace.create();window.Admin.Fileupload=Ember.Namespace.create();window.Admin.Adapters=Ember.Namespace.create();window.Admin.Forms=Ember.Namespace.create()}).call(this);(function(){Admin.DSL.Attributes=function(){function Attributes(){}Attributes.detect=function(modelType){return this.withId(modelType)};Attributes.withId=function(modelType){var attrs;attrs=this.withoutId(modelType);attrs.unshift("id");return attrs};Attributes.withoutId=function(modelType){var attributes,_this=this;attributes=[];modelType.eachComputedProperty(function(attribute,meta){if(meta.isAttribute&&_this.systemAttrs(modelType).indexOf(attribute)<0){return attributes.push(attribute)}});this.relations(modelType,attributes,false);return attributes};Attributes.relations=function(modelType,attrs,hasMany){var _this=this;if(attrs==null){attrs=[]}if(hasMany==null){hasMany=true}modelType.eachRelationship(function(attribute,meta){if(hasMany){return attrs.push(attribute)}else{if(meta.kind!=="hasMany"){return attrs.push(attribute)}}});return attrs};Attributes.isBelongsTo=function(modelType,property){var _belongsTo,_this=this;_belongsTo=false;modelType.eachRelationship(function(attribute,meta){if(meta.key===property&&meta.kind==="belongsTo"){return _belongsTo=true}});return _belongsTo};Attributes.relationForType=function(modelType,relation){var type,_this=this;type=void 0;modelType.eachRelationship(function(attribute,meta){if(meta.key===relation){return type=meta.type}});return type};Attributes.systemAttrs=function(modelType){return["created_at","updated_at"]};return Attributes}()}).call(this);(function(){Admin.MetaRoute=function(){function MetaRoute(){}MetaRoute.map=function(router,callback){this.router=router;return callback.call(new Admin.MetaRoute)};MetaRoute.prototype.resources=function(name){var self;self=this;return Admin.MetaRoute.router.map(function(){this.route(name,{path:"/"+name});this.route(""+name+".edit",{path:self._action_edit_path(name)});this.route(""+name+".show",{path:self._action_show_path(name)});return this.route(""+name+".new",{path:self._new_path(name)})})};MetaRoute.prototype._action_show_path=function(name){return"/"+name+"/:id/show"};MetaRoute.prototype._action_edit_path=function(name){return"/"+name+"/:id/edit"};MetaRoute.prototype._new_path=function(name){return"/"+name+"/new"};return MetaRoute}()}).call(this);(function(){Admin.DSL.Navigation=function(){Navigation.content=[];function Navigation(container,parentId){this.parentId=parentId;this.container=container||[]}Navigation.map=function(callback){var navigation;navigation=new Admin.DSL.Navigation;callback.call(navigation);return this.content=navigation.container};Navigation.prototype.navigate=function(title,options,callback){var emberObject,navigateObject;navigateObject={title:title,children:[],divider:false,id:this._uid()};if(this.parentId){navigateObject.parentId=this.parentId}if(options&&typeof options!=="function"){navigateObject=$.extend(navigateObject,options)}this._makeRoute(navigateObject);emberObject=Ember.Object.create(navigateObject);this.container.push(emberObject);if(typeof options==="function"){callback=options}if(callback){emberObject.set("hasChildren",true);callback.call(new Admin.DSL.Navigation(emberObject.get("children"),emberObject.get("id")))}return this.container};Navigation.prototype._makeRoute=function(options){if(options==null){options={}}if(options.route===void 0){return options.route=options.title.underscore()}};Navigation.prototype._uid=function(){return Math.random().toString(36).substr(2,9)};Navigation.findParent=function(obj){var _this=this;return this.content.find(function(item){return item.id===obj.parentId})};return Navigation}()}).call(this);(function(){Admin.Asset=DS.Model.extend({original_filename:DS.attr("string"),content_type:DS.attr("string",{defaultValue:""}),guid:DS.attr("string",{defaultValue:""}),assetable_id:DS.attr("string"),assetable_type:DS.attr("string"),thumb_url:DS.attr("string"),url:DS.attr("string"),type:DS.attr("string",{defaultValue:"Asset"}),is_main:DS.attr("boolean",{defaultValue:false})})}).call(this);(function(){Admin.Logics.Breadcrumbs=Ember.Object.extend();Admin.Logics.Breadcrumbs.reopenClass({setup:function(action,controller,model,breadcrumbs_controller){var content,name,obj;content=[];obj=Ember.Object.create({name:"dashboard",url:this._url("#/"),"class":"first",active:false});content.pushObject(obj);obj=Ember.Object.create({name:controller.get("__controller_name"),url:this._url("#/"+controller.get("__controller_name")),"class":"active",active:true});if(action&&action!=="page"&&model){obj.set("class","");obj.set("active",false);content.pushObject(obj);name=model.get("id")||action;obj=Ember.Object.create({name:name,"class":"active",active:true});content.pushObject(obj)}else{if(controller.get("__controller_name")){content.pushObject(obj)}}breadcrumbs_controller.set("content",content);return this._actions(action,controller)},_url:function(url){if(Admin.Logics.Config.get("namescpace")){return"/%@%@".fmt(Admin.Logics.Config.get("namescpace"),url)}else{return url}},_actions:function(action,controller){var actions;actions=[];switch(action){case"edit":actions.push(this._createAction());actions.push(this._showAction());actions.push(this._destroyAction());break;case"show":actions.push(this._createAction());actions.push(this._editAction());actions.push(this._destroyAction());break;default:actions.push(this._createAction())}return controller.set("__breadcrumbsActionsArray",actions)},_createAction:function(){return"new"},_editAction:function(){return"edit"},_destroyAction:function(){return"destroy"},_showAction:function(){return"show"}})}).call(this);(function(){Admin.Logics.Pagination=Ember.Object.extend();Admin.Logics.Pagination.reopenClass({setup:function(controller,page){var nextPage,prevPage;if(page){nextPage=page+1;prevPage=page-1<1?1:page-1;controller.set("__nextPage",nextPage);return controller.set("__prevPage",prevPage)}else{controller.set("__nextPage",void 0);return controller.set("__prevPage",void 0)}}})}).call(this);(function(){Admin.Logics.SiteTile=Ember.Object.extend();Admin.Logics.SiteTile.reopenClass({setup:function(controllerName,model,action){if(action){if(model.get("id")){return document.title="%@ - %@ - %@".fmt(controllerName,model.get("id"),action)}else{return document.title="%@ - %@".fmt(controllerName,action)}}else{return document.title="%@ - list".fmt(controllerName)}}})}).call(this);(function(){Admin.Mixins.Controllers.AttributesMixin=Ember.Mixin.create({formAttributes:function(){var attrs,_this=this;attrs=this.get("model.formFields")||Admin.DSL.Attributes.withoutId(this.get("model").constructor);return attrs.map(function(attr){return{name:attr}})}.property("modelAttributes.@each"),tableAttributes:function(){return this.get("modelAttributes")}.property("modelAttributes.@each"),fileuploads:function(){if(this.get("model.fileuploads")){return this.get("model.fileuploads").map(function(attr){return{name:attr}})}}.property("model.fileuploads")})}).call(this);(function(){Admin.Mixins.Controllers.BaseActionsMixin=Ember.Mixin.create({collectionActions:[{title:"Edit","class":"btn btn-small btn-primary",action:"edit",iconClass:"glyphicon glyphicon-pencil"},{title:"Show","class":"btn btn-small btn-success",action:"show",iconClass:"glyphicon glyphicon-info-sign"},{title:"Delete",confirm:"are you shure to delete this?","class":"btn btn-small btn-danger",action:"destroy",iconClass:"glyphicon glyphicon-trash"}],actionNew:function(){return{title:"New","class":"btn btn-primary",action:"new",iconClass:"glyphicon glyphicon-plus"}}.property("model"),breadcrumbsActions:function(){return this.get("__breadcrumbsActionsArray")}.property("__breadcrumbsActionsArray"),actions:{"new":function(){return this.transitionToRoute(this._path("new")) +},edit:function(model){return this.transitionToRoute(this._path(model,"edit"))},update:function(model){return model.save()},destroy:function(model,batch){if(batch==null){batch=false}if(this.get("model.__list")){model.deleteRecord();this.get("model.items").removeObject(model);if(!batch){this.get("__batches").removeObject(model)}return model.save()}else{return this._destroyItem(model)}},show:function(model){return this.transitionToRoute(this._path(model,"show"))}},_destroyItem:function(model){var _this=this;model.deleteRecord();return model.save().then(function(){return _this.transitionToRoute(_this.get("__controller_name"))})},_path:function(model,type){if(type){return"/%@/%@/%@".fmt(this.get("__controller_name"),model.get("id"),type)}else{return"/%@/%@".fmt(this.get("__controller_name"),model)}}})}).call(this);(function(){Admin.Mixins.Controllers.BatchActionsMixin=Ember.Mixin.create({__batches:[],batchActions:[{title:"delete",confirm:"Are you sure to delete this?",action:"destroy"}],actions:{baseBatchAction:function(action){var _this=this;this.get("__batches").forEach(function(model){return _this.send(action,model,true)});return this.set("__batches",[])}}})}).call(this);(function(){Admin.Mixins.Controllers.FileUploadMixin=Ember.Mixin.create({actions:{createAsset:function(asset,property,view){var _this=this;return asset.save().then(function(){view.set("creating",false);view.clearInput();if(view.get("single")){return _this._createBelongsTo(asset,property)}else{return _this._createHasMany(asset,property)}})},deleteAsset:function(asset,single,property){asset.deleteRecord();asset.save();if(single){return this._deleteBelongsTo(asset,property)}else{return this._deleteHasMany(asset,property)}}},_createBelongsTo:function(asset,property){var state;this.get("model").set(property,asset);if(this.get("model.isDirty")){if(this.get("model.id")){state=DS.RootState.loaded.saved;return this.get("model").set("currentState",state)}}},_createHasMany:function(asset,property){return this.get("model."+property).pushObject(asset)},_deleteBelongsTo:function(asset,property){var _this=this;return asset.one("didDelete",function(){var state;_this.get("model").set(property,null);if(_this.get("model.isDirty")){state=DS.RootState.loaded;return _this.get("model").set("currentState",state.saved)}})},_deleteHasMany:function(asset,property){return this.get("model."+property).removeObject(asset)}})}).call(this);(function(){Admin.Mixins.Controllers.FormActionsMixin=Ember.Mixin.create({actions:{submit:function(redirect){if(redirect==null){redirect=true}if(this.get("model.id")){return this._updateModel(redirect)}else{return this._createModel(redirect)}},cancel:function(){if(this.get("model.isDirty")){this.get("model").rollback()}return this._redirectToTable()}},_redirectToTable:function(){return window.history.back()},_updateModel:function(redirect){var _this=this;return this.get("model").save().then(function(){if(redirect){return _this._redirectToTable()}})},_createModel:function(redirect){var _this=this;return this.get("model").save().then(function(){if(redirect){return _this._redirectToTable()}else{return _this.send("edit",_this.get("model"))}})}})}).call(this);(function(){Admin.Mixins.Controllers.PaginationMixin=Ember.Mixin.create({queryParams:["page","perPage"],page:1,perPage:25,numberOfPages:function(){return Math.ceil(this.get("total")/this.get("perPage"))}.property("perPage"),actions:{nextPage:function(){if(this.get("page")1){return this.decrementProperty("page")}},changePerPage:function(perPage){return this.set("perPage",perPage)},changePage:function(page){return this.set("page",Number(page))}}})}).call(this);(function(){Admin.Mixins.Routes.ControllerMixin=Ember.Mixin.create({_getForm:function(controller){var form;form="%@_form".fmt(this._controllerName(controller).decamelize());if(Ember.TEMPLATES[form]){return form}return"form"},_getControllerTemplate:function(controller){var name;name=this._controllerName(controller);if(this.action){name="%@/%@".fmt(name,this.action)}if(Ember.TEMPLATES[name]||Ember.TEMPLATES["ember-admin/%@".fmt(name)]){return name}else{if(this.action&&this.action!=="page"){return this.action}else{return"main"}}},_controllerName:function(controller){return controller._debugContainerKey.split(":")[1].replace(/(Show)|(Edit)|(New)|(Page)/,"")},_setActiveRoute:function(controller){var url;url=this._controllerName(controller);if(url==="dashboard"){url=""}return this.controllerFor("navigation").set("activeMenu",url)},_setAction:function(action){if(action!=="index"){return this.action=action}},_checkAction:function(options,target){if(/\./.test(target)){target=target.split(".")[1];if(target){return options.action=target}}},_setupBreadscrumbs:function(controller,model){return Admin.Logics.Breadcrumbs.setup(this.action,controller,model,this.controllerFor("breadcrumbs"))},_setSiteTitle:function(controller,model){return Admin.Logics.SiteTile.setup(this._controllerName(controller),model,this.action)}})}).call(this);(function(){Admin.Mixins.Routes.ModelMixin=Ember.Mixin.create({_find_model:function(modelName,options){if(options.action==="new"){return this.store.createRecord(modelName,{})}if(!options.id){return this.pagination(modelName)}return this.store.find(modelName,options.id)},_setModel:function(controller,model){if(!model){return}if(model.type){return controller.set("model",Ember.Object.create({items:model,__list:true,total:model.meta.total}))}return controller.set("model",model)},_modelName:function(name){if(/\./.test(name)){name=name.split(".")[0]}return Ember.String.singularize(name)}})}).call(this);(function(){Admin.Mixins.Routes.PaginationMixin=Ember.Mixin.create({queryParams:{page:{refreshModel:true},perPage:{refreshModel:true}},pagination:function(modelName){return this.store.find(modelName,{page:this.page,per_page:this.perPage})},_setPage:function(page){return this.page=parseInt(page)||1},_setPerPage:function(perPage){return this.perPage=parseInt(perPage)||25},_setupPaginationInfo:function(controller){controller.set("__controller_name",this._controllerName(controller));return controller.set("__model_name",this.modelName)}})}).call(this);(function(){Admin.MainRoute=Ember.Route.extend(Admin.Mixins.Routes.PaginationMixin,Admin.Mixins.Routes.ModelMixin,Admin.Mixins.Routes.ControllerMixin,{beforeModel:function(transition){this.action=void 0;this.page=void 0;this.perPage=void 0;return this.modelName=this._modelName(transition.targetName)},model:function(options,transition){var e;if(options){if(options.page){this.page=options.page}if(options.perPage){this.perPage=options.perPage}}this._checkAction(options,transition.targetName);if(options.action){this._setAction(options.action)}if(!this.action){this._setPage(this.page);this._setPerPage(this.perPage)}try{if(this.store.modelFor(this.modelName)){return this._find_model(this.modelName,options)}}catch(_error){e=_error}},setupController:function(controller,model){var type;this._setSiteTitle(controller,model);if(model){this._setModel(controller,model);type=model.type||model.constructor;this._setupPaginationInfo(controller);controller.set("modelAttributes",Admin.DSL.Attributes.detect(type));return controller.set("batches",[])}},renderTemplate:function(controller,model){this._setActiveRoute(controller);this._setupBreadscrumbs(controller,model);this.render(this._getControllerTemplate(controller),{outlet:"main",controller:controller});this._renderNavigation(controller,model);this.controllerFor("breadcrumbs").set("resource",model);this._renderBreadcrumbs(controller,model);this._renderActions(controller,model);return this._renderForm(controller,model)},_renderNavigation:function(controller,model){return this.render("navigation",{outlet:"navigation",controller:"navigation"})},_renderBreadcrumbs:function(controller,model){return this.render("breadcrumbs",{outlet:"breadcrumbs",controller:"breadcrumbs"})},_renderActions:function(controller,model){if(model){return this.render("actions",{outlet:"actions",controller:controller})}},_renderForm:function(controller,model){if(this.action&&(this.action==="edit"||this.action==="new")&&this._getControllerTemplate(controller).split("/").length<2){return this.render(this._getForm(controller),{into:this.action,outlet:"form",controller:controller})}}})}).call(this);(function(){Admin.Logics.Config=Ember.Object.create({});Admin.Logics.Config.set("siteTitle","Ember Admin");Admin.Logics.Config.set("mapCenter","50.44067063154785,30.52654266357422")}).call(this);(function(){Admin.Base.Views.BaseActionView=Ember.View.extend({actions:{confirm:function(){return Ember.View.views["ActionModal"].$().modal("hide")}},_showConfirmation:function(){var action,modalView;action=this.get("action")||this.get("context");modalView=Ember.View.views["ActionModal"];modalView.set("action",action);modalView.set("target",this);return modalView.$().modal({})}})}).call(this);(function(){Admin.Base.Controllers.AdminBaseController=Ember.ObjectController.extend(Admin.Mixins.Controllers.BaseActionsMixin,Admin.Mixins.Controllers.FileUploadMixin,Admin.Mixins.Controllers.AttributesMixin,Admin.Mixins.Controllers.PaginationMixin,Admin.Mixins.Controllers.BatchActionsMixin,Admin.Mixins.Controllers.FormActionsMixin,{decorator:function(){if(this.get("model")){return Admin.BaseDecorator.create({model:this.get("model")})}}.property("model")})}).call(this);(function(){Admin.Base.Controllers.AdminTableViewController=Admin.Base.Controllers.AdminBaseController.extend({__table:true})}).call(this);(function(){Ember.EasyForm.Form.reopen({submit:function(event){var promise,_this;_this=this;promise=void 0;event.preventDefault();if(this.get("context.isValid")){return this.get("controller").send(this.action)}if(Ember.isNone(this.get("context.isValid"))){return this.get("controller").send(this.action)}else{if(!Ember.isNone(this.get("context").validate)){promise=this.get("context").validate()}else{promise=this.get("context.content").validate()}return promise.then(function(){if(_this.get("context.isValid")){return _this.get("controller").send(_this.action)}})}}})}).call(this);(function(){Ember.Handlebars.registerHelper("fileupload",function(property,options){options.hash.inputOptions=Ember.copy(options.hash);options.hash.property=property;return Ember.Handlebars.helpers.view.call(this,Admin.Fileupload.DragAndDropZoneView,options)});Ember.Handlebars.registerBoundHelper("bound-fileupload",function(property,options){options.hash.inputOptions=Ember.copy(options.hash);options.hash.property=property;return Ember.Handlebars.helpers.view.call(this,Admin.Fileupload.DragAndDropZoneView,options)})}).call(this);(function(){Ember.Handlebars.registerHelper("input-map",function(property,options){options=Ember.EasyForm.processOptions(property,options);options.hash.property=property;options.hash.isBlock=!!options.fn;if(this.get("model.asGoogleMap")){return Ember.Handlebars.helpers.view.call(this.get("model"),Admin.Base.Views.GmapView,options)}if(this.get("model.asYandexMap")){return Ember.Handlebars.helpers.view.call(this.get("model"),Admin.Base.Views.YandexMapView,options)}})}).call(this);(function(){Admin.Base.Views.ActionView=Admin.Base.Views.BaseActionView.extend({classNameBindings:["class"],attributeBindings:["title"],"class":function(){return this.get("action.class")}.property("action"),click:function(){var model;model=this.get("model")||this.get("controller.model");if(this.get("action.confirm")){return this._showConfirmation()}else{return this.get("controller").send(this.get("action.action"),model)}},actions:{confirm:function(){var model;model=this.get("model")||this.get("controller.model");this.get("controller").send(this.get("action.action"),model);return this._super()}},action:function(){if(this.get("breadcrumbAction")){switch(this.get("breadcrumbAction")){case"new":return this.get("controller.actionNew");case"edit":return this._findAction("Edit");case"destroy":return this._findAction("Delete");case"show":return this._findAction("Show");default:return""}}else{return this.get("context")}}.property("context"),title:function(){return this.get("action.title")}.property("action"),_findAction:function(title){var _this=this;return this.get("controller.collectionActions").find(function(action){return action.title===title})},_findAdditionalActions:function(title){var _this=this;return this.get("controller.__additionalActions").find(function(action){return action.title===title})}})}).call(this);(function(){Admin.Base.Views.BatchActionView=Admin.Base.Views.BaseActionView.extend({tagName:"li",click:function(event){event.preventDefault();if(this.get("controller.__batches.length")<1){return}if(this.get("context.confirm")){return this._showConfirmation()}else{return this._batchAction()}},actions:{confirm:function(){this._batchAction();return this._super()}},_batchAction:function(){this.get("controller").send("baseBatchAction",this.get("context.action"));return Ember.View.views["select-all-batches"].set("checked",false)}})}).call(this);(function(){Admin.Base.Views.CheckboxBatchView=Ember.Checkbox.extend({selectAll:false,pushItem:function(){if(this.get("selectAll")){return this._selectAllAction()}if(this.get("checked")){return this._addItem(this.get("context"))}else{return this.get("controller.__batches").removeObject(this.get("context"))}}.observes("checked"),_selectAllAction:function(){var _this=this;this.set("controller.__batches",[]);if(!this.get("checked")){return}return this.get("controller.model.items").forEach(function(item){return _this._addItem(item)})},_addItem:function(item){if(!(this.get("controller.__batches").indexOf(item)>=0)){return this.get("controller.__batches").pushObject(item)}},changeBatchList:function(){if(this.get("selectAll")){return}return this.get("controller.__batches").indexOf(this.get("context"))>=0}.property("controller.__batches.@each"),createObserverOnBatch:function(){this.get("changeBatchList");return this.addObserver("changeBatchList",this,function(){if(this.get("selectAll")){return}if(this.get("changeBatchList")){return this.set("checked",true)}else{return this.set("checked",false)}})}.on("didInsertElement")})}).call(this);(function(){Admin.Base.Views.ButtonView=Ember.View.extend({tagName:"button",classNames:["btn btn-default"],action:"",click:function(){return this.get("controller").send(this.get("action"),this.get("context"))}})}).call(this);(function(){Admin.Base.Views.TextInputView=Ember.TextField.extend({classNames:["form-control"],attributeBindings:["value","readonly"],readonly:function(){return this.get("attributeName")==="id"}.property(),value:function(){return this.get(this.path())}.property("context","attributeName"),path:function(){return"context.%@".fmt(this.get("attributeName"))},focusOut:function(event){return this.get("context").set(this.get("attributeName"),this.get("value"))}})}).call(this);(function(){Admin.Base.Views.AbstractMapView=Ember.View.extend({templateName:"base/_geo",lan:function(){return this.get("context."+this.get("lanAttr"))}.property(),setLan:function(value){return this.get("context").set(this.get("lanAttr"),value)},lanAttr:function(){return this.get("context."+this.get("mapType"))[0]}.property(),lng:function(){return this.get("context."+this.get("lngAttr"))}.property(),lngAttr:function(){return this.get("context."+this.get("mapType"))[1]}.property(),setLng:function(value){return this.get("context").set(this.get("lngAttr"),value)},zoom:function(){return this.get("context."+this.get("zoomAttr"))||8}.property(),zoomAttr:function(){return this.get("context."+this.get("mapType"))[2]}.property(),setZoom:function(value){return this.get("context").set(this.get("zoomAttr"),value)},centerCoords:function(){if(this.get("lan")&&this.get("lng")){return[this.get("lan"),this.get("lng")]}else{return Admin.Logics.Config.get("mapCenter").split(",")}},setAttrs:function(pos){if(pos["push"]){this.setLan(pos[0]);return this.setLng(pos[1])}else{this.setLan(pos.ob);return this.setLng(pos.pb)}}})}).call(this);(function(){Admin.Base.Views.GmapView=Admin.Base.Views.AbstractMapView.extend({templateName:"base/_geo",mapType:"asGoogleMap",initialize:function(){var map,marker,options,_this=this;options={zoom:this.get("zoom"),center:this.get("center"),mapTypeId:this.get("mapTypeId")};map=new google.maps.Map(this.$().find(".map")[0],options);marker=this.initMarker(map);this.initAutocomplete(map,marker);return google.maps.event.addListener(map,"zoom_changed",function(){return _this.setZoom(map.getZoom())})}.on("didInsertElement"),center:function(){var coord;coord=this.centerCoords();return new google.maps.LatLng(coord[0],coord[1])}.property(),mapTypeId:function(){return google.maps.MapTypeId.ROADMAP}.property(),initMarker:function(map){var marker,options,_this=this;options={position:this.get("center"),map:map,draggable:true};marker=new google.maps.Marker(options);google.maps.event.addListener(marker,"dragend",function(event){var pos;map.setCenter(event.latLng);pos=marker.getPosition();return _this.setAttrs(pos)});return marker},initAutocomplete:function(map,marker){var autocomplete,autocompleteView,input,_this=this;autocompleteView=this.get("MapAutocomplete");input=autocompleteView.$()[0];autocomplete=new google.maps.places.Autocomplete(input,{types:["geocode"]});return google.maps.event.addListener(autocomplete,"place_changed",function(){var place,pos;place=autocomplete.getPlace();if(!place.geometry){return}pos=place.geometry.location;if(place.geometry.viewport){map.fitBounds(place.geometry.viewport)}else{map.setCenter(pos);map.setZoom(17)}marker.setPosition(pos);return _this.setAttrs(pos)})}})}).call(this);(function(){Admin.Base.Views.MapAutocompleteView=Ember.TextField.extend({keyPress:function(event){if(event.keyCode===13){return event.preventDefault()}}})}).call(this);(function(){Admin.Base.Views.YandexMapView=Admin.Base.Views.AbstractMapView.extend({mapType:"asYandexMap",templateName:"base/_geo",didInsertElement:function(){var self,_this=this;self=this;console.log(ymaps);return ymaps.ready(function(){return _this.initMap.call(self)})},initMap:function(){var map;map=new ymaps.Map("map_container",{center:this.get("center"),zoom:this.get("zoom")});this.initMarker(map);map.controls.add("zoomControl",{left:5,top:5}).add("typeSelector").add("mapTools",{left:35,top:5});return this.initAutocomplete()},center:function(){return this.centerCoords()}.property(),initMarker:function(map){var mark,_this=this;mark=new ymaps.Placemark(this.get("center"),{iconContent:"1",balloonContent:"",hintContent:""},{preset:"twirl#violetIcon",draggable:true});map.geoObjects.add(mark);return mark.events.add("dragend",function(e){return _this.setAttrs(mark.geometry.getCoordinates())})},initAutocomplete:function(map,marker){var autocompleteView,input;autocompleteView=this.get("MapAutocomplete");return input=autocompleteView.$().hide()}})}).call(this);(function(){Admin.Base.Views.PaginationLinkView=Ember.View.extend({attributeBindings:["href"],tagName:"a",href:"#",click:function(e){e.preventDefault();if(this.get("type")==="next"){this.get("controller").send("nextPage")}else{this.get("controller").send("prevPage")}return window.scrollTo(0,0)}})}).call(this);(function(){Admin.Base.Views.PaginationNumberView=Ember.View.extend({attributeBindings:["href"],tagName:"a",classNameBindings:["isActive:active"],href:"#",isActive:function(){return this.get("controller.page")===this.get("number")}.property("controller.page"),click:function(e){e.preventDefault();if(this.get("number")!=="..."){this.get("controller").send("changePage",this.get("number"));return window.scrollTo(0,0)}}})}).call(this);(function(){Admin.Base.Views.PaginationPagesListView=Ember.View.extend({onePage:function(){return this.get("controller").get("numberOfPages")===1}.property("controller.numberOfPages"),step:5,pages:function(){var currentPage,i,leftEdge,numberOfPages,pages,rightEdge,step;pages=[];numberOfPages=this.get("controller").get("numberOfPages");currentPage=this.get("controller").get("page");step=this.get("step");if(numberOfPages>step+1){leftEdge=currentPage;rightEdge=currentPage+step-1;if(rightEdge>=numberOfPages){rightEdge=numberOfPages;leftEdge=numberOfPages-step+1}i=leftEdge;while(i<=rightEdge){pages.push(i);i++}if(leftEdge>1){pages.unshift("...");pages.unshift(1)}if(rightEdge=0){this.get("fileuploads").forEach(function(attr){return _this.addObserver("context."+_this.get("attributeName")+"."+attr,function(){return this.notifyPropertyChange("value")})});return}if(Admin.DSL.Attributes.relations(this.get("context").constructor).indexOf(this.get("attributeName"))>=0){this.get("relations").forEach(function(attr){return _this.addObserver("context."+_this.get("attributeName")+"."+attr,_this,function(){return this.notifyPropertyChange("value")})});return}return this.addObserver("context."+this.get("attributeName"),this,function(){return this.notifyPropertyChange("value")})}.on("didInsertElement"),value:function(){var record;record=this.get(this.path());if(!record||(!record["get"]||!record.get("id"))){return record}return this.relation(record,this.get("attributeName"))}.property("context"),image_object:function(){return this.get("context."+this.get("attributeName"))}.property("value"),color:function(){if(this.get("attributeName").match(/color/)){this.set("text",true);return this.set("style","color: "+this.get("_value")+";")}}.property("value"),image:function(){if(this.get("context.fileuploads")&&this.get("context.fileuploads").indexOf(this.get("attributeName"))>=0){this.set("text",false);return true}}.property("value"),text:function(){return true}.property("value"),path:function(){return"context.%@".fmt(this.get("attributeName"))},relation:function(record){var value,_this=this;if(!record){return}value="";if(this.get("context.fileuploads")&&this.get("context.fileuploads").indexOf(this.get("attributeName"))>=0){this.get("fileuploads").forEach(function(attr){if(record.get(attr)){return value=record.get(attr)}})}if(Admin.DSL.Attributes.relations(this.get("context").constructor).indexOf(this.get("attributeName"))>=0){this.get("relations").forEach(function(attr){if(record.get(attr)){return value=record.get(attr)}})}return value}})}).call(this);(function(){Admin.Fileupload.AssetView=Admin.Base.Views.BaseActionView.extend({attributeBindings:["templateName","property"],actions:{deleteAsset:function(){return this._showConfirmation()},confirm:function(){this._deleteAsset(this.get("asset"),this.get("parentView.single"));return this._super()}},_deleteAsset:function(asset,single){return this.get("controller").send("deleteAsset",asset,single,this.get("property"))},action:function(){return{title:"Delete",confirm:"Are you shure delete this?"}}.property()})}).call(this);(function(){Admin.Fileupload.DragAndDropZoneView=Ember.View.extend({attributeBindings:["property","assetTemplate"],assetTemplate:"fileuploads/asset",templateName:"fileuploads/drag_and_drop_zone",didInsertElement:function(){return this.get("single")},single:function(){return Admin.DSL.Attributes.isBelongsTo(this.get("context.model").constructor,this.get("property"))}.property("context"),assets:function(){Ember.defineProperty(this,"_assets",Ember.computed(function(){return this.get("context."+this.get("property"))}).property("context."+this.get("property")));return this.get("_assets")}.property("_assets"),asset:function(){Ember.defineProperty(this,"_asset",Ember.computed(function(){return this.get("context."+this.get("property"))}).property("context."+this.get("property")));return this.get("_asset")}.property("_asset"),actions:{selectFile:function(){var file,files,_i,_len,_results;files=event.target.files;_results=[];for(_i=0,_len=files.length;_i<_len;_i++){file=files[_i];_results.push(this.createAsset(file))}return _results}},drop:function(e){var file,files,_i,_len,_results;e.stopPropagation();e.preventDefault();files=e.dataTransfer.files;_results=[];for(_i=0,_len=files.length;_i<_len;_i++){file=files[_i];_results.push(this.createAsset(file))}return _results},dragOver:function(e){e.stopPropagation();e.preventDefault();return e.dataTransfer.dropEffect="copy"},dragLeave:function(e){e.stopPropagation();return e.preventDefault()},dragEnter:function(e){e.stopPropagation();return e.preventDefault()},createAsset:function(file){this.set("creating",true);if(this.get("single")){if(this.get("controller.model."+this.get("property"))){this.get("controller.model."+this.get("property")).deleteRecord();this.get("controller.model."+this.get("property")).save()}return this._createAsset(this._params(file),file)}else{return this._createAsset(this._params(file),file)}},_createAsset:function(params,file){var asset,store;store=this.get("controller.store");asset=store.createRecord(Ember.String.singularize(this.get("property")),$.extend({},params));asset.set("file",file);return this.get("controller").send("createAsset",asset,this.get("property"),this)},_params:function(file){var params;params={assetable_type:this.get("controller.model.__model_name").classify(),content_type:file.type,original_filename:file.name,is_main:true};if(this.get("context.id")){params.assetable_id=this.get("context.id")}if(!this.get("single")){params.is_main=false}return params},clearInput:function(){return this.$().find("input[type=file]").val("")}})}).call(this);(function(){Admin.Fileupload.ImageLinkView=Ember.View.extend({tagName:"a",attributeBindings:["href"],href:"#",templateName:"fileuploads/link_to_image",click:function(e){var imageView;e.preventDefault();imageView=Ember.View.views["FileUploadModal"];imageView.set("image",this.get("image"));return imageView.$().modal({})}})}).call(this);(function(){Admin.NavigationContentView=Ember.View.extend({tagName:"li",classNameBindings:["isActive:active"],isActive:function(){if(this.get("context.route")===this.get("controller.activeMenu")){return true}return this._hasChild()}.property("context","context.children","controller.activeMenu"),url:function(){return"/#%@".fmt(this.get("context.route"))}.property("context.route"),_hasChild:function(){var hasChild,_this=this;if(!this.get("context.children")){return false}hasChild=false;this.get("context.children").forEach(function(item){if(item.route===_this.get("controller.activeMenu")){return hasChild=true}});return hasChild}})}).call(this);(function(){Admin.ApplicationController=Admin.Base.Controllers.AdminTableViewController.extend()}).call(this);(function(){Admin.BreadcrumbsController=Ember.ArrayController.extend()}).call(this);(function(){Admin.DashboardController=Ember.Controller.extend()}).call(this);(function(){Admin.NavigationController=Ember.ArrayController.extend({activeMenu:"dashboard",model:function(){return Admin.DSL.Navigation.content}.property()})}).call(this);(function(){Ember.EasyForm.Config.registerWrapper("twitter-bootstrap",{formClass:"form-horizontal",fieldErrorClass:"has-error",errorClass:"help-inline",hintClass:"help-block",labelClass:"control-label",inputClass:"form-group",wrapControls:true,controlsWrapperClass:"controls"})}).call(this);(function(){Admin.FileuploadAdapterMixin=Ember.Mixin.create({createRecord:function(store,type,record){var adapter,url;url=this.buildURL(type.typeKey);adapter=this;return new Ember.RSVP.Promise(function(resolve,reject){var data,request,str,_this=this;data={};data[type.typeKey]=store.serializerFor(type.typeKey).serialize(record,{includeId:true});if(record["_excludeParams"]){str=$.param(record._excludeParams(data[type.typeKey]))}else{str=$.param(data[type.typeKey])}url="%@?%@".fmt(url,str);data.context=adapter;request=new XMLHttpRequest;request.open("POST",url,true);request.setRequestHeader("Content-Type",record.get("content_type"));request.onreadystatechange=function(){if(request.readyState===4&&(request.status===201||request.status===200)){data=JSON.parse(request.response);return Ember.run(null,resolve,data)}};return request.send(record.get("file"))})}})}).call(this);(function(){Admin.BaseDecorator=EmberEasyDecorator.extend({unknownProperty:function(propertyName){var modelProperty;if(/Value$/.test(propertyName)){modelProperty=propertyName.substr(0,propertyName.length-5);return this.get("model.%@".fmt(modelProperty))}if(/SectionFields$/.test(propertyName)){return this._createSectionComputed(propertyName)}if(this.get("model.%@".fmt(propertyName))){if(this._checkMapProperty(propertyName)||this._checkFileupload(propertyName)){return{options:{isVisible:false}}}if(Admin.DSL.Attributes.isBelongsTo(this.get("model").constructor,propertyName)){this.set("%@Collection".fmt(propertyName),this.get("model.store").findAll(propertyName));return{html:{optionLabelPath:"content.title"},type:"select",options:{relation:true}}}else{return this.get("model.%@".fmt(propertyName))}}},_checkMapProperty:function(property){var exist;exist=this.get("model.asGoogleMap")!==undefined&&this.get("model.asGoogleMap").indexOf(property)>=0;if(exist){return exist}return this.get("model.asYandexMap")!==undefined&&this.get("model.asYandexMap").indexOf(property)>=0},_checkFileupload:function(property){return this.get("model.fileuploads")!==undefined&&this.get("model.fileuploads").indexOf(property)>=0}})}).call(this);Ember.TEMPLATES["ember-admin/_form_buttons"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",helper,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression;data.buffer.push(escapeExpression((helper=helpers.submit||depth0&&depth0.submit,options={hash:{"class":"btn btn-default"},hashTypes:{"class":"STRING"},hashContexts:{"class":depth0},contexts:[],types:[],data:data},helper?helper.call(depth0,options):helperMissing.call(depth0,"submit",options))));data.buffer.push("');return buffer});Ember.TEMPLATES["ember-admin/actions"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,self=this;function program1(depth0,data){var stack1;stack1=helpers.view.call(depth0,"Admin.Base.Views.ActionView",{hash:{tagName:"button",href:"#",breadcrumbActionBinding:"action",controllerBinding:"controller"},hashTypes:{tagName:"STRING",href:"STRING",breadcrumbActionBinding:"STRING",controllerBinding:"STRING"},hashContexts:{tagName:depth0,href:depth0,breadcrumbActionBinding:depth0,controllerBinding:depth0},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0],types:["ID"],data:data}); +if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program2(depth0,data){var stack1;stack1=helpers._triageMustache.call(depth0,"view.title",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program4(depth0,data){var buffer="";return buffer}stack1=helpers.each.call(depth0,"action","in","controller.breadcrumbsActions",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/application"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression;data.buffer.push('
    ');data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"base/modals",options):helperMissing.call(depth0,"partial","base/modals",options))));data.buffer.push('
    ');stack1=(helper=helpers.outlet||depth0&&depth0.outlet,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"navigation",options):helperMissing.call(depth0,"outlet","navigation",options));if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push('
    ');stack1=(helper=helpers.outlet||depth0&&depth0.outlet,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"main",options):helperMissing.call(depth0,"outlet","main",options));if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push('
    ');stack1=(helper=helpers.outlet||depth0&&depth0.outlet,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"footer",options):helperMissing.call(depth0,"outlet","footer",options));if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    ");return buffer});Ember.TEMPLATES["ember-admin/base/_geo"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",escapeExpression=this.escapeExpression;data.buffer.push('Geo Input
    ');data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Base.Views.MapAutocompleteView",{hash:{viewName:"MapAutocomplete"},hashTypes:{viewName:"STRING"},hashContexts:{viewName:depth0},contexts:[depth0],types:["ID"],data:data})));data.buffer.push('
    ');return buffer});Ember.TEMPLATES["ember-admin/base/_modals"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var buffer="",stack1;data.buffer.push('");return buffer}function program3(depth0,data){var buffer="";return buffer}function program5(depth0,data){var buffer="";data.buffer.push('');return buffer}stack1=helpers.view.call(depth0,"Ember.View",{hash:{elementId:"ActionModal","class":"modal fade"},hashTypes:{elementId:"STRING","class":"STRING"},hashContexts:{elementId:depth0,"class":depth0},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers.view.call(depth0,"Ember.View",{hash:{"class":"file_upload modal fade",elementId:"FileUploadModal"},hashTypes:{"class":"STRING",elementId:"STRING"},hashContexts:{"class":depth0,elementId:depth0},inverse:self.program(3,program3,data),fn:self.program(5,program5,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}return buffer});Ember.TEMPLATES["ember-admin/base/_pagination"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,self=this;function program1(depth0,data){data.buffer.push("25")}function program3(depth0,data){var buffer="";return buffer}function program5(depth0,data){data.buffer.push("50")}function program7(depth0,data){data.buffer.push("100")}function program9(depth0,data){var stack1;stack1=helpers.unless.call(depth0,"view.onePage",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(18,program18,data),fn:self.program(10,program10,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program10(depth0,data){var buffer="",stack1;data.buffer.push('
    • ');stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationLinkView",{hash:{type:"prev"},hashTypes:{type:"STRING"},hashContexts:{type:depth0},inverse:self.program(3,program3,data),fn:self.program(11,program11,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    • ");stack1=helpers.each.call(depth0,"page","in","view.pages",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(13,program13,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    • ");stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationLinkView",{hash:{type:"next"},hashTypes:{type:"STRING"},hashContexts:{type:depth0},inverse:self.program(3,program3,data),fn:self.program(16,program16,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    ");return buffer}function program11(depth0,data){data.buffer.push("Previous")}function program13(depth0,data){var buffer="",stack1;data.buffer.push("
  • ");stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationNumberView",{hash:{number:"page"},hashTypes:{number:"ID"},hashContexts:{number:depth0},inverse:self.program(3,program3,data),fn:self.program(14,program14,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
  • ");return buffer}function program14(depth0,data){var stack1;stack1=helpers._triageMustache.call(depth0,"view.number",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program16(depth0,data){data.buffer.push("Next")}function program18(depth0,data){data.buffer.push('
    •  
    ')}data.buffer.push('
    ');stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationPerPageView",{hash:{count:25},hashTypes:{count:"INTEGER"},hashContexts:{count:depth0},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationPerPageView",{hash:{count:50},hashTypes:{count:"INTEGER"},hashContexts:{count:depth0},inverse:self.program(3,program3,data),fn:self.program(5,program5,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationPerPageView",{hash:{count:100},hashTypes:{count:"INTEGER"},hashContexts:{count:depth0},inverse:self.program(3,program3,data),fn:self.program(7,program7,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    ");stack1=helpers.view.call(depth0,"Admin.Base.Views.PaginationPagesListView",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(9,program9,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push('
    Page ');stack1=helpers._triageMustache.call(depth0,"controller.page",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    ");return buffer});Ember.TEMPLATES["ember-admin/base/_table"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,escapeExpression=this.escapeExpression,helperMissing=helpers.helperMissing,self=this;function program1(depth0,data){var buffer="",stack1;data.buffer.push("");stack1=helpers._triageMustache.call(depth0,"attributeName",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("");return buffer}function program3(depth0,data){var buffer="";return buffer}function program5(depth0,data){var buffer="",stack1,helper,options;data.buffer.push("");data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Base.Views.CheckboxBatchView",{hash:{contextBinding:"item"},hashTypes:{contextBinding:"STRING"},hashContexts:{contextBinding:depth0},contexts:[depth0],types:["ID"],data:data})));data.buffer.push("");stack1=helpers.each.call(depth0,"attributeName","in","controller.tableAttributes",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(6,program6,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push('');stack1=helpers["if"].call(depth0,"controller.collectionActions",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(8,program8,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"base/actions/_addition_actions",options):helperMissing.call(depth0,"partial","base/actions/_addition_actions",options))));data.buffer.push("");return buffer}function program6(depth0,data){data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Base.Views.Table.TdView",{hash:{contextBinding:"item",attributeNameBinding:"attributeName"},hashTypes:{contextBinding:"STRING",attributeNameBinding:"STRING"},hashContexts:{contextBinding:depth0,attributeNameBinding:depth0},contexts:[depth0],types:["ID"],data:data})))}function program8(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"base/actions/_base_actions",options):helperMissing.call(depth0,"partial","base/actions/_base_actions",options))))}function program10(depth0,data){var stack1;stack1=helpers["if"].call(depth0,"controller.model.items.isLoaded",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(13,program13,data),fn:self.program(11,program11,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program11(depth0,data){data.buffer.push('Empty')}function program13(depth0,data){data.buffer.push('')}data.buffer.push('');data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"base/actions/_batch_actions",options):helperMissing.call(depth0,"partial","base/actions/_batch_actions",options))));data.buffer.push("");stack1=helpers.each.call(depth0,"attributeName","in","controller.tableAttributes",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("");stack1=helpers.each.call(depth0,"item","in","controller.model.items",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(10,program10,data),fn:self.program(5,program5,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    ");data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Base.Views.CheckboxBatchView",{hash:{selectAll:true,elementId:"select-all-batches"},hashTypes:{selectAll:"BOOLEAN",elementId:"STRING"},hashContexts:{selectAll:depth0,elementId:depth0},contexts:[depth0],types:["ID"],data:data})));data.buffer.push("Actions
    ");data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"base/_pagination",options):helperMissing.call(depth0,"partial","base/_pagination",options))));return buffer});Ember.TEMPLATES["ember-admin/base/_td_template"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Fileupload.ImageLinkView",{hash:{imageBinding:"view.image_object"},hashTypes:{imageBinding:"STRING"},hashContexts:{imageBinding:depth0},contexts:[depth0],types:["ID"],data:data})))}function program3(depth0,data){var buffer="";return buffer}function program5(depth0,data){var stack1;stack1=helpers._triageMustache.call(depth0,"view.value",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}stack1=helpers["if"].call(depth0,"view.image",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers["if"].call(depth0,"view.text",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(5,program5,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}return buffer});Ember.TEMPLATES["ember-admin/base/actions/_addition_actions"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var stack1;stack1=helpers.view.call(depth0,"Admin.Base.Views.ActionView",{hash:{tagName:"button",href:"#",contextBinding:"action",modelBinding:"item",titleBinding:"action.title"},hashTypes:{tagName:"STRING",href:"STRING",contextBinding:"STRING",modelBinding:"STRING",titleBinding:"STRING"},hashContexts:{tagName:depth0,href:depth0,contextBinding:depth0,modelBinding:depth0,titleBinding:depth0},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program2(depth0,data){var buffer="";data.buffer.push("");return buffer}function program4(depth0,data){var buffer="";return buffer}stack1=helpers.each.call(depth0,"action","in","controller.additionalActions",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/base/actions/_base_actions"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var stack1;stack1=helpers.view.call(depth0,"Admin.Base.Views.ActionView",{hash:{tagName:"button",href:"#",contextBinding:"action",modelBinding:"item",titleBinding:"action.title"},hashTypes:{tagName:"STRING",href:"STRING",contextBinding:"STRING",modelBinding:"STRING",titleBinding:"STRING"},hashContexts:{tagName:depth0,href:depth0,contextBinding:depth0,modelBinding:depth0,titleBinding:depth0},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program2(depth0,data){var buffer="";data.buffer.push("");return buffer}function program4(depth0,data){var buffer="";return buffer}stack1=helpers.each.call(depth0,"action","in","controller.collectionActions",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/base/actions/_batch_actions"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,self=this;function program1(depth0,data){var stack1;stack1=helpers.view.call(depth0,"Admin.Base.Views.BatchActionView",{hash:{contextBinding:"action"},hashTypes:{contextBinding:"STRING"},hashContexts:{contextBinding:depth0},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program2(depth0,data){var buffer="",stack1;data.buffer.push('');stack1=helpers._triageMustache.call(depth0,"action.title",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("");return buffer}function program4(depth0,data){var buffer="";return buffer}data.buffer.push('
    batch actions
    ");return buffer});Ember.TEMPLATES["ember-admin/breadcrumbs"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var stack1;stack1=helpers["if"].call(depth0,"breadcrumb.active",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program2(depth0,data){var buffer="",stack1;data.buffer.push('");return buffer}function program4(depth0,data){var buffer="",stack1;data.buffer.push('");return buffer}function program6(depth0,data){var buffer="";return buffer}data.buffer.push('");return buffer});Ember.TEMPLATES["ember-admin/dashboard"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};data.buffer.push("

    Dashboard

    ")});Ember.TEMPLATES["ember-admin/edit"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,helperMissing=helpers.helperMissing;data.buffer.push("

    Edit

    ");stack1=(helper=helpers.outlet||depth0&&depth0.outlet,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"form",options):helperMissing.call(depth0,"outlet","form",options));if(stack1||stack1===0){data.buffer.push(stack1)}return buffer});Ember.TEMPLATES["ember-admin/fileuploads/asset"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",escapeExpression=this.escapeExpression;data.buffer.push('');return buffer});Ember.TEMPLATES["ember-admin/fileuploads/drag_and_drop_zone"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var stack1;stack1=helpers["if"].call(depth0,"view.asset",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program2(depth0,data){data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Fileupload.AssetView",{hash:{templateNameBinding:"view.assetTemplate",assetBinding:"view.asset",propertyBinding:"view.property"},hashTypes:{templateNameBinding:"STRING",assetBinding:"STRING",propertyBinding:"STRING"},hashContexts:{templateNameBinding:depth0,assetBinding:depth0,propertyBinding:depth0},contexts:[depth0],types:["ID"],data:data})))}function program4(depth0,data){var buffer="";return buffer}function program6(depth0,data){var stack1;stack1=helpers.each.call(depth0,"asset","in","view.assets",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(7,program7,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program7(depth0,data){data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Fileupload.AssetView",{hash:{templateNameBinding:"view.assetTemplate",assetBinding:"asset",propertyBinding:"view.property"},hashTypes:{templateNameBinding:"STRING",assetBinding:"STRING",propertyBinding:"STRING"},hashContexts:{templateNameBinding:depth0,assetBinding:depth0,propertyBinding:depth0},contexts:[depth0],types:["ID"],data:data})))}function program9(depth0,data){data.buffer.push('')}data.buffer.push('
    ');stack1=helpers["if"].call(depth0,"view.single",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(6,program6,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("');stack1=helpers["if"].call(depth0,"view.creating",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(9,program9,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    ");return buffer});Ember.TEMPLATES["ember-admin/fileuploads/link_to_image"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var buffer="";data.buffer.push("');return buffer}function program3(depth0,data){var buffer="";return buffer}stack1=helpers["if"].call(depth0,"view.image",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/form"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,helper,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var buffer="",stack1,helper,options;stack1=helpers.each.call(depth0,"attribute","in","controller.formAttributes",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(2,program2,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers.each.call(depth0,"attribute","in","controller.fileuploads",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(4,program4,data),fn:self.program(6,program6,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers._triageMustache.call(depth0,"input-map",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"form_buttons",options):helperMissing.call(depth0,"partial","form_buttons",options))));return buffer}function program2(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers["decorator-input"]||depth0&&depth0["decorator-input"],options={hash:{inputConfig:"class:form-control"},hashTypes:{inputConfig:"STRING"},hashContexts:{inputConfig:depth0},contexts:[depth0],types:["ID"],data:data},helper?helper.call(depth0,"attribute.name",options):helperMissing.call(depth0,"decorator-input","attribute.name",options)))) +}function program4(depth0,data){var buffer="";return buffer}function program6(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers["bound-fileupload"]||depth0&&depth0["bound-fileupload"],options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data},helper?helper.call(depth0,"attribute.name",options):helperMissing.call(depth0,"bound-fileupload","attribute.name",options))))}stack1=(helper=helpers["form-for"]||depth0&&depth0["form-for"],options={hash:{wrapper:"twitter-bootstrap"},hashTypes:{wrapper:"STRING"},hashContexts:{wrapper:depth0},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data},helper?helper.call(depth0,"controller.decorator.model",options):helperMissing.call(depth0,"form-for","controller.decorator.model",options));if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/main"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"base/_table",options):helperMissing.call(depth0,"partial","base/_table",options))))}function program3(depth0,data){var buffer="";return buffer}stack1=helpers["if"].call(depth0,"controller.__table",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/navigation"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"navigation/item",options):helperMissing.call(depth0,"partial","navigation/item",options))))}function program3(depth0,data){var buffer="";return buffer}data.buffer.push('");return buffer});Ember.TEMPLATES["ember-admin/navigation/_collection"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var stack1,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var buffer="",stack1;data.buffer.push('');stack1=helpers._triageMustache.call(depth0,"navigation.title",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push('");return buffer}function program2(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"navigation/item",options):helperMissing.call(depth0,"partial","navigation/item",options))))}function program4(depth0,data){var buffer="";return buffer}stack1=helpers.view.call(depth0,"Admin.NavigationContentView",{hash:{"class":"dropdown",contextBinding:"navigation"},hashTypes:{"class":"STRING",contextBinding:"STRING"},hashContexts:{"class":depth0,contextBinding:depth0},inverse:self.program(4,program4,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}});Ember.TEMPLATES["ember-admin/navigation/_item"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,helperMissing=helpers.helperMissing,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){data.buffer.push('
  • ')}function program3(depth0,data){var buffer="";return buffer}function program5(depth0,data){var helper,options;data.buffer.push(escapeExpression((helper=helpers.partial||depth0&&depth0.partial,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"navigation/collection",options):helperMissing.call(depth0,"partial","navigation/collection",options))))}function program7(depth0,data){var stack1;stack1=helpers.view.call(depth0,"Admin.NavigationContentView",{hash:{contextBinding:"navigation"},hashTypes:{contextBinding:"STRING"},hashContexts:{contextBinding:depth0},inverse:self.program(3,program3,data),fn:self.program(8,program8,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program8(depth0,data){var stack1,helper,options;stack1=(helper=helpers["link-to"]||depth0&&depth0["link-to"],options={hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(9,program9,data),contexts:[depth0],types:["ID"],data:data},helper?helper.call(depth0,"navigation.route",options):helperMissing.call(depth0,"link-to","navigation.route",options));if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}function program9(depth0,data){var stack1;stack1=helpers._triageMustache.call(depth0,"navigation.title",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}else{data.buffer.push("")}}stack1=helpers["if"].call(depth0,"navigation.divider",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}stack1=helpers["if"].call(depth0,"navigation.hasChildren",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(7,program7,data),fn:self.program(5,program5,data),contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}return buffer});Ember.TEMPLATES["ember-admin/navigation/_user"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="";return buffer});Ember.TEMPLATES["ember-admin/new"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,helper,options,helperMissing=helpers.helperMissing;data.buffer.push("

    New");stack1=helpers._triageMustache.call(depth0,"controller.__type",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("

    ");stack1=(helper=helpers.outlet||depth0&&depth0.outlet,options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["STRING"],data:data},helper?helper.call(depth0,"form",options):helperMissing.call(depth0,"outlet","form",options));if(stack1||stack1===0){data.buffer.push(stack1)}return buffer});Ember.TEMPLATES["ember-admin/show"]=Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[4,">= 1.0.0"];helpers=this.merge(helpers,Ember.Handlebars.helpers);data=data||{};var buffer="",stack1,escapeExpression=this.escapeExpression,self=this;function program1(depth0,data){var buffer="",stack1;data.buffer.push("");stack1=helpers._triageMustache.call(depth0,"attribute.name",{hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("");data.buffer.push(escapeExpression(helpers.view.call(depth0,"Admin.Base.Views.Table.TdView",{hash:{contextBinding:"model",attributeNameBinding:"attribute.name"},hashTypes:{contextBinding:"STRING",attributeNameBinding:"STRING"},hashContexts:{contextBinding:depth0,attributeNameBinding:depth0},contexts:[depth0],types:["ID"],data:data})));data.buffer.push("");return buffer}function program3(depth0,data){var buffer="";return buffer}data.buffer.push('

    Show

    ');stack1=helpers.each.call(depth0,"attribute","in","controller.formAttributes",{hash:{},hashTypes:{},hashContexts:{},inverse:self.program(3,program3,data),fn:self.program(1,program1,data),contexts:[depth0,depth0,depth0],types:["ID","ID","ID"],data:data});if(stack1||stack1===0){data.buffer.push(stack1)}data.buffer.push("
    ");return buffer}); \ No newline at end of file diff --git a/dist/templates.js b/dist/templates.js index 562c0df..9544d98 100644 --- a/dist/templates.js +++ b/dist/templates.js @@ -724,9 +724,9 @@ function program1(depth0,data) { function program2(depth0,data) { var helper, options; - data.buffer.push(escapeExpression((helper = helpers['bound-input'] || (depth0 && depth0['bound-input']),options={hash:{ + data.buffer.push(escapeExpression((helper = helpers['decorator-input'] || (depth0 && depth0['decorator-input']),options={hash:{ 'inputConfig': ("class:form-control") - },hashTypes:{'inputConfig': "STRING"},hashContexts:{'inputConfig': depth0},contexts:[depth0],types:["ID"],data:data},helper ? helper.call(depth0, "attribute.name", options) : helperMissing.call(depth0, "bound-input", "attribute.name", options)))); + },hashTypes:{'inputConfig': "STRING"},hashContexts:{'inputConfig': depth0},contexts:[depth0],types:["ID"],data:data},helper ? helper.call(depth0, "attribute.name", options) : helperMissing.call(depth0, "decorator-input", "attribute.name", options)))); } function program4(depth0,data) { @@ -743,7 +743,7 @@ function program6(depth0,data) { stack1 = (helper = helpers['form-for'] || (depth0 && depth0['form-for']),options={hash:{ 'wrapper': ("twitter-bootstrap") - },hashTypes:{'wrapper': "STRING"},hashContexts:{'wrapper': depth0},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),contexts:[depth0],types:["ID"],data:data},helper ? helper.call(depth0, "controller.model", options) : helperMissing.call(depth0, "form-for", "controller.model", options)); + },hashTypes:{'wrapper': "STRING"},hashContexts:{'wrapper': depth0},inverse:self.program(4, program4, data),fn:self.program(1, program1, data),contexts:[depth0],types:["ID"],data:data},helper ? helper.call(depth0, "controller.decorator.model", options) : helperMissing.call(depth0, "form-for", "controller.decorator.model", options)); if(stack1 || stack1 === 0) { data.buffer.push(stack1); } else { data.buffer.push(''); } diff --git a/src/application/controllers/base/admin_base_controller.coffee b/src/application/controllers/base/admin_base_controller.coffee index 70b0b80..e526a56 100644 --- a/src/application/controllers/base/admin_base_controller.coffee +++ b/src/application/controllers/base/admin_base_controller.coffee @@ -3,4 +3,8 @@ Admin.Base.Controllers.AdminBaseController = Ember.ObjectController.extend Admin Admin.Mixins.Controllers.AttributesMixin, Admin.Mixins.Controllers.PaginationMixin, Admin.Mixins.Controllers.BatchActionsMixin, - Admin.Mixins.Controllers.FormActionsMixin \ No newline at end of file + Admin.Mixins.Controllers.FormActionsMixin, + + decorator: (-> + Admin.BaseDecorator.create(model: @get('model')) if @get('model') + ).property('model') \ No newline at end of file diff --git a/src/application/decorators/base_decorator.coffee b/src/application/decorators/base_decorator.coffee new file mode 100644 index 0000000..f408470 --- /dev/null +++ b/src/application/decorators/base_decorator.coffee @@ -0,0 +1,24 @@ +Admin.BaseDecorator = EmberEasyDecorator.extend + + unknownProperty: (propertyName) -> + if /Value$/.test(propertyName) + modelProperty = propertyName.substr(0, propertyName.length - 5) + return @get('model.%@'.fmt(modelProperty)) + if /SectionFields$/.test(propertyName) + return @_createSectionComputed(propertyName) + if @get('model.%@'.fmt(propertyName)) + if @_checkMapProperty(propertyName) || @_checkFileupload(propertyName) + return {options: {isVisible: false}} + if Admin.DSL.Attributes.isBelongsTo(@get("model").constructor, propertyName) + @set('%@Collection'.fmt(propertyName), @get('model.store').findAll(propertyName)) + return {html: {optionLabelPath: 'content.title'}, type: 'select', options: {relation: true}} + else + return @get('model.%@'.fmt(propertyName)) + + _checkMapProperty: (property) -> + exist = @get("model.asGoogleMap") isnt `undefined` and @get("model.asGoogleMap").indexOf(property) >= 0 + return exist if exist + @get("model.asYandexMap") isnt `undefined` and @get("model.asYandexMap").indexOf(property) >= 0 + + _checkFileupload: (property) -> + @get("model.fileuploads") isnt `undefined` and @get("model.fileuploads").indexOf(property) >= 0 \ No newline at end of file diff --git a/src/application/forms/easyForm.coffee b/src/application/forms/easyForm.coffee index d5a7aba..1a97ed0 100644 --- a/src/application/forms/easyForm.coffee +++ b/src/application/forms/easyForm.coffee @@ -1,114 +1,3 @@ -Ember.Handlebars.registerHelper "input-field", (property, options) -> - options = Ember.EasyForm.processOptions(property, options) - - context = this - - options.hash.property = Ember.Handlebars.get(this, options.hash.propertyBinding, options) if options.hash.propertyBinding - options.hash.inputOptions = Ember.Handlebars.get(this, options.hash.inputOptionsBinding, options) if options.hash.inputOptionsBinding - - property = options.hash.property - - propertyType = (property) -> - try - return (context.get("content") or context).constructor.metaForProperty(property).type - catch e - return null - - options.hash.valueBinding = property - options.hash.viewName = "input-field-" + options.data.view.elementId - if options.hash.inputOptions - inputOptions = options.hash.inputOptions - optionName = undefined - for optionName of inputOptions - options.hash[optionName] = inputOptions[optionName] if inputOptions.hasOwnProperty(optionName) - delete options.hash.inputOptions - - if options.hash.inputConfig - configs = options.hash.inputConfig.split(";") - i = configs.length - while i-- - config = configs[i].split(":") - options.hash[config[0]] = config[1] - - - if options.hash.as is "text" - Ember.Handlebars.helpers.view.call context, Ember.EasyForm.TextArea, options - else if options.hash.as is "select" - delete (options.hash.valueBinding) - type = context.get("model").constructor - if Admin.DSL.Attributes.relations(type).indexOf(property) >= 0 - options.hash.attribute = property - options.hash.content = context.store.findAll(property) - options.hash.selection = context.get(property) - options.hash.optionValuePath = "context.id" - options.hash.optionLabelPath = "context.title" - options.hash.prompt = "Place select %@".fmt(property) - else - options.hash.contentBinding = options.hash.collection - options.hash.selectionBinding = options.hash.selection - options.hash.valueBinding = options.hash.value - Ember.Handlebars.helpers.view.call context, Ember.EasyForm.Select, options - else - unless options.hash.as - if property.match(/password/) - options.hash.type = "password" - else if property.match(/email/) - options.hash.type = "email" - else if property.match(/url/) - options.hash.type = "url" - else if property.match(/color/) - options.hash.type = "color" - else if property.match(/^tel/) - options.hash.type = "tel" - else if property.match(/search/) - options.hash.type = "search" - else - if propertyType(property) is "number" or typeof (context.get(property)) is "number" - options.hash.type = "number" - else if propertyType(property) is "date" or (not Ember.isNone(context.get(property)) and context.get(property).constructor is Date) - options.hash.type = "date" - else if propertyType(property) is "boolean" or (not Ember.isNone(context.get(property)) and context.get(property).constructor is Boolean) - options.hash.checkedBinding = property - return Ember.Handlebars.helpers.view.call(context, Ember.EasyForm.Checkbox, options) - else - inputType = Ember.EasyForm.Config.getInputType(options.hash.as) - if inputType - options.hash.property = property - return Ember.Handlebars.helpers.view.call(context, inputType, options) - options.hash.type = options.hash.as - return Ember.Handlebars.helpers.view.call(context, Ember.EasyForm.TextField, options) - - -Ember.Handlebars.registerHelper "input", (property, options) -> - options = Ember.EasyForm.processOptions(property, options) - return if Admin.Forms.Filters.fileupload(options, property) - return if Admin.Forms.Filters.mapField(options, property) - Admin.Forms.Filters.as(options, property) - options.hash.property = property - options.hash.isBlock = !!(options.fn) - Ember.Handlebars.helpers.view.call this, Ember.EasyForm.Input, options - -Ember.Handlebars.registerBoundHelper "bound-input", (property, options) -> - options = Ember.EasyForm.processOptions(property, options) - return if Admin.Forms.Filters.fileupload(options, property) - return if Admin.Forms.Filters.mapField(options, property) - Admin.Forms.Filters.as(options, property) - options.hash.property = property - options.hash.isBlock = !!(options.fn) - Ember.Handlebars.helpers.view.call this, Ember.EasyForm.Input, options - -Ember.Handlebars.registerHelper 'input-map', (property, options) -> - options = Ember.EasyForm.processOptions(property, options) - options.hash.property = property - options.hash.isBlock = !!(options.fn) - return Admin.Forms.Filters.map(options, property) - -Ember.EasyForm.Select = Ember.Select.extend - attributeBindings: ["attribute"] - change: -> - path = "context.%@".fmt(@get("attribute")) - @set path, @get("selection") - Ember.EasyForm.Form.reopen submit: (event) -> _this = this diff --git a/src/application/forms/filters.coffee b/src/application/forms/filters.coffee deleted file mode 100644 index 448f31b..0000000 --- a/src/application/forms/filters.coffee +++ /dev/null @@ -1,20 +0,0 @@ -Admin.Forms.Filters = Ember.Object.extend().reopenClass - - fileupload: (options, property) -> - context = options.contexts[0] - context.get("fileuploads") isnt `undefined` and context.get("fileuploads").getEach("name").indexOf(property) >= 0 - - mapField: (options, property) -> - context = options.contexts[0] - exist = context.get("asGoogleMap") isnt `undefined` and context.get("asGoogleMap").indexOf(property) >= 0 - return exist if exist - context.get("asYandexMap") isnt `undefined` and context.get("asYandexMap").indexOf(property) >= 0 - - as: (options, property) -> - type = options.contexts[0].get("model").constructor - options.hash.as = "select" if Admin.DSL.Attributes.relations(type).indexOf(property) >= 0 - - map: (options, property) -> - context = options.contexts[0] - return Ember.Handlebars.helpers.view.call(context, Admin.Base.Views.GmapView, options) if context.get('asGoogleMap') - return Ember.Handlebars.helpers.view.call(context, Admin.Base.Views.YandexMapView, options) if context.get('asYandexMap') \ No newline at end of file diff --git a/src/application/helpers/map.coffee b/src/application/helpers/map.coffee new file mode 100644 index 0000000..5b8abf8 --- /dev/null +++ b/src/application/helpers/map.coffee @@ -0,0 +1,6 @@ +Ember.Handlebars.registerHelper "input-map", (property, options) -> + options = Ember.EasyForm.processOptions(property, options) + options.hash.property = property + options.hash.isBlock = !!(options.fn) + return Ember.Handlebars.helpers.view.call(@get('model'), Admin.Base.Views.GmapView, options) if @get('model.asGoogleMap') + return Ember.Handlebars.helpers.view.call(@get('model'), Admin.Base.Views.YandexMapView, options) if @get('model.asYandexMap') \ No newline at end of file diff --git a/src/application/resolver.coffee b/src/application/resolver.coffee index a0d9a32..8fd07da 100644 --- a/src/application/resolver.coffee +++ b/src/application/resolver.coffee @@ -12,7 +12,6 @@ return Admin.DashboardController if parsedName.fullNameWithoutType == "dashboard" return Admin.BreadcrumbsController if parsedName.fullNameWithoutType == "breadcrumbs" return Admin.NavigationController if parsedName.fullNameWithoutType == "navigation" -# window.Admin.ApplicationController.extend() @_super(parsedName) diff --git a/src/application/templates/ember-admin/form.emblem b/src/application/templates/ember-admin/form.emblem index c6183f2..9a47bba 100644 --- a/src/application/templates/ember-admin/form.emblem +++ b/src/application/templates/ember-admin/form.emblem @@ -1,6 +1,6 @@ -= form-for controller.model wrapper="twitter-bootstrap" += form-for controller.decorator.model wrapper="twitter-bootstrap" each attribute in controller.formAttributes - = bound-input attribute.name inputConfig='class:form-control' + = decorator-input attribute.name inputConfig='class:form-control' each attribute in controller.fileuploads = bound-fileupload attribute.name diff --git a/src/ember-easy-decorator.js b/src/ember-easy-decorator.js new file mode 100644 index 0000000..29879cf --- /dev/null +++ b/src/ember-easy-decorator.js @@ -0,0 +1,135 @@ +(function() { + window.EmberEasyDecorator = Ember.Object.extend(Ember.Evented, Ember.ActionHandler, { + init: function() { + return this._super(); + }, + + /* + Returns all attributes from decorator + */ + attributes: (Ember.computed(function() { + return Ember.get(this.constructor, 'attributes'); + })).property(), + + /* + delegate all attributes witch include Value as nomaValue to model + */ + unknownProperty: function(propertyName) { + var modelProperty; + if (/Value$/.test(propertyName)) { + modelProperty = propertyName.substr(0, propertyName.length - 5); + return this.get('model.%@'.fmt(modelProperty)); + } + if (/SectionFields$/.test(propertyName)) { + return this._createSectionComputed(propertyName); + } + }, + _createSectionComputed: function(propertyName) { + var fields, section; + section = propertyName.substr(0, propertyName.length - 13); + console.log(section); + fields = this.get('attributes').keys.list.filter((function(_this) { + return function(key) { + return _this.get('attributes').get(key).options.section === section; + }; + })(this)); + fields = fields.map((function(_this) { + return function(field) { + return _this.get('attributes').get(field); + }; + })(this)); + fields = this._sort(fields); + this.set(propertyName, fields); + return fields; + }, + _sort: function(array, type) { + if (type == null) { + type = 'asc'; + } + switch (type) { + case 'asc': + return array.sort(function(a, b) { + return a.options.order - b.options.order; + }); + case 'desc': + return array.sort(function(a, b) { + return b.options.order - a.options.order; + }); + } + } + }); + + EmberEasyDecorator.reopenClass({ + attributes: Ember.computed(function() { + var map; + map = Ember.Map.create(); + this.eachComputedProperty(function(name, meta) { + if (meta.isAttribute) { + meta.name = name; + return map.set(name, meta); + } + }); + return map; + }) + }); + + EmberEasyDecorator.element = function(type, options, html) { + var meta; + options = options || {}; + html = html || {}; + meta = { + type: type, + isAttribute: true, + html: html, + options: options + }; + return Ember.computed(function(key) { + return this.get('attributes').get(key); + }).property().meta(meta); + }; + + window.EED = EmberEasyDecorator; + + Ember.Handlebars.helper('decorator-input', function(property, options) { + var element, _ref; + options = $.extend({}, options); + element = this.get('decorator.%@'.fmt(property)); + if ((element != null ? (_ref = element.options) != null ? _ref.isVisible : void 0 : void 0) === false) { + return; + } + $.extend(options.hash, element.html); + if (element.type === 'nested_attributes') { + options.hash.templateName = element.options.templateName; + options.hash.contextBinding = 'controller.decorator'; + options.hash.controllerBinding = 'controller.decorator'; + return Ember.Handlebars.helpers.view.call(this, Ember.View, options); + } + options.hash.as = element.type; + if (element.type === 'select') { + options.hash.collection = options.hash.collection || 'controller.decorator.%@Collection'.fmt(property); + if (element.options.relation) { + options.hash.optionValuePath = options.hash.optionValuePath || "content.id"; + options.hash.optionLabelPath = options.hash.optionLabelPath || "content.value"; + } else { + options.hash.optionValuePath = options.hash.optionValuePath || "content"; + options.hash.optionLabelPath = options.hash.optionLabelPath || "content"; + } + } + return Ember.Handlebars.helpers['input'].call(this, property, options); + }); + + Ember.Handlebars.helper('decorator-section', function(section, options) { + var elements; + elements = this.get('decorator.%@SectionFields'.fmt(section)); + return elements.forEach((function(_this) { + return function(element) { + options = $.extend({}, options); + 'collection optionValuePath optionLabelPath placeholder value prompt readonly label type'.w().forEach(function(attr) { + return delete options.hash[attr]; + }); + return Ember.Handlebars.helpers['decorator-input'].call(_this, element.name, options); + }; + })(this)); + }); + +}).call(this);