From 44b8758a6c42695ab3e39cc00fda4c15daa19e93 Mon Sep 17 00:00:00 2001 From: Jake Rosenberg Date: Thu, 9 Nov 2023 09:13:35 -0600 Subject: [PATCH] task/DES-2600: Use Google search engine for site searches. (#1111) * use site search powered by Google * Upgrade Django to v4.2 * refresh lockfile * replace is_ajax calls * upgrade to pyscopg3 (recommended by Django) and update storage settings. * transfer django-recaptcha2 to designsafe org * update pytest-django for django 4 compatibility * remove branding and add Designsafe footer * fix imports and add more stable debugging * replace deprecated smart_text import --------- Co-authored-by: Jake Rosenberg Co-authored-by: Jake Rosenberg --- .../search/templates/designsafe/apps/search/index.j2 | 5 ++++- designsafe/static/scripts/navbar.js | 2 +- designsafe/static/styles/ng-designsafe.css | 11 +++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/designsafe/apps/search/templates/designsafe/apps/search/index.j2 b/designsafe/apps/search/templates/designsafe/apps/search/index.j2 index 4637ed0428..f73698cd0a 100644 --- a/designsafe/apps/search/templates/designsafe/apps/search/index.j2 +++ b/designsafe/apps/search/templates/designsafe/apps/search/index.j2 @@ -8,12 +8,15 @@ {% block content %}
- + {{message}}
{% addtoblock "js" %} + {% endaddtoblock %} {% endblock %} +{% block footer %}{% include 'includes/footer.html' %}{% endblock footer %} diff --git a/designsafe/static/scripts/navbar.js b/designsafe/static/scripts/navbar.js index 3836c25dc4..fcf3749570 100644 --- a/designsafe/static/scripts/navbar.js +++ b/designsafe/static/scripts/navbar.js @@ -13,7 +13,7 @@ var radioValue = $('input[name="search-radio"]:checked').val(); var searchstring = $('#searchfield').val(); if (ev.which === 13 || ev.type === 'click') { - if (radioValue==='website') window.location = '/search?type_filter=all&query_string=' + searchstring; + if (radioValue==='website') window.location = '/search?q=' + searchstring; if (radioValue ==='datasets') { var datasetSearchUrl = `/data/browser/public/?query_string=%257B%2522queries%2522%253A%257B%2522searchString%2522%253A%2522${searchstring}%2522%252C%2522publicationYear%2522%253A%2522%2522%257D%252C%2522typeFilters%2522%253A%257B%2522experimental%2522%253Afalse%252C%2522simulation%2522%253Afalse%252C%2522field_recon%2522%253Afalse%252C%2522other%2522%253Afalse%252C%2522hybrid_simulation%2522%253Afalse%257D%252C%2522advancedFilters%2522%253A%257B%2522experimental%2522%253A%257B%2522experimentType%2522%253A%2522%2522%252C%2522experimentalFacility%2522%253A%257B%2522name%2522%253A%2522%2522%252C%2522label%2522%253A%2522%2522%257D%257D%252C%2522simulation%2522%253A%257B%2522simulationType%2522%253A%2522%2522%257D%252C%2522field_recon%2522%253A%257B%2522naturalHazardType%2522%253A%2522%2522%252C%2522naturalHazardEvent%2522%253A%2522%2522%252C%2522frType%2522%253A%2522%2522%252C%2522frDate%2522%253A%2522%2522%257D%252C%2522other%2522%253A%257B%2522dataType%2522%253A%2522%2522%257D%252C%2522hybrid_simulation%2522%253A%257B%2522hybridSimulationType%2522%253A%2522%2522%257D%257D%257D` window.location = datasetSearchUrl; diff --git a/designsafe/static/styles/ng-designsafe.css b/designsafe/static/styles/ng-designsafe.css index 5dbc5288b1..f08d5436e6 100644 --- a/designsafe/static/styles/ng-designsafe.css +++ b/designsafe/static/styles/ng-designsafe.css @@ -1053,3 +1053,14 @@ i[class^="icon-ls-pre/post"]:before, .cms-messages { display: none !important; } + +.gsc-selected-option-container { + max-width: 100% !important; +} + +.gsc-input { + background: none !important; +} +.gcsc-more-maybe-branding-root { + display: none !important; +} \ No newline at end of file