Skip to content

Commit

Permalink
task/DES-2600: Use Google search engine for site searches. (#1111)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
Co-authored-by: Jake Rosenberg <[email protected]>
  • Loading branch information
3 people authored Nov 9, 2023
1 parent 4620dff commit 44b8758
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@

{% block content %}
<div class="container">
<ui-view></ui-view>
<div class="gcse-search"></div>
{{message}}
</div>
</div>
{% addtoblock "js" %}
<script src="<%= htmlWebpackPlugin.files.js %>"></script>
<script async src="https://cse.google.com/cse.js?cx=7671a7caca0a643c1">
</script>
{% endaddtoblock %}

{% endblock %}
{% block footer %}{% include 'includes/footer.html' %}{% endblock footer %}
2 changes: 1 addition & 1 deletion designsafe/static/scripts/navbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
11 changes: 11 additions & 0 deletions designsafe/static/styles/ng-designsafe.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit 44b8758

Please sign in to comment.