-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into i350-derivatives
- Loading branch information
Showing
29 changed files
with
807 additions
and
55 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
//= require hyrax/uploader | ||
// This file is the default initialization of the fileupload. If you want to call | ||
// hyraxUploader with other options (like afterSubmit), then override this file. | ||
Blacklight.onLoad(function() { | ||
var options = {}; | ||
$('#fileupload').hyraxUploader(options); | ||
$('#fileuploadlogo').hyraxUploader({downloadTemplateId: 'logo-template-download'}); | ||
$('#fileuploadthumbnail').hyraxUploader({downloadTemplateId: 'thumbnail-template-download'}); | ||
}); |
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
21 changes: 21 additions & 0 deletions
21
app/controllers/concerns/hyku/collection_branding_behavior.rb
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,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Hyku | ||
module CollectionBrandingBehavior | ||
# This is used for saving the CollectionBrandingInfo files to 'public/uploads' directory. | ||
# | ||
# Originally, when `f.file_url` is called, there's a string sub that happens in | ||
# CarrierWave that puts it into the 'uploads' dir instead. We want it in the 'public/uploads' dir instead | ||
# @see https://github.com/carrierwaveuploader/carrierwave/blob/master/lib/carrierwave/uploader/url.rb#L24 | ||
def process_file_location(f) | ||
if /^http/.match?(f.file_url) | ||
f.file.download!(f.file_url) | ||
f.file_url | ||
elsif %r{^\/}.match?(f.file_url) | ||
f.file.path | ||
else | ||
f.file_url | ||
end | ||
end | ||
end | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
# frozen_string_literal: true | ||
# OVERRIDE Hyraxv5.0.0 to add the ability to upload a collection thumbnail | ||
|
||
Hyrax::Forms::PcdmCollectionForm.class_eval do | ||
include Hyrax::FormFields(:basic_metadata) | ||
include Hyrax::FormFields(:bulkrax_metadata) | ||
include CollectionAccessFiltering | ||
|
||
ThumbnailInfoPrepopulator = lambda do |_options = nil| | ||
self.thumbnail_info ||= begin | ||
thumbnail_info = CollectionBrandingInfo.where(collection_id: id.to_s, role: "thumbnail").first | ||
if thumbnail_info | ||
thumbnail_file = File.split(thumbnail_info.local_path).last | ||
alttext = thumbnail_info.alt_text | ||
file_location = thumbnail_info.local_path | ||
relative_path = "/" + thumbnail_info.local_path.split("/")[-4..-1].join("/") | ||
{ file: thumbnail_file, full_path: file_location, relative_path:, alttext: } | ||
else | ||
{} # Always return at least an empty hash | ||
end | ||
end | ||
end | ||
|
||
property :thumbnail_info, virtual: true, prepopulator: ThumbnailInfoPrepopulator | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<%# | ||
OVERRIDE Blacklight 7.35.0 to remove content_for(:container_header) | ||
The 'search_results_header' and 'constraints' partials were not being rendered. | ||
TODO: Figure out why this is happening and apply a proper fix. | ||
%> | ||
|
||
<% @page_title = t('blacklight.search.page_title.title', constraints: render_search_to_page_title(params), application_name: application_name) %> | ||
|
||
<% content_for(:head) do -%> | ||
<%= render 'catalog/opensearch_response_metadata', response: @response %> | ||
<%= rss_feed_link_tag %> | ||
<%= atom_feed_link_tag %> | ||
<%= json_api_link_tag %> | ||
<% end %> | ||
|
||
<% content_for(:skip_links) do -%> | ||
<%= link_to t('blacklight.skip_links.first_result'), '#documents', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbolinks: 'false' } %> | ||
<% end %> | ||
|
||
<%# OVERRIDE begin %> | ||
<%= render 'search_results_header' %> | ||
<%= render 'constraints' %> | ||
<%# OVERRIDE end %> | ||
|
||
<%= render 'search_header' %> | ||
|
||
<h2 class="sr-only visually-hidden"><%= t('blacklight.search.search_results') %></h2> | ||
|
||
<%- if @response.empty? %> | ||
<%= render "zero_results" %> | ||
<%- elsif render_grouped_response? %> | ||
<%= Deprecation.silence(Blacklight::RenderPartialsHelperBehavior) { render_grouped_document_index } %> | ||
<%- else %> | ||
<%= render_document_index @response.documents %> | ||
<%- end %> | ||
|
||
<%= render 'results_pagination' %> |
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
Oops, something went wrong.