Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
only show footnote section if chapter contains footnotes
  • Loading branch information
EsGeh authored and EsGeh committed Mar 25, 2019
1 parent dabe858 commit a1fa9bb
Showing 1 changed file with 31 additions and 30 deletions.
61 changes: 31 additions & 30 deletions tei2html.xsl
Expand Up @@ -688,42 +688,43 @@
</xsl:for-each>
</xsl:template>


<xsl:template name="footnotes">
<xsl:variable name="chapter" select="."/>
<div class="accordion__item active">
<a class="accordion__title" href="#">
<h2> Footnotes </h2>
</a>
<div class="accordion__content">
<div class="publication-detail__footnotes">
<ol>
<xsl:for-each select="$chapter//tei:*[name() = $paragraph_elements]">
<xsl:variable name="paragraph" select="."/>
<xsl:variable name="paragraph_nr">
<xsl:number
count="tei:*[name() = $paragraph_elements]"
from="tei:div[@type = 'chapter']"
level="any"
/>
</xsl:variable>
<xsl:if test="$chapter//tei:note[@place = 'bottom']">
<div class="accordion__item active">
<a class="accordion__title" href="#">
<h2> Footnotes </h2>
</a>
<div class="accordion__content">
<div class="publication-detail__footnotes">
<ol>
<xsl:for-each select="$chapter//tei:*[name() = $paragraph_elements]">
<xsl:variable name="paragraph" select="."/>
<xsl:variable name="paragraph_nr">
<xsl:number
count="tei:*[name() = $paragraph_elements]"
from="tei:div[@type = 'chapter']"
level="any"
/>
</xsl:variable>

<xsl:for-each select="$paragraph//tei:note[@place = 'bottom']">
<li id="fn{@n}">
<xsl:for-each select="tei:p">
<p><xsl:apply-templates mode="html"/></p>
</xsl:for-each>
<a href="#p{$paragraph_nr}">to paragraph</a>
</li>
<xsl:for-each select="$paragraph//tei:note[@place = 'bottom']">
<li id="fn{@n}">
<xsl:for-each select="tei:p">
<p><xsl:apply-templates mode="html"/></p>
</xsl:for-each>
<a href="#p{$paragraph_nr}">to paragraph</a>
</li>
</xsl:for-each>
</xsl:for-each>
</xsl:for-each>
</ol>
</ol>
</div>
<!-- the link to close the accordeon: -->
<a class="accordion__pageup" href="#"></a> <a class="accordion__popap" href="#"></a>
<div class="accordion__popap-eye"></div>
</div>
<!-- the link to close the accordeon: -->
<a class="accordion__pageup" href="#"></a> <a class="accordion__popap" href="#"></a>
<div class="accordion__popap-eye"></div>
</div>
</div>
</xsl:if>
</xsl:template>

<xsl:template name="website_meta_tags">
Expand Down

0 comments on commit a1fa9bb

Please sign in to comment.