diff --git a/thorax-lumbar-client/src/main/thorax/js/collections/Sessions.js b/thorax-lumbar-client/src/main/thorax/js/collections/Sessions.js index c087660..43dfcad 100644 --- a/thorax-lumbar-client/src/main/thorax/js/collections/Sessions.js +++ b/thorax-lumbar-client/src/main/thorax/js/collections/Sessions.js @@ -2,5 +2,4 @@ S2GX.Collection.extend({ name: "Sessions", model: S2GX.Models.Session, url: 'http://localhost:8080/thorax-client/sessions' - }); diff --git a/thorax-lumbar-client/src/main/thorax/js/routers/s2gx.js b/thorax-lumbar-client/src/main/thorax/js/routers/s2gx.js index f096a9b..99f162f 100644 --- a/thorax-lumbar-client/src/main/thorax/js/routers/s2gx.js +++ b/thorax-lumbar-client/src/main/thorax/js/routers/s2gx.js @@ -1,8 +1,10 @@ S2GX.Router.create(module, { sessions: function() { - alert("X: " + cache.sessions.length); var view = this.view('s2gx/Sessions'); - view.setCollection(cache.sessions); - this.setView(view); + var sessions = new S2GX.Collections.Sessions(); + sessions.load(function() { + view.setCollection(sessions); + S2GX.layout.setView(view); + }); } }); diff --git a/thorax-lumbar-client/src/main/thorax/js/views/s2gx/Sessions.js b/thorax-lumbar-client/src/main/thorax/js/views/s2gx/Sessions.js index 1a58d0f..f99857d 100644 --- a/thorax-lumbar-client/src/main/thorax/js/views/s2gx/Sessions.js +++ b/thorax-lumbar-client/src/main/thorax/js/views/s2gx/Sessions.js @@ -1,9 +1,3 @@ -// setup the local session cache -var cache = { - sessions: new S2GX.Collections.Sessions() -}; -cache.sessions.fetch(); - S2GX.View.extend({ name: 's2gx/Sessions' }); diff --git a/thorax-lumbar-client/src/main/thorax/templates/s2gx/Sessions.handlebars b/thorax-lumbar-client/src/main/thorax/templates/s2gx/Sessions.handlebars index 4ccb4ad..fd7596c 100644 --- a/thorax-lumbar-client/src/main/thorax/templates/s2gx/Sessions.handlebars +++ b/thorax-lumbar-client/src/main/thorax/templates/s2gx/Sessions.handlebars @@ -1 +1,4 @@

Sessions

+{{#each sessions}} +
  • {{title}}
  • +{{/each}} \ No newline at end of file