Skip to content

Commit

Permalink
display the search bar and enable the search functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
chrimesdev committed Nov 15, 2019
1 parent 29ba5c0 commit 8cf483f
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 264 deletions.
8 changes: 2 additions & 6 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,15 @@ app.get('/service-manual/design-example/:example', (req, res) => {
res.render(baseTemplate, { body: exampleHtml });
});

/*
app.get('/service-manual/search', (req, res) => {
var query = req.query['search-field'] || '';
const query = req.query['search-field'] || '';
res.render('includes/search.njk', { results: pageIndex.search(query), query: query });
});

app.get('/service-manual/suggestions', (req, res) => {
res.set({ 'Content-Type': 'application/json' });
res.send(JSON.stringify(pageIndex.search(req.query.search)));
});
*/

app.get('/', (req, res) => {
res.redirect('/service-manual');
Expand Down Expand Up @@ -157,10 +155,8 @@ if (config.env === 'development') {
app.listen(config.port);
}

/*
setTimeout(function(){
setTimeout(() => {
pageIndex.init();
}, 2000);
*/

module.exports = app;
2 changes: 1 addition & 1 deletion app/scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import './polyfills';

// NHS.UK frontend
import nhsuk_skipLink from '../../node_modules/nhsuk-frontend/packages/components/skip-link/skip-link'; /* eslint-disable-line camelcase */
// import './search';
import './search';
import DesignExample from './design-example';

// Initialise components
Expand Down
4 changes: 2 additions & 2 deletions app/views/includes/header.njk
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"longName": "true"
},
"showNav": "false",
"showSearch": "false",
"showSearch": "true",
"searchAction": "/service-manual/search/"
})
}}
Expand All @@ -22,7 +22,7 @@
"longName": "true"
},
"showNav": "false",
"showSearch": "false",
"showSearch": "true",
"searchAction": "/service-manual/search/"
})
}}
Expand Down
Loading

0 comments on commit 8cf483f

Please sign in to comment.