[Groonga-commit] groonga/gcs-console [master] Consistent nav-list behaviour #4

Back to archive index

Yoji SHIDARA null+****@clear*****
Thu Oct 18 14:30:38 JST 2012


Yoji SHIDARA	2012-10-18 14:30:38 +0900 (Thu, 18 Oct 2012)

  New Revision: ad70a0036e89654244a086ea211a63e2a56595f9
  https://github.com/groonga/gcs-console/commit/ad70a0036e89654244a086ea211a63e2a56595f9

  Log:
    Consistent nav-list behaviour #4
    
    Treat 'Home' and 'Create New Domain' actions

  Modified files:
    routes/index.js
    views/application.jade
    views/domain.jade

  Modified: routes/index.js (+8 -5)
===================================================================
--- routes/index.js    2012-10-18 14:22:31 +0900 (05b6c1f)
+++ routes/index.js    2012-10-18 14:30:38 +0900 (8a2223b)
@@ -3,7 +3,7 @@ var _ = require('underscore');
 var http = require('http');
 
 exports.index = function(req, res) {
-  res.render('index');
+  res.render('index', {action: 'index'});
 };
 
 function withDomain(req, res, callback) {
@@ -45,7 +45,7 @@ function convertToArray(data) {
 exports.domain = function(req, res) {
   withDomain(req, res, function(req, res) {
     res.render('domain-show', {
-      action: 'about',
+      action: 'domain_show',
       domain: req.domain,
       indexFields: req.indexFields
     });
@@ -60,7 +60,7 @@ exports.domainSearch = function(req, res) {
 
     if (query === undefined) {
       var locals = {
-        action: 'search',
+        action: 'domain_search',
         domain: req.domain,
         query: null,
         requestURL: null,
@@ -92,7 +92,7 @@ exports.domainSearch = function(req, res) {
       searchResponse.on('end', function() {
         var results = JSON.parse(buffer);
         var locals = {
-          action: 'search',
+          action: 'domain_search',
           domain: req.domain,
           query: query,
           requestURL: requestURL,
@@ -132,7 +132,10 @@ exports.domainSearch = function(req, res) {
 };
 
 exports.domainCreate = function(req, res) {
-  res.render('domain-create', {domain: null});
+  res.render('domain-create', {
+    action: "domain_create",
+    domain: null
+  });
 };
 
 exports.domainCreatePost = function(req, res) {

  Modified: views/application.jade (+7 -2)
===================================================================
--- views/application.jade    2012-10-18 14:22:31 +0900 (a968d87)
+++ views/application.jade    2012-10-18 14:30:38 +0900 (b2bcdaf)
@@ -5,6 +5,11 @@ block application
     .span3
       .well(style="padding: 10px 0 10px 0;")
         ul.nav.nav-list
+          li(class=(action == "index" ? "active" : ""))
+            a(href="/")
+              .icon-home
+              | Home
+          li.divider
           li.nav-header Domains
           each domain in domains
             if domain.isSelected
@@ -18,10 +23,10 @@ block application
                   i.icon-folder-close
                   = domain.DomainName
           li.divider
-          li
+          li(class=(action == "domain_create" ? "active" : ""))
             a(href="/domain_create")
               i.icon-plus-sign
-              Create New Domain
+              | Create New Domain
 
     .span9
       block content

  Modified: views/domain.jade (+2 -2)
===================================================================
--- views/domain.jade    2012-10-18 14:22:31 +0900 (5ba61ee)
+++ views/domain.jade    2012-10-18 14:30:38 +0900 (ae2db2d)
@@ -4,9 +4,9 @@ block content
   h1= domain.DomainName
 
   ul.nav.nav-tabs
-    li(class=(action == "about" ? "active" : ""))
+    li(class=(action == "domain_show" ? "active" : ""))
       a(href="/domain/"+domain.DomainName) About
-    li(class=(action == "search" ? "active" : ""))
+    li(class=(action == "domain_search" ? "active" : ""))
       a(href="/domain/"+domain.DomainName+"/search") Search
 
   block domain-content
-------------- next part --------------
HTML����������������������������...
Download 



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