@@ -34,27 +34,24 @@ class DocumentComponent < Blacklight::Component
34
34
35
35
# The document title with some reasonable default behavior
36
36
renders_one :title , ( lambda do |component : nil , **kwargs |
37
- component ||= view_config . title_component || Blacklight :: DocumentTitleComponent
37
+ component ||= view_config . document_title_component
38
38
39
- component . new ( counter : @counter , presenter : @presenter , as : @title_component , actions : !@show , link_to_document : !@show , document_component : self , **kwargs )
39
+ component & .new ( counter : @counter , presenter : @presenter , as : @title_component , actions : !@show , link_to_document : !@show , document_component : self , **kwargs )
40
40
end )
41
41
42
42
renders_one :embed , ( lambda do |static_content = nil , component : nil , **kwargs |
43
43
next static_content if static_content . present?
44
44
45
- component ||= view_config . embed_component
46
-
47
- next unless component
48
-
49
- component . new ( presenter : @presenter , document_counter : @document_counter , **kwargs )
45
+ component ||= view_config . document_embed_component
46
+ component &.new ( presenter : @presenter , document_counter : @document_counter , **kwargs )
50
47
end )
51
48
52
49
# The primary metadata section
53
50
renders_one :metadata , ( lambda do |static_content = nil , component : nil , fields : nil , **kwargs |
54
51
next static_content if static_content . present?
55
52
56
- component ||= view_config . metadata_component || Blacklight :: DocumentMetadataComponent
57
- component . new ( fields : fields || @presenter &.field_presenters || [ ] , **kwargs )
53
+ component ||= view_config . document_metadata_component
54
+ component & .new ( fields : fields || @presenter &.field_presenters || [ ] , **kwargs )
58
55
end )
59
56
60
57
# Additional metadata sections
@@ -63,9 +60,9 @@ class DocumentComponent < Blacklight::Component
63
60
renders_one :thumbnail , ( lambda do |image_options_or_static_content = { } , component : nil , **kwargs |
64
61
next image_options_or_static_content if image_options_or_static_content . is_a? String
65
62
66
- component ||= view_config . thumbnail_component || Blacklight :: Document :: ThumbnailComponent
63
+ component ||= view_config . document_thumbnail_component
67
64
68
- component . new ( presenter : @presenter , counter : @counter , image_options : image_options_or_static_content , **kwargs )
65
+ component & .new ( presenter : @presenter , counter : @counter , image_options : image_options_or_static_content , **kwargs )
69
66
end )
70
67
71
68
# A container for partials rendered using the view config partials configuration. Its use is discouraged, but necessary until
@@ -119,7 +116,7 @@ def classes
119
116
120
117
def before_render
121
118
with_title unless title
122
- with_thumbnail unless thumbnail || show?
119
+ with_thumbnail unless thumbnail
123
120
with_metadata ( fields : presenter . field_presenters , show : @show ) unless metadata
124
121
with_embed unless embed
125
122
0 commit comments