[Groonga-commit] groonga/gcs [ember] Split view into layout and contents

Back to archive index

Yoji SHIDARA null+****@clear*****
Wed Sep 5 17:24:59 JST 2012


Yoji SHIDARA	2012-09-05 17:24:59 +0900 (Wed, 05 Sep 2012)

  New Revision: c4c1c8d0423152d83d76d03b8de24734a7ce5814
  https://github.com/groonga/gcs/commit/c4c1c8d0423152d83d76d03b8de24734a7ce5814

  Log:
    Split view into layout and contents

  Modified files:
    public/js/gcs.js
    views/index.jade

  Modified: public/js/gcs.js (+10 -1)
===================================================================
--- public/js/gcs.js    2012-09-05 16:21:53 +0900 (e7e28aa)
+++ public/js/gcs.js    2012-09-05 17:24:59 +0900 (192fec1)
@@ -1,14 +1,23 @@
 $(document).ready(function($) {
   var App = Ember.Application.create();
 
+  App.ApplicationController = Ember.Controller.extend();
+
   App.ApplicationView = Ember.View.extend({
     templateName: 'application'
   });
 
+  App.IndexView = Ember.View.extend({
+    templateName: 'index'
+  });
+
   App.Router = Ember.Router.extend({
     root: Ember.Route.extend({
       index: Ember.Route.extend({
-        route: '/'
+        route: '/',
+        connectOutlets: function(router) {
+          router.get('applicationController').connectOutlet('index');
+        }
       })
     })
   });

  Modified: views/index.jade (+9 -6)
===================================================================
--- views/index.jade    2012-09-05 16:21:53 +0900 (8d9574d)
+++ views/index.jade    2012-09-05 17:24:59 +0900 (2351657)
@@ -22,12 +22,15 @@ html
       .container
         .row
           .span12
-            form#search.form-search(onsubmit="searchExecute(); return false;")
-              input.search-query(type="text", name="query", value="")
-              input.btn(type="submit", value="Search")
-              input(type="hidden", name="start", value="")
+            {{outlet}}
 
-            #request-information
-            #results
+    script(data-template-name="index", type="text/x-handlebars")
+      form#search.form-search(onsubmit="searchExecute(); return false;")
+        input.search-query(type="text", name="query", value="")
+        input.btn(type="submit", value="Search")
+        input(type="hidden", name="start", value="")
+
+      #request-information
+      #results
 
   body
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index