Skip to content

Commit

Permalink
Merge pull request #493 from robertatakenaka/version_python27_opac_2844
Browse files Browse the repository at this point in the history
[opac | python27] Resolve apresentação de fn[@fn-type='data-availability'] e da seção que destaca a disponibilidade de dados
  • Loading branch information
gitnnolabs authored Nov 13, 2023
2 parents 9648106 + 37ee1fa commit 8b3672e
Showing 8 changed files with 3,768 additions and 39 deletions.
50 changes: 19 additions & 31 deletions packtools/catalogs/htmlgenerator/v2.0/article-text-fn.xsl
Original file line number Diff line number Diff line change
@@ -30,28 +30,13 @@
<!--
Apresenta uma lista de fn encontrados em body, exceto os de table-wrap
-->
<xsl:apply-templates select="." mode="choose-format"/>
<xsl:apply-templates select="." mode="div-fn-list-item"/>
</xsl:template>

<xsl:template match="table-wrap-foot//fn" mode="text-fn">
<!-- do nothing for table-wrap-foot/fn -->
</xsl:template>

<xsl:template match="fn" mode="choose-format">
<!--
Dependendo do tipo de fn, apresenta em formato de
back-section ou item de lista
-->
<xsl:choose>
<xsl:when test="@fn-type='edited-by' or @fn-type='data-availability'">
<xsl:apply-templates select="." mode="back-section"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="." mode="div-fn-list-item"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="fn/p | corresp/p">
<div>
<xsl:apply-templates select="*|text()"/>
@@ -95,10 +80,6 @@
<h2><xsl:apply-templates select="*|text()"/></h2>
</xsl:template>

<xsl:template match="fn[@fn-type='edited-by']/label | fn[@fn-type='data-availability']/label | fn[@fn-type='edited-by']/title | fn[@fn-type='data-availability']/title" mode="div-fn-list-item">
<!-- do nothing for fn edited-by or data-availability -->
</xsl:template>

<xsl:template match="body//fn | back/fn | author-notes/* | back/fn-group" mode="back-section-content">
<div class="ref-list">
<ul class="refList footnote">
@@ -131,10 +112,10 @@

<xsl:template match="author-notes" mode="author-notes-as-sections">
<!-- apresenta as notas de autores que indicam Ciência Aberta -->
<xsl:apply-templates select="fn[@fn-type='edited-by'] | fn[ @fn-type='data-availability']" mode="back-section"/>
<xsl:apply-templates select="fn[@fn-type='edited-by'] | fn[@fn-type='data-availability']" mode="back-section"/>
</xsl:template>

<xsl:template match="fn[@fn-type='edited-by'] | fn[ @fn-type='data-availability']" mode="back-section-menu">
<xsl:template match="fn[@fn-type='edited-by'] | fn[@fn-type='data-availability']" mode="back-section-menu">
<xsl:variable name="name" select="@fn-type"/>
<!--
Evita que no menu apareça o mesmo título mais de uma vez
@@ -148,23 +129,30 @@
</xsl:if>
</xsl:template>

<xsl:template match="fn[@fn-type='edited-by'] | fn[ @fn-type='data-availability']" mode="back-section-h">
<xsl:template match="fn[@fn-type='edited-by'] | fn[@fn-type='data-availability']" mode="back-section-h">
<!--
Apresenta o título da seção no texto completo
-->
<xsl:variable name="name" select="@fn-type"/>
<xsl:if test="not(preceding-sibling::node()) or preceding-sibling::*[1][not(@fn-type)] or preceding-sibling::*[1][@fn-type!=$name]">
<h1 class="articleSectionTitle">
<xsl:apply-templates select="label"/>
<xsl:if test="label and title">&#160;</xsl:if>
<xsl:apply-templates select="title"/>
<xsl:if test="not(label) and not(title)">
<xsl:apply-templates select="." mode="text-labels">
<xsl:with-param name="text"><xsl:value-of select="@fn-type"/></xsl:with-param>
</xsl:apply-templates>
</xsl:if>
<xsl:apply-templates select="." mode="text-labels">
<xsl:with-param name="text"><xsl:value-of select="@fn-type"/></xsl:with-param>
</xsl:apply-templates>
</h1>
</xsl:if>
</xsl:template>

