-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'iiif_manifest_title' into adventist_dev
- Loading branch information
Showing
1 changed file
with
17 additions
and
0 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
lib/iiif_manifest/manifest_builder/canvas_builder_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
# OVERRIDE IIIFManifest v0.5.0 to use the parent's title as the label instead of the filename | ||
|
||
module IIIFManifest | ||
module ManifestBuilderDecorator | ||
module CanvasBuilderDecorator | ||
def apply_record_properties | ||
canvas['@id'] = path | ||
canvas.label = record['parent_title_tesim']&.first || record.to_s | ||
end | ||
end | ||
end | ||
end | ||
|
||
IIIFManifest::ManifestBuilder.prepend(IIIFManifest::ManifestBuilderDecorator) | ||
IIIFManifest::ManifestBuilder::CanvasBuilder.prepend(IIIFManifest::ManifestBuilder::CanvasBuilderDecorator) |