- <% if !workflow_restriction?(presenter) %>
- <% if presenter.show_deposit_for?(collections: @user_collections) %>
-
- <%= button_tag t('hyrax.dashboard.my.action.add_to_collection'),
- class: 'btn btn-default submits-batches submits-batches-add',
- data: { toggle: "modal", target: "#collection-list-container" } %>
- <% end %>
- <% if presenter.work_featurable? %>
- <%= link_to t('.feature'), hyrax.featured_work_path(presenter, format: :json),
- data: { behavior: 'feature' },
- class: presenter.display_feature_link? ? 'btn btn-default' : 'btn btn-default collapse' %>
+ <% if !workflow_restriction?(presenter) %>
+ <% if presenter.show_deposit_for?(collections: @user_collections) %>
+
+ <%= button_tag t('hyrax.dashboard.my.action.add_to_collection'),
+ class: 'btn btn-secondary submits-batches submits-batches-add',
+ data: { toggle: "modal", target: "#collection-list-container" } %>
+ <% end %>
+ <% if presenter.work_featurable? %>
+ <%= link_to t('.feature'), hyrax.featured_work_path(presenter, format: :json),
+ data: { behavior: 'feature' },
+ class: presenter.display_feature_link? ? 'btn btn-secondary' : 'btn btn-secondary collapse' %>
- <%= link_to t('.unfeature'), hyrax.featured_work_path(presenter, format: :json),
- data: { behavior: 'unfeature' },
- class: presenter.display_unfeature_link? ? 'btn btn-default' : 'btn btn-default collapse' %>
+ <%= link_to t('.unfeature'), hyrax.featured_work_path(presenter, format: :json),
+ data: { behavior: 'unfeature' },
+ class: presenter.display_unfeature_link? ? 'btn btn-secondary' : 'btn btn-secondary collapse' %>
+ <% end %>
<% end %>
- <% end %>
- <% if Hyrax.config.analytics? %>
- <% # turbolinks needs to be turned off or the page will use the cache and the %>
- <% # analytics graph will not show unless the page is refreshed. %>
- <%= link_to t('.analytics'), presenter.stats_path, id: 'stats', class: 'btn btn-default', data: { turbolinks: false } %>
- <% end %>
-
- <% if presenter.editor? && !workflow_restriction?(presenter) %>
- <%= link_to t('.edit'), edit_polymorphic_path([main_app, presenter]), class: 'btn btn-default', data: { turbolinks: block_valkyrie_redirect? } %>
- <% if presenter.member_count > 1 %>
- <%= link_to t("hyrax.file_manager.link_text"), polymorphic_path([main_app, :file_manager, presenter]), class: 'btn btn-default' %>
+ <% if Hyrax.config.analytics_reporting? %>
+ <% # turbolinks needs to be turned off or the page will use the cache and the %>
+ <% # analytics graph will not show unless the page is refreshed. %>
+ <%= link_to t('.analytics'), presenter.stats_path, id: 'stats', class: 'btn btn-secondary', data: { turbolinks: false } %>
<% end %>
- <% if presenter.valid_child_concerns.length > 0 %>
-
-
-
- <% end %>
- <%# OVERRIDE to validate delete permission %>
- <% if current_ability.can?(:delete, presenter.solr_document) %>
- <%= link_to t('.delete'), [main_app, presenter], class: 'btn btn-danger', data: { confirm: t('.confirm_delete', work_type: presenter.human_readable_type) }, method: :delete %>
+ <% end %>
+ <%# OVERRIDE to validate delete permission %>
+ <% if current_ability.can?(:delete, presenter.solr_document) %>
+ <%= link_to t('.delete'), [main_app, presenter], class: 'btn btn-danger', data: { confirm: t('.confirm_delete', work_type: presenter.human_readable_type) }, method: :delete %>
+ <% end %>
<% end %>
- <% end %>
- <%= render 'hyrax/dashboard/collections/form_for_select_collection', user_collections: @user_collections %>
+<%= render 'hyrax/dashboard/collections/form_for_select_collection', user_collections: @user_collections %>
diff --git a/app/views/hyrax/base/show.html.erb b/app/views/hyrax/base/show.html.erb
index 72b479e6..51c7a50b 100644
--- a/app/views/hyrax/base/show.html.erb
+++ b/app/views/hyrax/base/show.html.erb
@@ -38,8 +38,6 @@
<%= render('download_pdf', presenter: @presenter, file_set_id: @presenter.file_set_presenters.first.id) if @presenter.show_pdf_download_button? %>
<%= render 'citations', presenter: @presenter %>
-
- <%#= render 'analytics_button', presenter: @presenter %>
<% end %>
diff --git a/app/views/themes/adventist_digital_library/shared/_appearance_styles.html.erb b/app/views/themes/adventist_digital_library/shared/_appearance_styles.html.erb
deleted file mode 100644
index 77bc4ee9..00000000
--- a/app/views/themes/adventist_digital_library/shared/_appearance_styles.html.erb
+++ /dev/null
@@ -1,170 +0,0 @@
-<%# OVERRIDE: Add custom header & footer gradients for Adventist Digital Library %>
-
-<% # Dynamic styles added by the admin in the appearances page %>
-<% appearance = Hyku::Forms::Admin::Appearance.new %>
-
diff --git a/app/views/themes/adventist_digital_library/shared/_footer.html.erb b/app/views/themes/adventist_digital_library/shared/_footer.html.erb
index 011b45de..b74d6728 100644
--- a/app/views/themes/adventist_digital_library/shared/_footer.html.erb
+++ b/app/views/themes/adventist_digital_library/shared/_footer.html.erb
@@ -7,8 +7,8 @@
">
<%= link_to t(:'hyrax.controls.about'), hyrax.about_path, aria: current_page?(hyrax.about_path) ? {current: 'page'} : nil %>
">
- <%= link_to t(:'hyrax.controls.resources'), hyku_knapsack.resources_path, aria: current_page?(hyku_knapsack.resources_path) ? {current: 'page'} : nil %>
+
">
+ <%= link_to t(:'hyrax.controls.help'), hyrax.help_path, aria: current_page?(hyrax.help_path) ? {current: 'page'} : nil %>
">
<%= link_to t(:'hyrax.controls.contact'), hyrax.contact_path, aria: current_page?(hyrax.contact_path) ? {current: 'page'} : nil %>
diff --git a/config/initializers/bulkrax.rb b/config/initializers/bulkrax.rb
index e53a3fe3..58e0a4cb 100644
--- a/config/initializers/bulkrax.rb
+++ b/config/initializers/bulkrax.rb
@@ -3,12 +3,9 @@
# Ensure Knapsack version gets loaded after Hyku's bulkrax.rb
Rails.application.config.after_initialize do
Bulkrax.setup do |config|
- ##
- # By default this is the first registered curation concern. But based on tests and past
- # configs, this should be 'GenericWork'. Note: The below value could change, but it should be
- # explicit.
- #
- # See https://github.com/samvera/hyku/blob/07fde572f9152d513b13f71cae90dd4fdfbfba6c/config/initializers/hyrax.rb#L200-L202
+ # WorkType to use as the default if none is specified in the import
+ # Default is the first returned by Hyrax.config.curation_concerns
+ # config.default_work_type = MyWork
config.default_work_type = 'GenericWork'
# Setting the available parsers for Adventist.
@@ -17,103 +14,18 @@
{ name: "CSV - Comma Separated Values", class_name: "Bulkrax::CsvParser", partial: "csv_fields" },
]
- # Should Bulkrax make up source identifiers for you? This allow round tripping
- # and download errored entries to still work, but does mean if you upload the
- # same source record in two different files you WILL get duplicates.
- # It is given two aruguments, self at the time of call and the index of the reocrd
- # config.fill_in_blank_source_identifiers = ->(parser, index) { "b-#{parser.importer.id}-#{index}"}
- # or use a uuid
- # config.fill_in_blank_source_identifiers = ->(parser, index) { SecureRandom.uuid }
-
- # Field mappings
- # Create a completely new set of mappings by replacing the whole set as follows
- # config.field_mappings = {
- # "Bulkrax::OaiDcParser" => { **individual field mappings go here*** }
- # }
+ # Field to use during import to identify if the Work or Collection already exists.
+ # Default is 'source'.
+ # config.system_identifier_field = 'source'
- # Add to, or change existing mappings as follows
- # e.g. to exclude date
- # config.field_mappings["Bulkrax::OaiDcParser"]["date"] = { from: ["date"], excluded: true }
- #
- # # e.g. to add the required source_identifier field
- # # config.field_mappings["Bulkrax::CsvParser"]["source_id"] = { from: ["old_source_id"], source_identifier: true }
- # If you want Bulkrax to fill in source_identifiers for you, see below
+ # Path to store pending imports
+ # config.import_path = 'tmp/imports'
- # To duplicate a set of mappings from one parser to another
- # config.field_mappings["Bulkrax::OaiOmekaParser"] = {}
- # config.field_mappings["Bulkrax::OaiDcParser"].each {|key,value| config.field_mappings["Bulkrax::OaiOmekaParser"][key] = value }
- config.field_mappings['Bulkrax::OaiAdventistQdcParser'] = {
- 'abstract' => { from: ['abstract'] },
- 'aark_id' => { from: ['aark_id'] },
- 'identifier' => { from: ['identifier'], source_identifier: true },
- 'bibliographic_citation' => { from: ['bibliographic_citation'] },
- 'creator' => { from: ['creator'] },
- 'contributor' => { from: ['contributor'] },
- 'edition' => { from: ['edition'] },
- 'resource_type' => { from: ['resource_type'] },
- 'issue_number' => { from: ['issue_number'] },
- 'language' => { from: ['language'] },
- 'description' => { from: ['description'] },
- 'pagination' => { from: ['pagination'] },
- 'extent' => { from: ['extent'], split: ';' },
- 'source' => { from: ['source'] },
- 'date_issued' => { from: ['date_issued'] },
- 'alt' => { from: ['geocode'] },
- 'publisher' => { from: ['publisher'], split: ';' },
- 'rights_statement' => { from: ['rights_statement'] },
- 'part_of' => { from: ['part_of'] },
- 'part' => { from: ['part_of'] },
- 'date_created' => { from: ['date_created'] },
- 'title' => { from: ['title'] },
- 'subject' => { from: ['subject'], split: ';' },
- 'volume_number' => { from: ['volume_number'] },
- 'keyword' => { from: ['keyword'], split: ';' },
- 'location' => { from: ['location'], split: ';' },
- 'model' => { from: ['model', 'work_type'] },
- 'remote_files' => { from: ['related_url'], split: ';', parsed: true },
- 'thumbnail_url' => { from: ['thumbnail_url'], default_thumbnail: true, parsed: true },
- 'video_embed' => { from: ['video_embed'] },
- 'refereed' => { from: ['peer_reviewed'] }
- }
- config.field_mappings['Bulkrax::CsvParser'] = {
- 'abstract' => { from: ['description.abstract'] },
- 'aark_id' => { from: ['identifier.ark'] },
- 'identifier' => { from: ['identifier'], source_identifier: true },
- 'bibliographic_citation' => { from: ['identifier.bibliographicCitation'] },
- 'creator' => { from: ['creator'], split: ';' },
- 'contributor' => { from: ['contributor'], split: ';' },
- 'edition' => { from: ['title.release'] },
- 'resource_type' => { from: ['type'] },
- 'issue_number' => { from: ['relation.isPartOfIssue'] },
- 'language' => { from: ['language'], split: ';' },
- 'description' => { from: ['description'], split: ';' },
- 'pagination' => { from: ['format.extent'] },
- 'extent' => { from: ['format.extent'], split: ';' },
- 'source' => { from: ['source'], split: ';' },
- 'date_issued' => { from: ['date'] },
- 'alt' => { from: ['coverage.spatial'] },
- 'publisher' => { from: ['publisher'], split: ';' },
- 'rights_statement' => { from: ['rights'] },
- 'part_of' => { from: ['relation.isPartOf'], split: ';' },
- 'part' => { from: ['relation.isPartOf'] },
- 'date_created' => { from: ['date.other'] },
- 'title' => { from: ['title'] },
- 'subject' => { from: ['subject'], split: ';' },
- 'volume_number' => { from: ['relation.isPartOfVolume'] },
- 'keyword' => { from: ['keyword'], split: ';' },
- 'location' => { from: ['location'], split: ';' },
- 'model' => { from: ['work_type'] },
- 'remote_files' => { from: ['related_url'], split: ';', parsed: true },
- 'remote_url' => { from: ['official_url', 'remote_url'], split: ';' },
- 'thumbnail_url' => { from: ['thumbnail_url'], default_thumbnail: true, parsed: true },
- 'video_embed' => { from: ['video_embed'] },
- 'refereed' => { from: ['peer_reviewed'] }
- }
+ # Path to store exports before download
+ # config.export_path = 'tmp/exports'
- config.field_mappings['Bulkrax::CsvParser'].merge!(
- 'parents' => { from: ['parents'], split: /\s*[;|]\s*/, related_parents_field_mapping: true },
- 'children' => { from: ['children'], split: /\s*[;|]\s*/, related_children_field_mapping: true }
- )
+ # Server name for oai request header
+ # config.server_name = 'my_server@name.com'
# Lambda to set the default field mapping
config.default_field_mapping = lambda do |field|
@@ -130,41 +42,5 @@
}
}
end
-
- # WorkType to use as the default if none is specified in the import
- # Default is the first returned by Hyrax.config.curation_concerns
- # config.default_work_type = MyWork
-
- # Path to store pending imports
- # config.import_path = 'tmp/imports'
-
- # Path to store exports before download
- # config.export_path = 'tmp/exports'
-
- # Server name for oai request header
- # config.server_name = 'my_server@name.com'
-
- # Field_mapping for establishing a parent-child relationship (FROM parent TO child)
- # This can be a Collection to Work, or Work to Work relationship
- # This value IS NOT used for OAI, so setting the OAI Entries here will have no effect
- # The mapping is supplied per Entry, provide the full class name as a string, eg. 'Bulkrax::CsvEntry'
- # Example:
- # {
- # 'Bulkrax::RdfEntry' => 'http://opaquenamespace.org/ns/contents',
- # 'Bulkrax::CsvEntry' => 'children'
- # }
- # By default no parent-child relationships are added
- # config.parent_child_field_mapping = { }
-
- # Field_mapping for establishing a collection relationship (FROM work TO collection)
- # This value IS NOT used for OAI, so setting the OAI parser here will have no effect
- # The mapping is supplied per Entry, provide the full class name as a string, eg. 'Bulkrax::CsvEntry'
- # The default value for CSV is collection
- # Add/replace parsers, for example:
- # config.collection_field_mapping['Bulkrax::RdfEntry'] = 'http://opaquenamespace.org/ns/set'
-
- # Properties that should not be used in imports/exports. They are reserved for use by Hyrax.
- # config.reserved_properties += ['my_field']
-
end
end
diff --git a/config/initializers/default_bulkrax_mappings.rb b/config/initializers/default_bulkrax_mappings.rb
new file mode 100644
index 00000000..fe3d5a18
--- /dev/null
+++ b/config/initializers/default_bulkrax_mappings.rb
@@ -0,0 +1,76 @@
+# frozen_string_literal: true
+
+mappings = {}
+
+## Set custom bulkrax parser field mappings for app
+mappings["Bulkrax::OaiAdventistQdcParser"] = {
+ 'abstract' => { from: ['abstract'] },
+ 'aark_id' => { from: ['aark_id'] },
+ 'identifier' => { from: ['identifier'], source_identifier: true },
+ 'bibliographic_citation' => { from: ['bibliographic_citation'] },
+ 'creator' => { from: ['creator'] },
+ 'contributor' => { from: ['contributor'] },
+ 'edition' => { from: ['edition'] },
+ 'resource_type' => { from: ['resource_type'] },
+ 'issue_number' => { from: ['issue_number'] },
+ 'language' => { from: ['language'] },
+ 'description' => { from: ['description'] },
+ 'pagination' => { from: ['pagination'] },
+ 'extent' => { from: ['extent'], split: ';' },
+ 'source' => { from: ['source'] },
+ 'date_issued' => { from: ['date_issued'] },
+ 'alt' => { from: ['geocode'] },
+ 'publisher' => { from: ['publisher'], split: ';' },
+ 'rights_statement' => { from: ['rights_statement'] },
+ 'part_of' => { from: ['part_of'] },
+ 'part' => { from: ['part_of'] },
+ 'date_created' => { from: ['date_created'] },
+ 'title' => { from: ['title'] },
+ 'subject' => { from: ['subject'], split: ';' },
+ 'volume_number' => { from: ['volume_number'] },
+ 'keyword' => { from: ['keyword'], split: ';' },
+ 'location' => { from: ['location'], split: ';' },
+ 'model' => { from: ['model', 'work_type'] },
+ 'remote_files' => { from: ['related_url'], split: ';', parsed: true },
+ 'thumbnail_url' => { from: ['thumbnail_url'], default_thumbnail: true, parsed: true },
+ 'video_embed' => { from: ['video_embed'] },
+ 'refereed' => { from: ['peer_reviewed'] }
+}
+mappings["Bulkrax::CsvParser"] = {
+ 'abstract' => { from: ['description.abstract'] },
+ 'aark_id' => { from: ['identifier.ark'] },
+ 'identifier' => { from: ['identifier'], source_identifier: true },
+ 'bibliographic_citation' => { from: ['identifier.bibliographicCitation'] },
+ 'creator' => { from: ['creator'], split: ';' },
+ 'contributor' => { from: ['contributor'], split: ';' },
+ 'edition' => { from: ['title.release'] },
+ 'resource_type' => { from: ['type'] },
+ 'issue_number' => { from: ['relation.isPartOfIssue'] },
+ 'language' => { from: ['language'], split: ';' },
+ 'description' => { from: ['description'], split: ';' },
+ 'pagination' => { from: ['format.extent'] },
+ 'extent' => { from: ['format.extent'], split: ';' },
+ 'source' => { from: ['source'], split: ';' },
+ 'date_issued' => { from: ['date'] },
+ 'alt' => { from: ['coverage.spatial'] },
+ 'publisher' => { from: ['publisher'], split: ';' },
+ 'rights_statement' => { from: ['rights'] },
+ 'part_of' => { from: ['relation.isPartOf'], split: ';' },
+ 'part' => { from: ['relation.isPartOf'] },
+ 'date_created' => { from: ['date.other'] },
+ 'title' => { from: ['title'] },
+ 'subject' => { from: ['subject'], split: ';' },
+ 'volume_number' => { from: ['relation.isPartOfVolume'] },
+ 'keyword' => { from: ['keyword'], split: ';' },
+ 'location' => { from: ['location'], split: ';' },
+ 'model' => { from: ['work_type'] },
+ 'remote_files' => { from: ['related_url'], split: ';', parsed: true },
+ 'remote_url' => { from: ['official_url', 'remote_url'], split: ';' },
+ 'thumbnail_url' => { from: ['thumbnail_url'], default_thumbnail: true, parsed: true },
+ 'video_embed' => { from: ['video_embed'] },
+ 'refereed' => { from: ['peer_reviewed'] },
+ 'parents' => { from: ['parents'], split: /\s*[;|]\s*/, related_parents_field_mapping: true },
+ 'children' => { from: ['children'], split: /\s*[;|]\s*/, related_children_field_mapping: true }
+}
+
+Hyku.default_bulkrax_field_mappings = mappings
diff --git a/config/locales/hyrax.en.yml b/config/locales/hyrax.en.yml
index 43545412..3c6f665d 100644
--- a/config/locales/hyrax.en.yml
+++ b/config/locales/hyrax.en.yml
@@ -499,7 +499,6 @@ en:
about: About
contact: Contact
help: Help
- resources: Other Resources
home: Home
dashboard:
additional_notifications: See all notifications
@@ -920,7 +919,6 @@ en:
agreement_page: Deposit Agreement
help_page: Help Page
terms_page: Terms of Use
- resources_page: Other Resources
updated: Pages updated.
passive_consent_to_agreement: By saving this work I agree to the
search:
diff --git a/config/routes.rb b/config/routes.rb
index 45717926..de7a427e 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
HykuKnapsack::Engine.routes.draw do
mount Hyrax::Engine, at: '/'
- get 'resources' => 'pages#show', key: 'resources'
mount IiifPrint::Engine, at: '/'
end
diff --git a/docker-compose.yml b/docker-compose.yml
index ff04993f..683fb932 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -121,6 +121,9 @@ services:
web:
<<: *app
+ extends:
+ file: hyrax-webapp/docker-compose.yml
+ service: web
# Uncomment command to access container with out starting bin/web. Useful for debugging or updating Gemfile.lock
# command: sleep infinity
environment:
diff --git a/hyrax-webapp b/hyrax-webapp
index 2f9dd853..bf83f243 160000
--- a/hyrax-webapp
+++ b/hyrax-webapp
@@ -1 +1 @@
-Subproject commit 2f9dd8532ea46ba3a2cde5505775f4fd835b6f60
+Subproject commit bf83f243724943c28116f4c0a37ed4b200d794c0
diff --git a/spec/controllers/hyrax/hyrax/admin/appearances_controller_spec.rb b/spec/controllers/hyrax/hyrax/admin/appearances_controller_spec.rb
deleted file mode 100644
index e0c57526..00000000
--- a/spec/controllers/hyrax/hyrax/admin/appearances_controller_spec.rb
+++ /dev/null
@@ -1,80 +0,0 @@
-# frozen_string_literal: true
-
-RSpec.describe Hyrax::Admin::AppearancesController, type: :controller, singletenant: true do
- before { sign_in user }
-
- routes { Hyrax::Engine.routes }
-
- context 'with an unprivileged user' do
- let(:user) { create(:user) }
-
- describe "GET #show" do
- it "denies the request" do
- get :show
- expect(response).to have_http_status(:unauthorized)
- end
- end
-
- describe "PUT #update" do
- it "denies the request" do
- put :update
- expect(response).to have_http_status(:unauthorized)
- end
- end
- end
-
- context 'with an administrator' do
- let(:user) { create(:admin) }
-
- describe "GET #show" do
- it "assigns the requested site as @site" do
- get :show, params: {}
- expect(response).to be_successful
- end
- end
-
- describe "PUT #update" do
- let(:hyrax) { routes.url_helpers }
-
- context "with valid params" do
- let(:valid_attributes) do
- { banner_image: "image.jpg", directory_image: "image.jpg" }
- end
-
- it "sets a banner image" do
- expect(Site.instance.banner_image?).to be false
- f = fixture_file_upload('/images/nypl-hydra-of-lerna.jpg', 'image/jpg')
- post :update, params: { admin_appearance: { banner_image: f } }
- expect(response).to redirect_to(hyrax.admin_appearance_path(locale: 'en'))
- expect(flash[:notice]).to include("The appearance was successfully updated")
- expect(Site.instance.banner_image?).to be true
- end
-
- it "sets a directory image" do
- expect(Site.instance.directory_image?).to be false
- f = fixture_file_upload('/images/nypl-hydra-of-lerna.jpg', 'image/jpg')
- post :update, params: { admin_appearance: { directory_image: f } }
- expect(response).to redirect_to(hyrax.admin_appearance_path(locale: 'en'))
- expect(flash[:notice]).to include("The appearance was successfully updated")
- expect(Site.instance.directory_image?).to be true
- end
-
- it "redirects to the site" do
- put :update, params: { admin_appearance: valid_attributes }
- expect(response).to redirect_to(hyrax.admin_appearance_path(locale: 'en'))
- end
- end
-
- context "with invalid params" do
- let(:invalid_attributes) do
- { banner_image: "" }
- end
-
- it "re-renders the 'show' template" do
- put :update, params: { admin_appearance: invalid_attributes }
- expect(response).to redirect_to(action: "show")
- end
- end
- end
- end
-end