Last active
August 29, 2015 14:00
-
-
Save bj-mcduck/11104247 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
.form-group | |
%label.control-label.col-sm-2 | |
Name | |
.col-sm-10 | |
= hb 'input type="text" value=symbol.name class="form-control input-group-large"' | |
.form-group | |
%label.control-label.col-sm-2 | |
Category | |
.col-sm-10 | |
= hb 'view Ember.Select content=categories optionValuePath="content.id" optionLabelPath="content.name" value=symbol.parent_id class="form-control" prompt="None"' | |
.form-group | |
%label.control-label.col-sm-2 | |
Description | |
.col-sm-10 | |
= hb 'textarea value=symbol.description class="form-control input-group-large"' | |
.form-group | |
%label.control-label.col-sm-2 | |
Image | |
.col-sm-10 | |
= hb 'textarea value=symbol.description class="form-control input-group-large"' | |
.form-group | |
.col-sm-10 | |
%btn.btn.btn-primary{ _action: 'save' } | |
WooTtSave | |
%btn.btn.btn-primary{ _action: 'cancel' } | |
WotCancel |
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
DreamSymbolForm = Ember.Component.extend | |
symbol: null | |
save: null | |
cancel: null | |
delete: null | |
saveText: 'Save' | |
cancelText: 'Cancel' | |
actions: | |
cancel: -> | |
@sendAction 'cancel' | |
save: -> | |
@sendAction 'save' |
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.DreamSymbolsEditController = Ember.ObjectController.extend | |
value: (-> | |
@get('model.parent.id') | |
).property 'model.parent.id' | |
categories: (-> | |
controller = @ | |
@store.all('dream_symbol').map (symbol)-> | |
{ id: parseInt( symbol.get('id'), 10 ), name: symbol.get('name') } if symbol.get('id') != controller.get('model.id') | |
).property '[email protected]' | |
actions: | |
cancel: -> | |
@currentModel.rollback() | |
@transitionToRoute 'dream_symbols.show', @currentModel | |
save: -> | |
route = @ | |
@currentModel.save().then (symbol)-> | |
route.transitionToRoute 'dream_symbols.show', symbol | |
delete: -> | |
@get('model').deleteRecord() | |
@get('model').save() | |
@transitionTo 'dream_symbols.index' | |
test: -> | |
console.log 'TESTS TEST TEST' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment