Uniting pomen/podpomen logic within single template

This commit is contained in:
Ozbolt Menegatti 2018-10-31 12:43:42 +01:00
parent 3fb34db562
commit bf91f9dbd9

View File

@ -67,6 +67,20 @@
</style>
</xsl:variable>
<!-- ********************************
Pomen/podpomen logic
******************************** -->
<xsl:template name="pomen_podpomen_logic">
<xsl:apply-templates select="indikator | oznaka | pomenska_shema"/>
<div style="padding: 0.5em 0;">
<a class="morelessbutton" href="javascript:void(null)">▼ more</a>
</div>
<div class="hideable" style="display: none">
<xsl:apply-templates select="skladenjske_skupine"/>
</div>
</xsl:template>
<!-- ********************************
Here are all of xslt rules
Please dont polute xslt with it
@ -125,20 +139,8 @@
<xsl:number />
</div>
<div style="margin-left: 2em;">
<xsl:apply-templates select="podpomen | indikator | oznaka | pomenska_shema"/>
<xsl:choose>
<xsl:when test="count(../pomen)&gt;1 and skladenjske_skupine//text()">
<div style="padding: 0.5em 0;">
<a class="morelessbutton" href="javascript:void(null)">▼ more</a>
</div>
<div class="hideable" style="display: none">
<xsl:apply-templates select="skladenjske_skupine"/>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="skladenjske_skupine"/>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="pomen_podpomen_logic"/>
<xsl:apply-templates select="podpomen"/>
</div>
<div style="clear: left;"></div>
</div>
@ -151,7 +153,7 @@
<div style="margin-bottom: 0.5em;">
<xsl:value-of select="$pomenNum"/>.<xsl:number/>
<xsl:apply-templates/>
<xsl:call-template name="pomen_podpomen_logic"/>
</div>
</xsl:template>