Skip to content

Commit

Permalink
Merge pull request #30 from mlibrary/DCP2-233-using-these-materials
Browse files Browse the repository at this point in the history
Using These Materials base page & links
  • Loading branch information
Anthony Thomas authored Nov 3, 2022
2 parents a14035f + ab6039e commit cc87d63
Show file tree
Hide file tree
Showing 8 changed files with 143 additions and 35 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/dul-arclight/modules/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ p, dd {
/* Sticky navigation for sidebar */
.sticky-nav {
position: sticky;
top: 100px;
top: 4px;
@include media-breakpoint-down(lg) {
position: static;
}
Expand Down
16 changes: 16 additions & 0 deletions app/assets/stylesheets/umich-arclight/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,20 @@ a {

.responsiveTruncate{
font-size: 1rem;
}

/* =============++========= */
/* Prose/Text Container */
/* ====================== */

.prose-container {
padding: 4rem 0;

h1 {
max-width: 40ch;
font-size: 2.5rem;
}
h2 {
padding-top:1rem;
}
}
65 changes: 34 additions & 31 deletions app/controllers/repositories_controller.rb
Original file line number Diff line number Diff line change
@@ -1,40 +1,43 @@
# frozen_string_literal: true

module Arclight
# Controller for our /repositories index page
class RepositoriesController < ApplicationController
def index
@repositories = Arclight::Repository.all
load_collection_counts
end
# Controller for our /repositories index page
class RepositoriesController < ApplicationController
def index
@repositories = Arclight::Repository.all
load_collection_counts
end

def show
@repository = Arclight::Repository.find_by!(slug: params[:id])
search_service = Blacklight.repository_class.new(blacklight_config)
@response = search_service.search(
q: "level_sim:Collection repository_sim:\"#{@repository.name}\"",
rows: 100
)
@collections = @response.documents
end
def show
@repository = Arclight::Repository.find_by!(slug: params[:id])
search_service = Blacklight.repository_class.new(blacklight_config)
@response = search_service.search(
q: "level_sim:Collection repository_sim:\"#{@repository.name}\"",
rows: 100
)
@collections = @response.documents
end

private
def about
@repository = Arclight::Repository.find_by(slug: params[:id])
render "arclight/repositories/about"
end

def load_collection_counts
counts = fetch_collection_counts
@repositories.each do |repository|
repository.collection_count = counts[repository.name] || 0
end
end
private

def fetch_collection_counts
search_service = Blacklight.repository_class.new(blacklight_config)
results = search_service.search(
q: 'level_sim:Collection',
'facet.field': 'repository_sim',
rows: 0
)
Hash[*results.facet_fields['repository_sim']]
def load_collection_counts
counts = fetch_collection_counts
@repositories.each do |repository|
repository.collection_count = counts[repository.name] || 0
end
end

def fetch_collection_counts
search_service = Blacklight.repository_class.new(blacklight_config)
results = search_service.search(
q: 'level_sim:Collection',
'facet.field': 'repository_sim',
rows: 0
)
Hash[*results.facet_fields['repository_sim']]
end
end
24 changes: 24 additions & 0 deletions app/views/arclight/repositories/about.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<%#= @repository.inspect %>
<div class="prose prose-container">
<h1>Using Materials from <%= @repository.name %></h1>

<p><%= @repository.using_materials.html_safe %></p>

<% if @repository.visitor_info %>
<h2>Info for Visitors</h2>

<p><%= @repository.visitor_info.html_safe %></p>
<% end %>

<% if @repository.how_to_request %>
<h2 id="requesting">How to Request</h2>

<p><%= @repository.how_to_request.html_safe %></p>
<% end %>

<% if @repository.how_to_order %>
<h2 id="ordering">Ordering Reproductions</h2>

<p><%= @repository.how_to_order.html_safe %></p>
</div>
<% end %>
12 changes: 11 additions & 1 deletion app/views/catalog/_using_header.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@
<%= t("arclight.views.show.sections.using_field") %>
</h2>
<p>
INSERT CONTENT HERE
<%= link_to 'Info for Visitors', repository_about_path(@document.repository_config.slug), target: '_blank' %>
</p>
<p>
<% if @document.repository_config.how_to_request %>
<%= link_to 'How to Request', repository_about_path(@document.repository_config.slug, anchor: 'requesting'), target: '_blank' %>
<% end %>
</p>
<p>
<% if @document.repository_config.how_to_order %>
<%= link_to 'Ordering Reproductions', repository_about_path(@document.repository_config.slug, anchor: 'ordering'), target: '_blank' %>
<% end %>
</p>

<hr/>
31 changes: 31 additions & 0 deletions config/repositories.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ bhl:
phone: ''
contact_info: '[email protected]'
thumbnail_url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/9/93/Bhlexterior.jpg/150px-Bhlexterior.jpg'
repo_about:
using_materials: 'Finding aids describe collections of primary sources and other unique, original, or rare materials. Some finding aids contain links to digitized versions of parts or all of a collection. Access to the original physical items, when available, requires requesting items for use in the reading room. Items may not be requested for use outside of the library.'
visitor_info: 'The Bentley is open by appointment only Monday-Friday 10am - 4pm, including the general public. For more information, visit <a href="https://bentley.umich.edu/research/policies/">In-Person Research Policies</a>.'
how_to_request: 'Please visit <a href="https://bentley.umich.edu/research/requesting-items-new2020/">Requesting Items</a>.'
how_to_order: 'Please visit <a href="https://bentley.umich.edu/research/duplication/">Duplication of Materials</a>.'
request_types:
aeon_hidden_form_request:
request_url: https://aeon-dev.bentley.umich.edu/ead_request
Expand Down Expand Up @@ -47,6 +52,11 @@ scrc:
phone: ''
contact_info: '[email protected]'
thumbnail_url: 'https://upload.wikimedia.org/wikipedia/commons/9/96/University_of_Michigan_library_stacks.JPG'
repo_about:
using_materials: 'Finding aids describe collections of primary sources and other unique, original, or rare materials. Collections are non-circulating and must be used in the Special Collections Research Center reading room. Requests for collection material must be made at least 7 days in advance of a planned visit.'
visitor_info: 'For more information <a href="https://www.lib.umich.edu/locations-and-hours/special-collections-research-center">Special Collections Research Center -- Visit</a>.'
how_to_request: 'Please visit <a href="https://www.lib.umich.edu/locations-and-hours/special-collections-research-center/access-our-materials">Special Collections Research Center -- Access Our Materials</a>.'
how_to_order: 'Please visit <a href="https://www.lib.umich.edu/locations-and-hours/special-collections-research-center/access-our-materials">Special Collections Research Center -- Access Our Materials</a>.'
request_types:
aeon_web_ead:
request_url: 'https://aeon.lib.umich.edu/logon'
Expand All @@ -69,6 +79,11 @@ clements:
phone: ''
contact_info: '[email protected]'
thumbnail_url: 'https://upload.wikimedia.org/wikipedia/commons/1/1d/University_of_Michigan_August_2013_179_%28William_L._Clements_Library%29.jpg'
repo_about:
using_materials: 'Finding aids describe collections of primary sources and other unique, original, or rare materials. Collections are non-circulating and must be used in the Clements Library reading room. Some finding aids contain links to digitized versions of parts or all of a collection, but in most cases viewing a collection in its entirety will require visiting the library.'
visitor_info: 'See <a href="https://clements.umich.edu/research/plan-your-visit/">Clements Library Plan Your Visit</a>.'
how_to_request: 'See <a href="https://clements.umich.edu/research/request-materials/">Clements Library Request Materials</a>.'
how_to_order: 'See <a href="https://clements.umich.edu/research/duplication-and-use/">Clements Library Duplication and Use</a>.'
request_types:
aeon_web_ead:
request_url: 'https://aeon.clements.umich.edu/logon'
Expand All @@ -91,6 +106,11 @@ clarke:
phone: ''
contact_info: '[email protected]'
thumbnail_url: 'https://www.cmich.edu/images/default-source/academic-affairs-division/cmu-libraries/about/support-the-libraries/20210723_support_universityseal_0086fdf1a7f-50e7-4d64-a7ca-f7979508b7a2.jpg'
repo_about:
using_materials: 'Finding aids describe collections of primary sources and other unique, original, or rare materials. Collections are non-circulating and must be used in the Clarke Library reading room. Some finding aids contain links to digitized versions of parts or all of a collection, but in most cases viewing a collection in its entirety will require visiting the library.'
visitor_info: 'Please visit <a href="https://www.cmich.edu/research/clarke-historical-library/services/reference-research-help">Clarke Research and Reference Help</a>.'
how_to_request: '<a href="[email protected]">Contact the Clarke</a> for assistance with collections.'
how_to_order: 'Please visit <a href="https://www.cmich.edu/research/clarke-historical-library/about/policies#a3">Clarke Digital Reproduction Policies and Fees</a>.'
vrc:
name: 'University of Michigan. History of Art. Visual Resources Collection'
description: "The VRC maintains nearly two million images of art. The collection's roots are more than 90 years old and developed as a teaching collection to support University of Michigan faculty and students. Through these online finding aids, we hope to help you connect with our vast resources of images of art, architecture, and artifacts."
Expand All @@ -105,6 +125,9 @@ vrc:
phone: ''
contact_info: '[email protected]'
thumbnail_url: 'https://mapproxy.studentlife.umich.edu/images/tappan-hall/AXP2S1698.jpg'
repo_about:
using_materials: 'Finding aids describe collections of primary sources and other unique, original, or rare materials. Access to the original physical items, when available, requires requesting items for use in the reading room associated with a given collection. Items may not be requested for offsite use.'
visitor_info: 'See <a href="https://lsa.umich.edu/histartvrc/faculty-students.html">https://lsa.umich.edu/histartvrc/faculty-students.html</a>'
archivemi:
name: 'Archives of Michigan'
description: 'The Archives of Michigan is responsible for preserving the records of Michigan government and other public institutions. The collections also include documents, maps, photographs and film from private individuals and organizations.'
Expand All @@ -119,6 +142,10 @@ archivemi:
phone: ''
contact_info: '[email protected]'
thumbnail_url: 'https://www.michigan.gov/mhc/-/media/Project/Websites/mhc/images/archives/archives_womanresearcher.jpg'
repo_about:
using_materials: 'Finding aids describe collections of primary sources and other unique, original, or rare materials. Access to the original physical items, when available, requires requesting items for use in the reading room associated with a given collection. Items may not be requested for offsite use.'
visitor_info: 'See <a href="https://www.michigan.gov/mhc/archives/plan-your-archives-visit">https://www.michigan.gov/mhc/archives/plan-your-archives-visit</a> for information on policies and parking'
how_to_order: 'See <a href="https://www.michigan.gov/mhc/archives/plan-your-archives-visit#Copies">https://www.michigan.gov/mhc/archives/plan-your-archives-visit#Copies</a> for policies and pricing'
mlibraryead:
name: 'MLibrary Finding Aids'
description: "MLibrary's Finding Aids site provides access to finding aids or descriptive inventories for archival records and manuscript collections not held in the Special Collections Research Center."
Expand All @@ -133,3 +160,7 @@ mlibraryead:
phone: ''
contact_info: '[email protected]'
thumbnail_url: 'https://www.lib.umich.edu/static/f7ffa2d7bc8b7d2c2e56eaf08f237c8b/53249/AerialsNov08(186)Stock-a.webp'
repo_about:
using_materials: 'Finding aids describe collections of primary sources and other unique, original, or rare materials. Access to the original physical items, when available, requires requesting items for use in the reading room associated with a given collection. Items may not be requested for offsite use.'
visitor_info: '<p>The Evangeline Marie Lehman Papers and Voice of America African Music Collection recordings are held at the Music Library. Please contact them for access: <a href="https://www.lib.umich.edu/locations-and-hours/music-library">https://www.lib.umich.edu/locations-and-hours/music-library</a></p>
<p>The Jon Cohen AIDS Research Collection is held in the Special Collections Research Center. Please contact them for access: <a href="https://www.lib.umich.edu/locations-and-hours/special-collections-research-center">Special Collections Research Center -- Visit</a></p>'
4 changes: 2 additions & 2 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def collection_slug_constraint
end
end

resources :repositories, only: %i[index show], controller: 'arclight/repositories'

resources :repositories, only: %i[index show], controller: 'repositories'
get 'repositories/:id/about', as: 'repository_about', to: 'repositories#about'

resources :ua_record_groups, only: [:index], as: 'ua_record_groups', path: '/collections/ua-record-groups', controller: 'ua_record_groups'

Expand Down
24 changes: 24 additions & 0 deletions lib/dul_arclight/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,30 @@ def request_postfix
request_id.fetch('postfix')
end

def repo_about_present?
return false unless respond_to? :repo_about
return false if repo_about.nil? || repo_about.empty?
true
end

def using_materials
repo_about.fetch('using_materials')
end

def visitor_info
return false unless repo_about.key?('visitor_info')
repo_about.fetch('visitor_info')
end

def how_to_request
return false unless repo_about.key?('how_to_request')
repo_about.fetch('how_to_request')
end

def how_to_order
return false unless repo_about.key?('how_to_order')
repo_about.fetch('how_to_order')
end
# Load repository information from a YAML file
#
# @param [String] `filename`
Expand Down

0 comments on commit cc87d63

Please sign in to comment.