Issue 15585

Images on species and occ pages without title show ugly "No title"

15585
Reporter: omeyn
Assignee: mdoering
Type: Bug
Summary: Images on species and occ pages without title show ugly "No title"
Priority: Critical
Resolution: Fixed
Status: Resolved
Created: 2014-05-06 10:54:21.032
Updated: 2014-05-21 11:05:01.712
Resolved: 2014-05-21 11:05:01.688
        
Description: Best to show the (verbatim) scientificName for images without a title.
The common js library building the image gallery is doing ajax calls and doesn't have access to the rest of the occurrence so fixing this is non-trivial.

e.g. http://www.gbif-dev.org/species/1650518]]>
    


Author: mdoering@gbif.org
Created: 2014-05-21 10:24:13.863
Updated: 2014-05-21 10:24:13.863
        
The no title gets set as part of the imageGallery in widgets.js here:
https://github.com/gbif/portal-web/blob/master/src/main/webapp/js/widgets.js#L1592

It tries to read an html title attribute and if not existing uses a default static value.
To make that value be the scientific name we should set the title attribute which is read into slideData at the initialization of the gallery here:
https://github.com/gbif/portal-web/blob/master/src/main/webapp/js/widgets.js#L1691

My initial idea was to add some post update hook for the occurrence slideshow which is currently doing nothing:
https://github.com/gbif/portal-web/blob/master/src/main/webapp/js/widgets.js#L1781

If that hook would be a function that gets the verbatim scientific name of the occurrence record and sets the title property in the json it should be done
    


Author: mdoering@gbif.org
Comment: https://github.com/gbif/portal-web/commit/91c503820499f53658545405edde3298fa7a3964
Created: 2014-05-21 11:05:01.709
Updated: 2014-05-21 11:05:01.709