Skip to content

Commit

Permalink
Don't display header menu and footer in single metadata PDF export (g…
Browse files Browse the repository at this point in the history
…eonetwork#7532)

* Don't display header menu and footer in single metadata PDF export. Related to geonetwork#7521

* Don't display header menu and footer in single metadata PDF export / code refactor. Related to geonetwork#7521
  • Loading branch information
josegar74 authored Dec 13, 2023
1 parent 39550ef commit bc20706
Showing 1 changed file with 72 additions and 67 deletions.
139 changes: 72 additions & 67 deletions web/src/main/webapp/xslt/skin/default/skin.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

<xsl:param name="output" as="xs:string" select="'not-pdf'"/>


<xsl:function name="geonet:updateUrlPlaceholder" as="xs:string">
<xsl:param name="url" as="xs:string"/>
<xsl:param name="node" as="xs:string"/>
Expand Down Expand Up @@ -97,61 +96,65 @@
</xsl:if>
</xsl:if>

<xsl:variable name="isSearchEnabled"
select="if (util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.search.enabled') = 'false')
<xsl:if test="$output != 'pdf'">
<xsl:variable name="isSearchEnabled"
select="if (util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.search.enabled') = 'false')
then false()
else true()"/>
<xsl:if test="$isSearchEnabled">
<xsl:variable name="searchUrl"
select="if(util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.search.appUrl'))
<xsl:if test="$isSearchEnabled">
<xsl:variable name="searchUrl"
select="if(util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.search.appUrl'))
then geonet:updateUrlPlaceholder(util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.search.appUrl'), /root/gui/nodeId, $lang)
else concat(/root/gui/nodeUrl, $lang, '/catalog.search#/search')"/>
<li>
<a title="{$t/search}" href="{$searchUrl}" onclick="location.href=('{$searchUrl}');return false;">
<i class="fa fa-fw fa-search hidden-sm">&#160;</i>
<span><xsl:value-of select="$t/search"/></span>
</a>
</li>
</xsl:if>
<li>
<a title="{$t/search}" href="{$searchUrl}" onclick="location.href=('{$searchUrl}');return false;">
<i class="fa fa-fw fa-search hidden-sm">&#160;</i>
<span><xsl:value-of select="$t/search"/></span>
</a>
</li>
</xsl:if>

<xsl:variable name="isMapEnabled"
select="if (util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.map.enabled') = 'false')
<xsl:variable name="isMapEnabled"
select="if (util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.map.enabled') = 'false')
then false()
else true()"/>
<xsl:if test="$isMapEnabled">
<xsl:variable name="mapUrl"
select="if(util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.map.appUrl'))
<xsl:if test="$isMapEnabled">
<xsl:variable name="mapUrl"
select="if(util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.map.appUrl'))
then geonet:updateUrlPlaceholder(util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.map.appUrl'), /root/gui/nodeId, $lang)
else concat(/root/gui/nodeUrl, $lang , '/catalog.search#/map')"/>
<li id="map-menu" class="hidden-nojs">
<a title="{$t/map}"
href="{$mapUrl}">
<i class="fa fa-fw fa-globe hidden-sm">&#160;</i>
<span><xsl:value-of select="$t/map"/></span></a>
</li>
<li id="map-menu" class="hidden-nojs">
<a title="{$t/map}"
href="{$mapUrl}">
<i class="fa fa-fw fa-globe hidden-sm">&#160;</i>
<span><xsl:value-of select="$t/map"/></span></a>
</li>
</xsl:if>
</xsl:if>
</ul>

<xsl:variable name="isAuthenticated"
select="util:isAuthenticated()"/>
<xsl:variable name="isSigninEnabled"
select="if (util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.authentication.enabled') = 'false')
<xsl:if test="$output != 'pdf'">
<xsl:variable name="isAuthenticated"
select="util:isAuthenticated()"/>
<xsl:variable name="isSigninEnabled"
select="if (util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.authentication.enabled') = 'false')
then false()
else true()"/>
<xsl:if test="$isSigninEnabled and not($isAuthenticated) and not($isDisableLoginForm)">
<xsl:variable name="signinUrl"
select="if(util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.signin.appUrl'))
<xsl:if test="$isSigninEnabled and not($isAuthenticated) and not($isDisableLoginForm)">
<xsl:variable name="signinUrl"
select="if(util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.signin.appUrl'))
then geonet:updateUrlPlaceholder(util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.signin.appUrl'), /root/gui/nodeId, $lang)
else concat(/root/gui/nodeUrl, $lang , '/catalog.signin')"/>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="{$signinUrl}"
title="{$t/signIn}">
<i class="fa fa-sign-in fa-fw">&#160;</i>
<xsl:value-of select="$t/signIn"/>
</a>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>
<a href="{$signinUrl}"
title="{$t/signIn}">
<i class="fa fa-sign-in fa-fw">&#160;</i>
<xsl:value-of select="$t/signIn"/>
</a>
</li>
</ul>
</xsl:if>
</xsl:if>
</div>
</div>
Expand Down Expand Up @@ -194,33 +197,35 @@
</xsl:template>

<xsl:template name="footer">
<xsl:variable name="isFooterEnabled"
select="if (util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.footer.enabled') = 'false')
then false()
else true()"/>
<xsl:if test="$isFooterEnabled">
<div class="navbar navbar-default gn-bottom-bar" role="navigation">
<ul class="nav navbar-nav">
<li class="gn-footer-text">

</li>
<li>
<a href="http://geonetwork-opensource.org/">
<i class="fa fa-fw">&#160;</i>
<span><xsl:value-of select="$t/about"/></span>
</a>
</li>
<li class="hidden-sm">
<a href="https://github.com/geonetwork/core-geonetwork">
<i class="fa fa-github">&#160;</i>
<span><xsl:value-of select="$t/github"/></span>
</a>
</li>
<li>
<a href="{/root/gui/url}/doc/api" title="{$t/learnTheApi}"><xsl:value-of select="$t/API"/>&#160;</a>
</li>
</ul>
</div>
<xsl:if test="$output != 'pdf'">
<xsl:variable name="isFooterEnabled"
select="if (util:getUiConfigurationJsonProperty(/root/request/ui, 'mods.footer.enabled') = 'false')
then false()
else true()"/>
<xsl:if test="$isFooterEnabled">
<div class="navbar navbar-default gn-bottom-bar" role="navigation">
<ul class="nav navbar-nav">
<li class="gn-footer-text">

</li>
<li>
<a href="http://geonetwork-opensource.org/">
<i class="fa fa-fw">&#160;</i>
<span><xsl:value-of select="$t/about"/></span>
</a>
</li>
<li class="hidden-sm">
<a href="https://github.com/geonetwork/core-geonetwork">
<i class="fa fa-github">&#160;</i>
<span><xsl:value-of select="$t/github"/></span>
</a>
</li>
<li>
<a href="{/root/gui/url}/doc/api" title="{$t/learnTheApi}"><xsl:value-of select="$t/API"/>&#160;</a>
</li>
</ul>
</div>
</xsl:if>
</xsl:if>
</xsl:template>

Expand Down

0 comments on commit bc20706

Please sign in to comment.