This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Handlebars.registerHelper 'has-permission', (conditional, options) -> | |
if @get('currentPerson.content.rights').contains conditional | |
options.fn @ | |
else | |
options.inverse @ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
executions: ( -> | |
ids = @get 'execution_ids' | |
return unless ids? and ids.length | |
_ids = @get '_ids' | |
# Prevent multiple calls to server for no reason. | |
return @get('_executions') if _ids && ids.toString() == _ids.toString() | |
@set '_ids', ids | |
_executions = @get('store').find 'execution', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
willTransition: (transition) -> | |
context = @get 'context' | |
return false unless context | |
if context.get('isDirty') && !confirm 'You have unsaved changes are you sure you want to continue?' | |
transition.abort() | |
return false | |
if context.get('isNew') | |
context.deleteRecord() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#in template | |
{{tb-select value=market_po options=controllers.menus.markets}} | |
#Work in progress | |
Ember.TEMPLATES['components/tb-select'] = Em.Handlebars.compile ' | |
{{view view.OptionsView}} | |
' | |
Binders.TbSelectComponent = Ember.Component.extend |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#In template | |
{{tb-select options=controllers.menus.pods value=pod}} | |
#Work in progress | |
Ember.TEMPLATES['components/tb-select'] = Em.Handlebars.compile ' | |
<div class="controls"> | |
{{view view.OptionsView}} | |
</div> | |
' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#this must run before application.create. | |
DS.RESTAdapter.map 'App.ParentModel', | |
foos: { embedded: 'always' } #has many | |
bars: { embedded: 'always' } #has one aka belongsTo | |
App.ParentModel = DS.Model.extend | |
foos: DS.hasMany App.Foo | |
bars: DS.belongsTo App.Bar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DS.RESTAdapter = DS.RESTAdapter.extend({ | |
serializer: DS.RESTSerializer.extend({ | |
primaryKey: function(type) { | |
return '_id'; | |
} | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dogarrhea: out of curiosity, why did ember marketing decide to attach the "MVC" label to ember.js when ember doesn't really have a data solution that's solid yet? | |
[12:32pm] mixonic joined the chat room. | |
[12:32pm] dogarrhea: it's pretty deceptive and leaves a bad taste in my mouth when I use it and find out. This is the opposite of what marketing wants right? | |
[12:32pm] alexd08 left the chat room. (Quit: This computer has gone to sleep) | |
[12:33pm] dogarrhea: i'll just stop until everything is ready. not provide free QA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
{{#each song in songs}} | |
<li>{{song.title}}</li> | |
{{/each}} | |
</ul> | |
MyListView: Em.CollectionView.extend | |
tagName: 'ul' | |
itemViewClass: Em.View.extend | |
template: Em.Handlebars.compile ' |
NewerOlder