|
51 | 51 | </xsl:choose> |
52 | 52 | </xsl:variable> |
53 | 53 |
|
54 | | - <xsl:variable name="affiliation" select="mods:affiliation[not(@*)]" /> |
55 | | - <xsl:variable name="affiliation-ror" select="mods:affiliation[contains(@authorityURI, '//ror.org')]" /> |
| 54 | + <xsl:variable name="affiliations" select="mods:affiliation" /> |
56 | 55 | <xsl:variable name="personNodeId" select="generate-id(.)"/> |
57 | 56 | <xsl:variable name="personName"><xsl:apply-templates select="." mode="nameString"/></xsl:variable> |
58 | | - <xsl:if test="count($nameIdentifiers) > 0 or string-length($affiliation) > 0"> |
| 57 | + <xsl:if test="count($nameIdentifiers) > 0 or count($affiliations) > 0"> |
59 | 58 | <!-- This content will be inserted as popover--> |
60 | 59 | <div id="{$personNodeId}-content" class="d-none"> |
61 | 60 | <dl> |
|
71 | 70 | </dd> |
72 | 71 | </xsl:for-each> |
73 | 72 | </xsl:if> |
74 | | - <xsl:if test="count($affiliation) > 0 or $affiliation-ror"> |
75 | | - <dt> |
76 | | - <xsl:value-of select="mcri18n:translate('mir.affiliation')"/> |
77 | | - </dt> |
78 | | - <dd> |
79 | | - <xsl:for-each select="$affiliation"> |
80 | | - <div class="mir-affiliation-plain" lang="{$CurrentLang}"> |
81 | | - <xsl:value-of select="text()"/> |
82 | | - </div> |
83 | | - </xsl:for-each> |
84 | | - |
85 | | - <xsl:for-each select="$affiliation-ror[@valueURI]"> |
86 | | - <xsl:sort select="@valueURI"/> |
87 | | - <div class="mir-affiliation-ror"> |
88 | | - <a href="https://ror.org/" alt="ROR logo"> |
89 | | - <img src="{$WebApplicationBaseURL}images/ror/ror-icon-rgb-transparent.svg" |
90 | | - class="pe-1 mir-ror-logo"/> |
91 | | - </a> |
92 | | - <a class="mir-ror-link" href="{@valueURI}"> |
93 | | - <xsl:value-of select="@valueURI"/> |
94 | | - </a> |
95 | | - </div> |
96 | | - </xsl:for-each> |
97 | | - </dd> |
98 | | - </xsl:if> |
| 73 | + <xsl:apply-templates select="$affiliations"> |
| 74 | + <xsl:sort select="boolean(@authority)" data-type="number" order="ascending"/> |
| 75 | + <xsl:sort select="@valueURI" data-type="text" order="ascending"/> |
| 76 | + </xsl:apply-templates> |
99 | 77 | </dl> |
100 | 78 | </div> |
101 | 79 | </xsl:if> |
102 | 80 | <a href="{concat($ServletsBaseURL,'solr/mods_nameIdentifier?q=',encoder:encode($query),'&owner=',encoder:encode(concat('createdby:',$owner)))}"><xsl:value-of select="$personName" /></a> |
103 | | - <xsl:if test="count($nameIdentifiers) > 0 or string-length($affiliation) > 0"> |
| 81 | + <xsl:if test="count($nameIdentifiers) > 0 or string-length($affiliations) > 0"> |
104 | 82 | <!-- class personPopover triggers the javascript popover code --> |
105 | 83 | <a id="{$personNodeId}" class="personPopover" title="{mcri18n:translate('mir.details.personpopover.title')}"> |
106 | 84 | <span class="fa fa-info-circle"/> |
107 | 85 | </a> |
108 | 86 | </xsl:if> |
109 | 87 | </xsl:template> |
| 88 | + |
| 89 | + <xsl:template match="mods:affiliation[not(@*)]"> |
| 90 | + <div class="mir-affiliation-plain"> |
| 91 | + <xsl:value-of select="text()"/> |
| 92 | + </div> |
| 93 | + </xsl:template> |
| 94 | + |
| 95 | + <xsl:template match="mods:affiliation[@authority]"> |
| 96 | + <xsl:param name="logo-uri" select="''" /> |
| 97 | + <xsl:param name="type" select="@authority" /> |
| 98 | + |
| 99 | + <xsl:variable name="logo-uri-val"> |
| 100 | + <xsl:choose> |
| 101 | + <xsl:when test="$logo-uri != ''"> |
| 102 | + <xsl:value-of select="$logo-uri"/> |
| 103 | + </xsl:when> |
| 104 | + <xsl:otherwise> |
| 105 | + <xsl:call-template name="resolve-affiliation-logo-uri"> |
| 106 | + <xsl:with-param name="authority" select="@authority"/> |
| 107 | + </xsl:call-template> |
| 108 | + </xsl:otherwise> |
| 109 | + </xsl:choose> |
| 110 | + </xsl:variable> |
| 111 | + <xsl:variable name="type-val" select=" |
| 112 | + translate($type,'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz') |
| 113 | + " /> |
| 114 | + |
| 115 | + <div class="mir-affiliation-{$type-val}"> |
| 116 | + <xsl:if test="$logo-uri-val != ''"> |
| 117 | + <a href="{@authorityURI}"> |
| 118 | + <img src="{$logo-uri-val}" class="pe-1 mir-{$type-val}-logo" alt="{@authority} logo" /> |
| 119 | + </a> |
| 120 | + </xsl:if> |
| 121 | + <a class="mir-{$type-val}-link" href="{@valueURI}"> |
| 122 | + <xsl:value-of select="@valueURI"/> |
| 123 | + </a> |
| 124 | + </div> |
| 125 | + </xsl:template> |
| 126 | + |
| 127 | + <xsl:template name="resolve-affiliation-logo-uri"> |
| 128 | + <xsl:param name="authority" /> |
| 129 | + <xsl:choose> |
| 130 | + <xsl:when test="$authority = 'ROR'"> |
| 131 | + <xsl:value-of select="concat($WebApplicationBaseURL, 'images/ror/ror-icon-rgb-transparent.svg')" /> |
| 132 | + </xsl:when> |
| 133 | + <xsl:otherwise> |
| 134 | + <xsl:value-of select="''" /> |
| 135 | + </xsl:otherwise> |
| 136 | + </xsl:choose> |
| 137 | + </xsl:template> |
| 138 | + |
110 | 139 | </xsl:stylesheet> |
0 commit comments