Skip to content
This repository has been archived by the owner on Jul 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #74 from alphagov/remove-custom-search-results
Browse files Browse the repository at this point in the history
Remove custom search results
  • Loading branch information
Rosa-Fox authored Nov 17, 2022
2 parents b478720 + 98d79bc commit 08c3572
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 267 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,12 @@ You can then browse to the server in your browser.
[3]: https://devcenter.heroku.com/articles/config-vars
[4]: https://github.com/alphagov/govuk-secrets/tree/main/pass#usage

## Custom search result pages

/corona and /brexit pages previously displayed live search results that matched coronavirus and brexit related terms.
They were removed due to lack of use. [Use this PR](https://github.com/alphagov/govuk-display-screen/pull/74)
as an example if bespoke search result pages need to be created in future.

# Licence

Copyright (C) 2013 Edd Sowden
Expand Down
81 changes: 0 additions & 81 deletions public/brexit.html

This file was deleted.

81 changes: 0 additions & 81 deletions public/corona.html

This file was deleted.

39 changes: 0 additions & 39 deletions public/javascripts/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,6 @@
},
init: function(){
search.$el = $('#search');
if($('#brexit-search').length) {
search.initBrexit();
}

if($('#corona-search').length) {
search.initCorona();
}

search.reload();
search.displayResults();
Expand All @@ -136,38 +129,6 @@
updateElement: function() {
return(search.$el);
},
updateBrexitElement: function(term) {
if(search.brexitTerm(term)){
return(search.$bel);
}
return(search.$el);
},
initBrexit: function() {
search.$bel = $('#brexit-search');
search.updateElement = search.updateBrexitElement;
},
brexitTerm: function(term){
if(term.toLowerCase().match(/eea|e111|\ ehic|deal|withdrawal agreement|no-deal|article 50|brexit|\ eu|eu\ |remain|citizenship|european|settlement|abroad|settled|leave to remain/)){
return true;
}
return false;
},
initCorona: function() {
search.$coronal_el = $('#corona-search');
search.updateElement = search.updateCoronaElement;
},
coronaTerm: function(term){
if(term.toLowerCase().match(/corona|wash|hands|covid|COVID-19|COVID19|virus|ssp\ |sick|self.isolation|isolation|closures?|quarantine|key.workers?|essential|vulnerable|shops?|lockdown/)){
return true;
}
return false;
},
updateCoronaElement: function(term) {
if(search.coronaTerm(term)){
return(search.$coronal_el);
}
return(search.$el);
},
};

root.matrix.search = search;
Expand Down
54 changes: 0 additions & 54 deletions public/search.html

This file was deleted.

12 changes: 0 additions & 12 deletions server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,6 @@
File.read(File.join('public', 'index.html'))
end

get '/search' do
File.read(File.join('public', 'search.html'))
end

get '/brexit' do
File.read(File.join('public', 'brexit.html'))
end

get '/corona' do
File.read(File.join('public', 'corona.html'))
end

get '/realtime' do
cache_control :public, :max_age => 20
query = { :access_token => get_token }.merge(params)
Expand Down

0 comments on commit 08c3572

Please sign in to comment.