From ef5e8d161d92b7158a001b8d2060c12820ace88e Mon Sep 17 00:00:00 2001 From: Bruno Nocera Zanette <brunonzanette@gmail.com> Date: Mon, 2 Jun 2014 17:13:05 -0300 Subject: [PATCH] Add default-thumbnail to results's list items Add default-thumbnail to results's list items that don't have custom-thumbnails. --- .../Participatorio-mobile.xsl | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/dspace/modules/xmlui/src/main/webapp/themes/Participatorio-mobile/Participatorio-mobile.xsl b/dspace/modules/xmlui/src/main/webapp/themes/Participatorio-mobile/Participatorio-mobile.xsl index 8a5c866..10b6df5 100644 --- a/dspace/modules/xmlui/src/main/webapp/themes/Participatorio-mobile/Participatorio-mobile.xsl +++ b/dspace/modules/xmlui/src/main/webapp/themes/Participatorio-mobile/Participatorio-mobile.xsl @@ -464,6 +464,28 @@ </a> </xsl:template> + <!-- Generate the thunbnail, if present, from the file section --> + <xsl:template match="mets:fileSec" mode="artifact-preview"> + <div class="artifact-preview"> + <a href="{ancestor::mets:METS/@OBJID}"> + <img alt="Thumbnail"> + <xsl:choose> + <xsl:when test="mets:fileGrp[@USE='THUMBNAIL']"> + <xsl:attribute name="src"> + <xsl:value-of select="mets:fileGrp[@USE='THUMBNAIL']/mets:file/mets:FLocat[@LOCTYPE='URL']/@xlink:href" /> + </xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="src"> + <xsl:text>/xmlui/themes/Participatorio-mobile/lib/images/default-thumbnail.png</xsl:text> + </xsl:attribute> + </xsl:otherwise> + </xsl:choose> + </img> + </a> + </div> + </xsl:template> + <!-- A community rendered in the summaryList pattern ... on the front page. --> <xsl:template name="communitySummaryList-DIM"> <xsl:variable name="data" select="./mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim"/> -- GitLab