Skip to content

Commit

Permalink
Merge branch 'feature/load-m3-better' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ewlarson committed Dec 4, 2023
2 parents ce31994 + 9f82b29 commit 48cddbe
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
15 changes: 15 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,19 @@ def score_output(args)
def render_sidebar_map?(document)
Settings.SIDEBAR_STATIC_MAP&.any? { |vp| document.viewer_protocol == vp }
end

##
# Gets current layout for use in rendering partials
# @return [String] item, index, home, or default
def layout_type
if params[:controller] == "catalog"
if params[:action] == "show" || params[:action] == "downloads"
"item"
elsif params[:action] == "index"
"index"
end
else
"default"
end
end
end
6 changes: 5 additions & 1 deletion app/views/layouts/blacklight/base.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@
<%= opensearch_description_tag application_name, opensearch_catalog_url(format: 'xml') %>
<%= favicon_link_tag %>
<%= stylesheet_link_tag "application", media: "all" %>
<%= javascript_pack_tag 'm3' %>

<% if layout_type == "item" && @document && @document.viewer_protocol == 'iiif_manifest' %>
<%= javascript_pack_tag 'm3' %>
<% end %>

<%= javascript_include_tag "application" %>
<%= javascript_include_tag "analytics" %>

Expand Down

0 comments on commit 48cddbe

Please sign in to comment.