Created
November 7, 2011 22:28
-
-
Save coop/1346411 to your computer and use it in GitHub Desktop.
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
App.featureDeploys = SC.Object.create({ | |
deploy: function() { | |
// code in here | |
} | |
}); |
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
App.FeatureView = SC.View.extend({ | |
classNames: ['feature'], | |
templateName: 'feature', | |
createdAt: function () { | |
return $.timeago.distanceInWords(this.getPath('content.createdAt')); | |
}.property('createdAt').cacheable() | |
}); |
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
<script type="text/x-handlebars" data-template-name="feature"> | |
<h2>{{content.title}}</h2> | |
{{#if content.body}} | |
{{content.body}} | |
{{/if}} | |
<abbr {{bindAttr title="content.createdAt"}}>{{createdAt}}</abbr> | |
{{#if content.waitingDeployment}} | |
{{#view SC.Button target="App.featureDeploy" action="deploy" class="deploy-now"}} | |
Deploy | |
{{/view}} | |
{{/if}} | |
{{#if content.isDeployed}} | |
{{#view SC.Button target="App.featureDeploys" action="view" class="deploy-now"}} | |
View Feature | |
{{/view}} | |
{{/if}} | |
</script> | |
<script type="text/x-handlebars"> | |
{{collectionView App.OpenFeaturesView id="open-features"}} | |
</script> |
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
App.OpenFeaturesView = SC.CollectionView.extend({ | |
content: [], | |
itemViewClass: App.FeatureView | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not Backbone.js.