Forked from macmania/controller.business.dashboard.js
Last active
August 29, 2015 14:27
-
-
Save phkavitha/5eefc9d3353a7eadb631 to your computer and use it in GitHub Desktop.
dashboard-feature
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName:'Ember Twiddle' | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
import BasevalidController from '../basevalid'; | |
export default BasevalidController.extend({ | |
actions: { | |
login: function() { | |
if(this.get('isValid') === false){ | |
this.set('message', 'You have to enter your email and password'); | |
} | |
else{ | |
var emailAddress = this.get('model.emailAddress'); | |
var password12 = this.get('model.password'); | |
var business = this.get('model'); | |
var _this = this; | |
var user = $.ajax({ | |
type: "POST", | |
url: "path/to/login", | |
data: { | |
emailAddress: this.get('model.emailAddress'), | |
password: this.get('model.password') | |
} | |
}).then(function(response, request){ | |
if(response != null){ | |
business.set('businessName', response.business.business_name); | |
//need to save the the the business request to the client ember-data, | |
//need to figure this out, don't want to keep on doing .set etc... | |
business.save('no post'); | |
console.log(password12); | |
//route this to another url and pass the name or what not | |
console.log("business name" + business.get('businessName')); | |
_this.transitionToRoute('business.dashboard', business); | |
return response; | |
} | |
else{ | |
//skip the welcome part | |
} | |
}); | |
} | |
return false; | |
} | |
} | |
}); |
This file contains hidden or 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
import DS from 'ember-data'; | |
export default DS.Model.extend({ | |
//model to be displayed on each of the blog-post | |
businessName: DS.attr('string'), | |
//avatar_icon to be displayed on each ad | |
businessUrl: DS.attr('string'), //need | |
emailAddress: DS.attr('string'), | |
twitter: DS.attr('string'), | |
facebook: DS.attr('string'), | |
instagram: DS.attr('string'), | |
url: DS.attr('string'), | |
hours: DS.attr('string'), //need to parse this information in a friendlier way | |
save: function(params){ | |
if(params == 'no post'){ | |
console.log("here"); | |
return; | |
} | |
else{ | |
return this._super(); | |
} | |
} | |
//better format for these social network links (TO-DO) | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
import config from './config/environment'; | |
var Router = Ember.Router.extend({ | |
location: config.locationType | |
}); | |
Router.map(function() { | |
... | |
this.resource('business', function() { | |
this.route('login'); | |
this.route('signup'); | |
this.route('dashboard', {path: '/dashboard/:business_name'}); | |
//might need more information from them | |
}); | |
... | |
}); | |
export default Router; |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
afterModel: function(businesses, transition){ | |
//don't know what's happening here | |
console.log(businesses); | |
}, | |
setUpController: function(controller, model){ | |
controller.set('model', model); | |
}, | |
}); |
This file contains hidden or 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
import Ember from 'ember'; | |
export default Ember.Route.extend({ | |
model: function() { | |
console.log("the model" + this.get('model')); | |
return this.store.createRecord('business'); | |
}, | |
setupController: function(controller, model){ | |
controller.set('model', model); | |
}, | |
}); |
This file contains hidden or 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
{ | |
"version": "0.4.7", | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js", | |
"ember": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.6/ember.js", | |
"ember-data": "https://cdnjs.cloudflare.com/ajax/libs/ember-data.js/1.13.7/ember-data.js", | |
"ember-template-compiler": "https://cdnjs.cloudflare.com/ajax/libs/ember.js/1.13.6/ember-template-compiler.js" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment