summaryrefslogtreecommitdiff
path: root/public/js/old-app.js
blob: 7098e43d5381a9b430f49ae6e0ff67cf7ce35ed4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
App = Ember.Application.create({
  LOG_TRANSITIONS: true
});

// App.Router.map(function() {
//   this.resource("switchboards", { path: "/switchboards" });
// });

// App.TablesRoute = Ember.Route.extend({
//   model: function() {
//     return ;
//   }
// })

// DS.RESTAdapter.configure("plurals", {
//   switchboard_entry: "switchboard_entries"
// });


App.Store = DS.Store.extend({
  adapter: 'DS.FixtureAdapter',
  revision: 11
});

App.Switchboard = DS.Model.extend({
  switchboard_entrys: DS.hasMany('App.SwitchboardEntry'),
  name: DS.attr('string')
});

App.SwitchboardEntry = DS.Model.extend({
  name: DS.attr('string')
});

App.Router.map(function() {
  this.resource('switchboard', { path: '/users/:user_id/switchboards/:switchboard_id' });
});

App.SwitchboardsRoute = Ember.Route.extend({
  model: function(params) {
    return App.Switchboard.find(params.switchboard_id);
  }
});

App.Switchboard.FIXTURES = [{
  id: 1,
  name: 'Erstes Ember Test Switchboard'
}, {
  id: 2,
  name: 'Zweites Switchboard'
}]


// var switchboard_view = Ember.View.create({
//   templateName: 'switchboard',
//   name: "test"
// });

// switchboard_view.appendTo('#xxxyyy');