denshoproject / ddr-public

Web UI for publishing DDR collections.
Other
1 stars 1 forks source link

Show default icon if no signature img #179

Open gjost opened 3 years ago

gjost commented 3 years ago

In the UI we occasionally have objects with no valid signature i.e. ddr-densho-142-213. We don't want the app to crash[1] but we also don't want to show nothing at all. Ideally we'd show some sort of content-appropriate icon. There are lots of different approaches. [1] See https://github.com/denshoproject/ddr-public/issues/178

OPTION 0. (vetoed) Modify DDR.signature chooser code to ignore transcript File objects when choosing signatures.

OPTION 1. Modify ddr-cmdln's ddrindex publish DDR.models.common.to_esobject to . The code would have to consider the object's format, genre, and/or mimetype. We could put something in object.signature_id like icon-transcript or icon-audio. Or we could add a new field to the Elasticsearch record. Requires modifications to front-end ddr-public code. We would have to reindex everything.

OPTION 2. Mod ddr-public format_object_detail function (used to enrich elasticsearch documents so they can be inserted into templates). Look at the object's format, genre, and/or mimetype and insert an icon link if the object's signature_id field is blank.

OPTION 3. (vetoed) Mod ddr-public to specify a default image if sorl-thumbnail cannot make a thumbnail. Choose the icon by looking at the object's format, genre, and/or mimetype. This ensures that some sort of image is always displayed if the image is missing from dori. Does not require a reindex.

OPTION 4. Mod ddr-public format_object_detail function to always look at the object's format, genre, and/or mimetype and choose an icon. Display icon with a low CSS z-index and the object's signature image with a higher z-index. The icon will be displayed if there is no signature image, or if the signature image is missing from dori. Does not require a reindex.

gjost commented 3 years ago

@GeoffFroh the more I think about your comment that it's desirable that we not add more logic to the front-end ddr-public, the more I agree.

Taking a step back here, what is the root problem we're trying to solve?