<xsl:template match="fn[@fn-type='edited-by'] | fn[@fn-type='data-availability']" mode="back-section-content">
<xsl:apply-templates select="p"/>
</xsl:template>

<xsl:template match="fn[@fn-type='edited-by']/label | fn[@fn-type='data-availability']/label" mode="back-section-content">
<!-- nao apresentar -->
</xsl:template>

<xsl:template match="fn[@fn-type='edited-by']/p | fn[@fn-type='data-availability']/p" mode="back-section-content">
<p><xsl:apply-templates select="*|text()"/></p>
</xsl:template>

</xsl:stylesheet>
Original file line number Diff line number Diff line change
@@ -3,24 +3,32 @@
version="1.0">

<xsl:template match="article" mode="data-availability">
<xsl:if test=".//article-meta/supplementary-material or .//element-citation[@publication-type='data' or @publication-type='database']">
<xsl:if test=".//*[@fn-type='data-availability'] or .//article-meta/supplementary-material or .//element-citation[@publication-type='data' or @publication-type='database']">
<xsl:apply-templates select="." mode="data-availability-menu-title"/>
<xsl:choose>
<xsl:when test=".//sub-article[@xml:lang=$TEXT_LANG and @article-type='translation']">
<xsl:when test="sub-article[@xml:lang=$TEXT_LANG and @article-type='translation']">
<!-- sub-article -->
<xsl:apply-templates select=".//sub-article[@xml:lang=$TEXT_LANG and @article-type='translation']//sec[@sec-type='supplementary-material']" mode="data-availability"/>
<xsl:apply-templates select="sub-article[@xml:lang=$TEXT_LANG and @article-type='translation']" mode="doc-version-data-availability"/>
</xsl:when>
<xsl:otherwise>
<!-- article -->
<xsl:apply-templates select="body/sec[@sec-type='supplementary-material']" mode="data-availability"/>
<xsl:apply-templates select="." mode="doc-version-data-availability"/>
</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select=".//article-meta/supplementary-material" mode="data-availability"/>
<xsl:apply-templates select=".//ref-list" mode="data-availability"/>

<xsl:apply-templates select="back//ref-list" mode="data-availability"/>
</xsl:if>
</xsl:template>

<xsl:template match="article | sub-article" mode="doc-version-data-availability">
<xsl:apply-templates select="body | back" mode="data-availability"/>
</xsl:template>

<xsl:template match="body | back" mode="data-availability">
<xsl:apply-templates select=".//sec[@sec-type='supplementary-material']" mode="data-availability"/>
<xsl:apply-templates select=".//*[@fn-type='data-availability']" mode="data-availability"/>
</xsl:template>

<xsl:template match="article" mode="data-availability-menu-title">
<xsl:variable name="title">
<xsl:apply-templates select="." mode="text-labels">
@@ -66,4 +74,18 @@
<xsl:apply-templates select="."/>
</xsl:template>

<xsl:template match="fn" mode="data-availability">
<div class="row">
<div class="col-md-12 col-sm-12">
<xsl:apply-templates select="p" mode="data-availability"/>
</div>
</div>
</xsl:template>

<xsl:template match="fn/*" mode="data-availability">
<p>
<xsl:apply-templates select="*|text()"/>
</p>
</xsl:template>

</xsl:stylesheet>
4 changes: 2 additions & 2 deletions packtools/catalogs/htmlgenerator/v2.0/config-labels.xml
Original file line number Diff line number Diff line change
@@ -446,8 +446,8 @@
<term>
<name>edited-by</name>
<name lang="en">Edited by</name>
<name lang="pt">Editores</name>
<name lang="es">Editores</name>
<name lang="pt">Editado por</name>
<name lang="es">Editado por</name>
</term>

<term>
Loading

0 comments on commit 8b3672e

Please sign in to comment.