Skip to content

Commit d83c242

Browse files
committed
MIR-1336 Display realname of creator in mir-admin-box-static
1 parent 622b475 commit d83c242

File tree

2 files changed

+61
-8
lines changed

2 files changed

+61
-8
lines changed

mir-module/src/main/resources/xsl/metadata/static/mir-admindata-box-static.xsl

Lines changed: 56 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
exclude-result-prefixes="i18n mods xlink mcrxsl">
77
<!-- copied from http://www.loc.gov/standards/mods/v3/MODS3-4_HTML_XSLT1-0.xsl -->
88
<xsl:include href="layout-utils.xsl" />
9-
9+
<xsl:param name="WebApplicationBaseURL"/>
1010

1111
<xsl:template match="/">
1212
<div id="system_box" class="detailbox">
@@ -30,10 +30,13 @@
3030
<xsl:with-param select="mycoreobject/service/servdates/servdate[@type='createdate']" name="nodes"/>
3131
<xsl:with-param select="i18n:translate('metaData.createdAt')" name="label"/>
3232
</xsl:call-template>
33-
<xsl:call-template name="printMetaDate">
34-
<xsl:with-param select="mycoreobject/service/servflags/servflag[@type='createdby']" name="nodes"/>
35-
<xsl:with-param select="i18n:translate('metaData.createdby')" name="label"/>
33+
34+
<xsl:call-template name="print-user-info">
35+
<xsl:with-param name="user" select="document(concat('notnull:user:', mycoreobject/service/servflags/servflag[@type='createdby']))"/>
36+
<xsl:with-param name="label" select="i18n:translate('metaData.createdby')"/>
37+
<xsl:with-param name="link-to-profile" select="true()"/>
3638
</xsl:call-template>
39+
3740
<xsl:for-each select="mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods/mods:note">
3841
<xsl:variable name="noteType">
3942
<xsl:choose>
@@ -65,10 +68,12 @@
6568
<xsl:with-param select="mycoreobject/service/servdates/servdate[@type='modifydate']" name="nodes"/>
6669
<xsl:with-param select="i18n:translate('metaData.lastChanged')" name="label"/>
6770
</xsl:call-template>
68-
<xsl:call-template name="printMetaDate">
69-
<xsl:with-param select="mycoreobject/service/servflags/servflag[@type='modifiedby']" name="nodes"/>
70-
<xsl:with-param select="i18n:translate('metaData.modifiedBy')" name="label"/>
71+
72+
<xsl:call-template name="print-user-info">
73+
<xsl:with-param name="user" select="document(concat('notnull:user:', mycoreobject/service/servflags/servflag[@type='modifiedby']))"/>
74+
<xsl:with-param name="label" select="i18n:translate('metaData.modifiedBy')"/>
7175
</xsl:call-template>
76+
7277
<!--*** MyCoRe-ID and intern ID *************************** -->
7378
<tr>
7479
<td class="metaname">
@@ -129,4 +134,47 @@
129134
</div>
130135
</div>
131136
</xsl:template>
132-
</xsl:stylesheet>
137+
138+
<xsl:template name="print-user-info">
139+
<xsl:param name="user"/>
140+
<xsl:param name="label"/>
141+
<xsl:param name="link-to-profile" select="false()"/>
142+
143+
<xsl:variable name="display-name">
144+
<xsl:choose>
145+
<xsl:when test="$user/user/realName">
146+
<xsl:value-of select="$user/user/realName"/>
147+
</xsl:when>
148+
<xsl:otherwise>
149+
<xsl:value-of select="$user/user/@name"/>
150+
</xsl:otherwise>
151+
</xsl:choose>
152+
</xsl:variable>
153+
154+
<tr>
155+
<td class="metaname">
156+
<xsl:value-of select="concat($label, ':')"/>
157+
</td>
158+
159+
<td class="metavalue">
160+
<xsl:if test="$user/user/realName">
161+
<xsl:attribute name="title">
162+
<xsl:value-of select="concat($user/user/@name, '@', $user/user/@realm)"/>
163+
</xsl:attribute>
164+
</xsl:if>
165+
166+
<xsl:choose>
167+
<xsl:when test="$link-to-profile = true()">
168+
<a href="{$WebApplicationBaseURL}/servlets/MCRUserServlet?action=show&amp;id={$user/user/@name}">
169+
<xsl:value-of select="$display-name"/>
170+
</a>
171+
</xsl:when>
172+
<xsl:otherwise>
173+
<xsl:value-of select="$display-name"/>
174+
</xsl:otherwise>
175+
</xsl:choose>
176+
</td>
177+
</tr>
178+
</xsl:template>
179+
180+
</xsl:stylesheet>

mir-module/src/main/resources/xslt/metadata/mods-metadata-page.xsl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@
228228
</xsl:template>
229229
<xsl:template match="td[@class='metavalue']" mode="newMetadata" priority="2">
230230
<dd>
231+
<xsl:if test="@title">
232+
<xsl:attribute name="title">
233+
<xsl:value-of select="@title"/>
234+
</xsl:attribute>
235+
</xsl:if>
231236
<xsl:copy-of select="node()|*"/>
232237
</dd>
233238
</xsl:template>

0 commit comments

Comments
 (0)