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> </style>
</xsl:variable> </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 Here are all of xslt rules
Please dont polute xslt with it Please dont polute xslt with it
@ -125,20 +139,8 @@
<xsl:number /> <xsl:number />
</div> </div>
<div style="margin-left: 2em;"> <div style="margin-left: 2em;">
<xsl:apply-templates select="podpomen | indikator | oznaka | pomenska_shema"/> <xsl:call-template name="pomen_podpomen_logic"/>
<xsl:choose> <xsl:apply-templates select="podpomen"/>
<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>
</div> </div>
<div style="clear: left;"></div> <div style="clear: left;"></div>
</div> </div>
@ -151,7 +153,7 @@
<div style="margin-bottom: 0.5em;"> <div style="margin-bottom: 0.5em;">
<xsl:value-of select="$pomenNum"/>.<xsl:number/> <xsl:value-of select="$pomenNum"/>.<xsl:number/>
<xsl:apply-templates/> <xsl:call-template name="pomen_podpomen_logic"/>
</div> </div>
</xsl:template> </xsl:template>