File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -182,14 +182,18 @@ class PrintingResource < ApplicationResource # rubocop:disable Metrics/ClassLeng
182
182
def images ( id , face_index = nil )
183
183
url_prefix = Rails . configuration . x . printing_images . nrdb_classic_prefix
184
184
face_suffix = "-#{ face_index } " unless face_index . nil?
185
+ has_narrative_image = :narrative_text . presence && !face_index . nil?
186
+ image_sizes = {
187
+ 'tiny' => "#{ url_prefix } /tiny/#{ id } #{ face_suffix } .jpg" ,
188
+ 'small' => "#{ url_prefix } /small/#{ id } #{ face_suffix } .jpg" ,
189
+ 'medium' => "#{ url_prefix } /medium/#{ id } #{ face_suffix } .jpg" ,
190
+ 'large' => "#{ url_prefix } /large/#{ id } #{ face_suffix } .jpg"
191
+ }
192
+
193
+ image_sizes . narrative = "#{ url_prefix } /large/#{ id } #{ face_suffix } -narrative.jpg" if has_narrative_image
194
+
185
195
{
186
- 'nrdb_classic' => {
187
- 'tiny' => "#{ url_prefix } /tiny/#{ id } #{ face_suffix } .jpg" ,
188
- 'small' => "#{ url_prefix } /small/#{ id } #{ face_suffix } .jpg" ,
189
- 'medium' => "#{ url_prefix } /medium/#{ id } #{ face_suffix } .jpg" ,
190
- 'large' => "#{ url_prefix } /large/#{ id } #{ face_suffix } .jpg" ,
191
- 'narrative' => "#{ url_prefix } /large/#{ id } #{ face_suffix } -narrative.jpg"
192
- }
196
+ 'nrdb_classic' => image_sizes
193
197
}
194
198
end
195
199
end
You can’t perform that action at this time.
0 commit comments