Skip to content

Commit

Permalink
Adds missing base.html.erb
Browse files Browse the repository at this point in the history
  • Loading branch information
spilth committed Aug 1, 2024
1 parent 8f8c818 commit 5c9da6c
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/helpers/geoblacklight_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,9 @@ def ol_viewer
:leaflet_options => leaflet_options
})
end

def iiif_manifest_container?
return false unless @document
@document&.item_viewer&.viewer_preference&.key?(:iiif_manifest)
end
end
52 changes: 52 additions & 0 deletions app/views/layouts/blacklight/base.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<!DOCTYPE html>
<%= content_tag :html, class: 'no-js', **html_tag_attributes do %>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="geoblacklight-version" content="<%= Geoblacklight::VERSION %>">

<!-- Internet Explorer use the highest version available -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<title><%= render_page_title %></title>
<script>
document.querySelector('html').classList.remove('no-js');
</script>
<%= opensearch_description_tag application_name, opensearch_catalog_url(format: 'xml') %>
<%= favicon_link_tag %>
<%= stylesheet_link_tag "application", media: "all", "data-turbo-track": "reload" %>
<%= javascript_include_tag "application", "data-turbo-track": "reload" %>

<%= vite_client_tag %>
<% if openlayers_container? %>
<%= vite_javascript_tag 'ol' %>
<% elsif iiif_manifest_container? %>
<%= vite_javascript_tag 'clover' %>
<% end %>

<%= csrf_meta_tags %>
<%= content_for(:head) %>
</head>
<body class="<%= render_body_class %>">
<nav id="skip-link" role="navigation" aria-label="<%= t('blacklight.skip_links.label') %>">
<%= link_to t('blacklight.skip_links.search_field'), '#search_field', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbolinks: 'false' } %>
<%= link_to t('blacklight.skip_links.main_content'), '#main-container', class: 'element-invisible element-focusable rounded-bottom py-2 px-3', data: { turbolinks: 'false' } %>
<%= content_for(:skip_links) %>
</nav>
<%= render partial: 'shared/header_navbar' %>

<main id="main-container" class="<%= container_classes %>" role="main" aria-label="<%= t('blacklight.main.aria.main_container') %>">
<%= content_for(:container_header) %>

<%= render partial: 'shared/flash_msg', layout: 'shared/flash_messages' %>

<div class="row">
<%= content_for?(:content) ? yield(:content) : yield %>
</div>
</main>

<%= render partial: 'shared/footer' %>
<%= render partial: 'shared/modal' %>
</body>
<% end %>

0 comments on commit 5c9da6c

Please sign in to comment.