diff --git a/app/views/catalog/_blacklight_allmaps.html.erb b/app/views/catalog/_blacklight_allmaps.html.erb new file mode 100644 index 0000000..44e7665 --- /dev/null +++ b/app/views/catalog/_blacklight_allmaps.html.erb @@ -0,0 +1,5 @@ +<% unless defined?(Geoblacklight) %> + <% if @document.sidecar_allmaps.georeferenced? %> + <%= render partial: 'allmaps/show/blacklight', locals: { document: @document } %> + <% end %> +<% end %> \ No newline at end of file diff --git a/app/views/catalog/_show_main_content.html.erb b/app/views/catalog/_show_main_content.html.erb deleted file mode 100644 index 6823b75..0000000 --- a/app/views/catalog/_show_main_content.html.erb +++ /dev/null @@ -1,58 +0,0 @@ -<% if Blacklight::VERSION.to_i > 8 %> - <%= render blacklight_config.track_search_session.item_pagination_component.new(search_context: @search_context, search_session: search_session, current_document: @document) if blacklight_config.track_search_session.item_pagination_component %> - <% @page_title = t('blacklight.search.show.title', document_title: document_presenter(@document).html_title, application_name: application_name).html_safe %> - <% content_for(:head) { render_link_rel_alternates } %> - - <% document_component = blacklight_config.view_config(:show).document_component -%> - <%= render (document_component).new(document_component.collection_parameter => document_presenter(@document), component: :div, show: true, partials: blacklight_config.view_config(:show).partials) do |component| %> - <% component.with_title(as: 'h1', classes: '', link_to_document: false, actions: false) %> - <% component.with_footer do %> - - <% unless defined?(Geoblacklight) %> - <% if @document.sidecar_allmaps.georeferenced? %> - <%= render partial: 'allmaps/show/blacklight', locals: { document: @document } %> - <% end %> - <% end %> - - <% if @document.respond_to?(:export_as_openurl_ctx_kev) %> - - - <% end %> - <% end %> - <% end %> - -<% else %> - <%= render(Blacklight::SearchContextComponent.new(search_context: @search_context, search_session: search_session)) if search_session['document_id'] == @document.id %> - - <% @page_title = t('blacklight.search.show.title', document_title: Deprecation.silence(Blacklight::BlacklightHelperBehavior) { document_show_html_title }, application_name: application_name).html_safe %> - <% content_for(:head) { render_link_rel_alternates } %> - - <%= render (blacklight_config.view_config(:show).document_component || Blacklight::DocumentComponent).new(presenter: document_presenter(@document), component: :div, title_component: :h1, show: true) do |component| %> - <% component.with_footer do %> - - <% unless defined?(Geoblacklight) %> - <% if @document.sidecar_allmaps.georeferenced? %> - <%= render partial: 'allmaps/show/blacklight', locals: { document: @document } %> - <% end %> - <% end %> - - <% if @document.respond_to?(:export_as_openurl_ctx_kev) %> - - - <% end %> - <% end %> - - <%# Use :body for complete backwards compatibility (overriding the component body markup), - but if the app explicitly opted-in to components, make the partials data available as :partials to ease migrations pain %> - <% component.public_send(blacklight_config.view_config(:show).document_component.blank? && blacklight_config.view_config(:show).partials.any? ? :with_body : :with_partial) do %> -
- <%= render_document_partials @document, blacklight_config.view_config(:show).partials, component: component %> -
- <% end %> - <% end %> -<% end %> - diff --git a/lib/generators/blacklight/allmaps/config_generator.rb b/lib/generators/blacklight/allmaps/config_generator.rb index f8c787a..b20033f 100644 --- a/lib/generators/blacklight/allmaps/config_generator.rb +++ b/lib/generators/blacklight/allmaps/config_generator.rb @@ -71,6 +71,16 @@ def add_gbl_tabbed_viewer gsub_file("app/controllers/catalog_controller.rb", "config.show.partials << \"show_default_viewer_container\"", "#config.show.partials << \"show_default_viewer_container\"") end + def add_bl_allmaps_viewer + return unless ENV["LIGHT"] == "blacklight" + # Use the allmaps viewer + inject_into_file "app/controllers/catalog_controller.rb", after: "#config.show.thumbnail_field = 'thumbnail_path_ss'" do + "\n + # Blacklight::Allmaps Viewer + config.show.partials.insert(1, :blacklight_allmaps)" + end + end + def add_bl_georeferenced_facet return unless ENV["LIGHT"] == "blacklight" inject_into_file "app/controllers/catalog_controller.rb", after: "config.add_facet_field 'subject_era_ssim', label: 'Era'" do