[Groonga-commit] groonga/gcs [ember] Add nav-list on the left

Back to archive index

Yoji SHIDARA null+****@clear*****
Wed Sep 26 17:42:36 JST 2012


Yoji SHIDARA	2012-09-26 17:42:36 +0900 (Wed, 26 Sep 2012)

  New Revision: 0a65530ef3d102c23e79771c431f5ffba2f4848e
  https://github.com/groonga/gcs/commit/0a65530ef3d102c23e79771c431f5ffba2f4848e

  Log:
    Add nav-list on the left

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

  Modified: public/js/gcs.js (+5 -3)
===================================================================
--- public/js/gcs.js    2012-09-26 15:32:23 +0900 (c119ff4)
+++ public/js/gcs.js    2012-09-26 17:42:36 +0900 (e577f09)
@@ -231,20 +231,22 @@ App.IndexView = Ember.View.extend({
 App.Router = Ember.Router.extend({
   root: Ember.Route.extend({
     showIndex: Ember.State.transitionTo('root.index'),
+    showSearch: function(router, event) {
+      router.transitionTo('search', {domain: event.context});
+    },
     index: Ember.Route.extend({
       route: '/',
       connectOutlets: function(router) {
         router.get('applicationController').connectOutlet('index');
       },
-      search: function(router, event) {
-        router.transitionTo('search', {domain: event.context});
-      },
     }),
     search: Ember.Route.extend({
       route: 'search/:domainName',
       connectOutlets: function(router, context) {
         var controller = router.get('searchController');
         controller.set('domain', context.domain);
+        controller.set('query', null);
+        controller.reset();
         router.get('applicationController').connectOutlet('search');
       },
       nextPage: function(router) {

  Modified: views/index.jade (+12 -20)
===================================================================
--- views/index.jade    2012-09-26 15:32:23 +0900 (2cdabd5)
+++ views/index.jade    2012-09-26 17:42:36 +0900 (9587aef)
@@ -14,10 +14,19 @@ html
       .navbar.navbar-fixed-top
         .navbar-inner
           .container
-            <a class="brand" {{action showIndex}}>Groonga CloudSearch</a>
+            <a class="brand" href {{action showIndex}}>Groonga CloudSearch</a>
+            ul.nav
+              li <a href {{action showIndex}}>Home</a>
       .container
         .row
-          .span12
+          .span2
+            .well(style="padding: 10px 0 10px 0;")
+              ul.nav.nav-list
+                li.nav-header Domains
+                {{#each App.domains.all}}
+                li <a href {{action showSearch this}}>{{name}}</a>
+                {{/each}}
+          .span10
             {{outlet}}
 
     script(data-template-name="index", type="text/x-handlebars")
@@ -27,26 +36,9 @@ html
           tr
             th Configuration Endpoint
             td {{App.domains.configurationEndpoint}}
-      h1 Available Domains
-      {{#each controller}}
-      h2 <a {{action search this}}>{{name}}</a>
-      table.table.table-bordered
-        tbody
-          tr
-            th Search Endpoint
-            td {{searchEndpoint}}
-          tr
-            th Fields
-            td
-              ul
-                {{#each fieldNames}}
-                li {{this}}
-                {{/each}}
-      {{/each}}
-
 
     script(data-template-name="search", type="text/x-handlebars")
-      h2 Search domain '{{domain.name}}'
+      h1 Search domain '{{domain.name}}'
       {{#view App.SearchFormView}}
       {{view Ember.TextField valueBinding="query"}}
       input(type="hidden", name="start", value="")
-------------- next part --------------
HTML����������������������������...
다운로드 



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