App = Ember.Application.create();
App.ApplicationAdapter = DS.LSAdapter.extend({
namespace: 'compass'
});
App.Question = DS.Model.extend({
detail : DS.attr('string'),
positive: DS.attr(),
negative: DS.attr(),
ansN: DS.attr(),
ansY: DS.attr(),
animation: DS.attr('string')
});
App.Answer = DS.Model.extend({
detail : DS.attr('string'),
nextQ : DS.attr(),
animation: DS.attr('string')
});
App.ApplicationRoute = Ember.Route.extend({
model: function() {
}
});
App.ApplicationRoute = Ember.Route.extend({
model: function() {
this.store.push('question', {
id: 1,
detail: "Did you create software?",
positive: 2,
negative: 3,
animation: "animated fadeInDownBig"
});
this.store.push('question', {
id: 2,
detail: "Do you hold copyright?",
animation: "animated fadeInLeftBig",
ansN: 1,
ansY: 2
});
this.store.push('question', {
id: 3,
detail: "Have you obtained rights to code?",
positive:4,
ansN: 1,
animation: "animated rollIn"
});
this.store.push('question', {
id: 4,
detail: "Do you want to share source?",
ansN: 3,
ansY: 4,
animation: "animated bounceInRight"
});
this.store.push('question', {
id: 5,
detail: "Should any future distributions be required to use your licence choice?",
ansN: 6,
ansY: 5,
animation: "animated rotateInUpLeft"
});
this.store.push('question', {
id: 6,
detail: "May users distribute their extensions and modifications on a different licence ?",
ansN: 7,
ansY: 8,
animation: "animated fadeInUpBig"
});
this.store.push('question', {
id: 7,
detail: "May the code be proprieterised?",
negative: 8,
animation: "animated fadeInDownBig"
});
this.store.push('question', {
id: 8,
detail: "Do you require attribution?",
animation: "animated flipInX"
});
this.store.push('answer', {
id: 1,
detail: "May not grant a licence!",
animation: "animated fadeInDownBig"
});
this.store.push('answer', {
id: 2,
detail: "You may licence copyright",
nextQ: 4 ,
animation: "animated fadeInDownBig"
});
this.store.push('answer', {
id: 3,
detail: "Not suitable for FOSS final proprietary licence",
animation: "animated fadeInDownBig"
});
this.store.push('answer', {
id: 4,
detail: "FOSS licence is appropriate",
nextQ: 5,
animation: "animated flipInX"
});
this.store.push('answer', {
id: 5,
detail: "Copyleft = vial effect",
nextQ: 6,
animation: "animated flipInX"
});
this.store.push('answer', {
id: 6,
detail: "Permissive",
nextQ: 7,
animation: "animated flipInX"
});
this.store.push('answer', {
id: 7,
detail: "Strong Copyleft",
animation: "animated flipInX"
});
this.store.push('answer', {
id: 8,
detail: "Weak Copyleft",
animation: "animated flipInX"
});
}
});
App.Router.map(function() {
// put your routes here
this.route("questions");
this.resource('question', { path: '/question/:question_id' });
this.resource('answer', { path: '/answer/:answer_id' });
});
App.QuestionsRoute = Ember.Route.extend({
model: function() {
return this.store.find('question');
}
});
App.QuestionRoute = Ember.Route.extend({
model: function(params) {
return this.store.find('question', params.question_id);
}
});
App.AnswerRoute = Ember.Route.extend({
model: function(params) {
return this.store.find('answer', params.answer_id);
}
});