-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This feature introduces a search on the proprietor's home page (e.g. the root host of the Hyku instance). That form will then submit a search against the configured host for cross-tenant searching. In the case of "commonsarchive.org", that will be "//search.commonsarchive.org/catalog" (as demonstrated in the hard-coded value). Related to: - #947
- Loading branch information
Showing
8 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<%# OVERRIDE Copied from app/views/catalog/_search_form.html.erb | ||
Used for rendering the home URL. %> | ||
<%= form_tag Hyku::Application.cross_tenant_search_url, target: "_blank", method: :get, class: "form-horizontal search-form", id: "search-form-header", role: "search" do %> | ||
<%= render_hash_as_hidden_fields(search_state.params_for_search.except(:q, :search_field, :qt, :page, :utf8)) %> | ||
<%= hidden_field_tag :search_field, 'all_fields' %> | ||
<div class="form-group"> | ||
<label class="control-label col-sm-3" for="search-field-header"> | ||
<%= t("hyku.splash.form.q.label", application_name: application_name) %> | ||
</label> | ||
<div class="input-group"> | ||
<%= text_field_tag :q, current_search_parameters , class: "q form-control", id: "search-field-header", placeholder: t("hyrax.search.form.q.placeholder") %> | ||
<div class="input-group-btn"> | ||
<button type="submit" class="btn btn-primary" id="search-submit-header"> | ||
<%= t('hyrax.search.button.html') %> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'spec_helper' | ||
|
||
RSpec.describe Hyku::Application do | ||
describe ".cross_tenant_search_url" do | ||
subject { described_class.cross_tenant_search_url } | ||
|
||
it { is_expected.to start_with("//") } | ||
end | ||
|
||
describe ".cross_tenant_search_host" do | ||
subject { described_class.cross_tenant_search_host } | ||
|
||
it { is_expected.to be_present } | ||
it { is_expected.to be_a(String) } | ||
end | ||
end |