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 6, 2019
1 parent db7f241 commit 1870ff3
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 13 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
1 change: 0 additions & 1 deletion app/views/sitemap.njk
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@
</ul>
</li>
<li><a href="/service-manual/accessibility">Accessibility</a></li>
<li><a href="/service-manual/cookies">Cookies</a></li>
<li><a href="/service-manual/terms-and-conditions">Terms and conditions</a></li>
<li><a href="/service-manual/privacy">Privacy</a></li>
</ul>
Expand Down
3 changes: 0 additions & 3 deletions app/views/sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
<url>
<loc>https://beta.nhs.uk/service-manual/accessibility-statement</loc>
</url>
<url>
<loc>https://beta.nhs.uk/service-manual/cookies</loc>
</url>
<url>
<loc>https://beta.nhs.uk/service-manual/sitemap</loc>
</url>
Expand Down

0 comments on commit 1870ff3

Please sign in to comment.