[Groonga-commit] nroonga/norema [master] Link paths to the corresponding query

Back to archive index

Yoji SHIDARA null+****@clear*****
Wed Aug 15 13:48:02 JST 2012


Yoji SHIDARA	2012-08-15 13:48:02 +0900 (Wed, 15 Aug 2012)

  New Revision: ac15925e082bcaa1ef8e58a78aae8e006f4e5170
  https://github.com/nroonga/norema/commit/ac15925e082bcaa1ef8e58a78aae8e006f4e5170

  Log:
    Link paths to the corresponding query

  Modified files:
    lib/server.js
    views/search.jade

  Modified: lib/server.js (+2 -0)
===================================================================
--- lib/server.js    2012-08-15 13:34:04 +0900 (fde6133)
+++ lib/server.js    2012-08-15 13:48:02 +0900 (2e8fc1b)
@@ -1,5 +1,6 @@
 var http = require('http');
 var express = require('express');
+var querystring = require('querystring');
 var app = express();
 var env = process.env;
 var port = env.PORT ? parseInt(env.PORT, 10) : 3000;
@@ -69,6 +70,7 @@ app.get('/search', function(request, response, next) {
       return next(error);
     }
     var locals = {
+      querystring: querystring,
       query: query,
       records: results.hits.hit,
       num_found: results.hits.found,

  Modified: views/search.jade (+3 -2)
===================================================================
--- views/search.jade    2012-08-15 13:34:04 +0900 (01aae7c)
+++ views/search.jade    2012-08-15 13:48:02 +0900 (5b8c239)
@@ -18,8 +18,9 @@ block content
             h2 #{record.data.title}
             p.path
               each title, pathIndex in record.data.path
-                span.label.label-inverse
-                  = title
+                span
+                  a(href="/search?"+querystring.stringify({query: title}))
+                    = title
                 if pathIndex != record.data.path.length - 1
                   span  » 
 
-------------- next part --------------
HTML����������������������������...
Download 



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