Skip to content

Commit

Permalink
Opac packtools 2 17 3 (#354)
Browse files Browse the repository at this point in the history
* Apresenta os elementos `article-meta/supplementary-material no final da página e contextualizados com a seção 'Material suplementar'

* Apresenta no menu lateral `authors-notes/fn[@fn-type='edited-by']` e `author-notes/fn[@fn-type='other']` (se tiver label)

* Adiciona fixture para exemplificar How to cite em que não há separador entre autores e título

* Acrescenta separador entre autores e títulos em  'como citar'

* Faz correções para apresentar notas de rodapé
- para as notas de autores, somente apresenta no menu lateral aquelas que tem `@fn-type='other'` e que têm label ou `@fn-type='edited-by'
- para as demais notas, apresenta no menu lateral somente notas que têm label textual

* Adiciona / atualiza as fixtures para htmlgenerator

* Volta ao original `<div>` no lugar de `<p>`

* Atualiza os html gerados pelo htmlgenerator

* Faz ajustes nos textos de tradução de termos como data availability, related-article-type, anonymous

* Adiciona fixtures para autor anonimo, history com data do tipo peer review e preprint, material suplementar como data-availability, related-article

* Melhora os textos para `@related-article-type` e acrescenta texto para `history/@date-type`

* Remove os dois-pontos dos textos de related-article-type

* Remove template desnecessário que apresentaria o texto do tipo de data do histórico

* Remove código desnecessário e adiciona a tradução do texto date_type_preprint para distinguir do texto `preprint`

* Atualiza a versão para 2.17.3

* Muda a ordem de apresentação da seção de `Dados de pesquisa`. Insere antes das datas de publicação. E adiciona um subtítulo de 'Citações de dados' para as referências bibliográficas de data ou database.
  • Loading branch information
robertatakenaka authored Dec 2, 2022
1 parent 4dbcc1e commit 94c5810
Show file tree
Hide file tree
Showing 54 changed files with 14,534 additions and 218 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,25 @@

<xsl:template match="@related-article-type" mode="article-meta-related-article-message">
<!-- MESSAGE -->
<!--
OBS.: geralmente somente um dos documentos possui related-article.
O artigo mencionando geralmente não possui related-article. Mas
foi sugerido que passe a ser inserido para que o XML seja autossuficiente. Atualmente o link da volta é feito via aplicação
do site.
-->
<xsl:choose>
<xsl:when test=".='corrected-article'">This erratum corrects</xsl:when>
<xsl:when test=".='retracted-article'">This retraction retracts</xsl:when>
<xsl:when test=".='commentary-article'">This document comments</xsl:when>
<xsl:when test=".='addendum'">This document has an addendum</xsl:when>
<xsl:when test=".='retraction'">This document was retracted by</xsl:when>
<xsl:when test=".='correction'">This document has corrections</xsl:when>
<xsl:when test=".='preprint'">This article has preprint version</xsl:when>
<xsl:when test=".='peer-reviewed-material'">Peer reviewed article</xsl:when>
<xsl:when test=".='preprint'">This document has the publication of reviewers' recommendation</xsl:when>
<xsl:when test=".='peer-reviewed-material'">This recommendation refers to the article</xsl:when>
<xsl:otherwise>This document is related to</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="related-article" mode="article-meta-related-article-message">
<xsl:variable name="message">
<xsl:apply-templates select="@related-article-type" mode="article-meta-related-article-message"/>
Expand Down
68 changes: 50 additions & 18 deletions packtools/catalogs/htmlgenerator/v2.0/article-text-fn.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,34 @@
</div>
</xsl:if>
</xsl:template>

<xsl:template match="fn" mode="text-fn">
<xsl:apply-templates select="."/>
</xsl:template>

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

<xsl:template match="fn">
<xsl:variable name="title"><xsl:apply-templates select="label"/></xsl:variable>
<li>
<xsl:apply-templates select="*|text()"></xsl:apply-templates>
<xsl:choose>
<xsl:when test="string-length(normalize-space($title)) &gt; 3">
<div>
<xsl:attribute name="class">articleSection</xsl:attribute>
<xsl:attribute name="data-anchor"><xsl:value-of select="translate($title, ':', '')"/></xsl:attribute>
<h3><xsl:value-of select="translate($title, ':', '')"/></h3>
<xsl:apply-templates select="*[name()!='label']|text()"/>
</div>
</xsl:when>
<xsl:otherwise>
<span class="xref big"><xsl:apply-templates select="label"/></span>
<xsl:apply-templates select="*[name()!='label']|text()"/>
</xsl:otherwise>
</xsl:choose>
</li>
</xsl:template>

<xsl:template match="fn/label">
<xsl:choose>
<xsl:when test="string-length(normalize-space(text())) &gt; 3">
<div>
<xsl:attribute name="class">articleSection</xsl:attribute>
<xsl:attribute name="data-anchor"><xsl:value-of select="."/></xsl:attribute>
<h3><xsl:apply-templates select="*|text()"></xsl:apply-templates></h3>
</div>
</xsl:when>
<xsl:otherwise>
<span class="xref big"><xsl:apply-templates select="*|text()"></xsl:apply-templates></span>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="fn/p">
<div>
<xsl:apply-templates select="*|text()"></xsl:apply-templates>
Expand All @@ -71,4 +70,37 @@
</div>
</xsl:template>

<xsl:template match="article" mode="author-notes-as-sections">
<xsl:choose>
<xsl:when test=".//sub-article[@xml:lang=$TEXT_LANG and @article-type='translation']">
<xsl:apply-templates select=".//sub-article[@xml:lang=$TEXT_LANG and @article-type='translation']//front-stub//author-notes" mode="author-notes-as-sections"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select=".//front//author-notes" mode="author-notes-as-sections"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="author-notes" mode="author-notes-as-sections">
<xsl:if test=".//fn">
<xsl:apply-templates select=".//fn" mode="author-notes-as-sections"/>
</xsl:if>
</xsl:template>

<xsl:template match="author-notes/fn" mode="author-notes-as-sections">
<!-- não faz nada -->
</xsl:template>

<xsl:template match="author-notes/fn[@fn-type='edited-by']" mode="author-notes-as-sections">
<xsl:variable name="title"><xsl:apply-templates select="label"/><xsl:if test="not(label)"><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:variable>
<div>
<xsl:attribute name="class">articleSection</xsl:attribute>
<xsl:attribute name="data-anchor"><xsl:value-of select="translate($title, ':', '')"/></xsl:attribute>
<h3><xsl:value-of select="translate($title, ':', '')"/></h3>
<xsl:apply-templates select="*[name()!='label']|text()"/>
</div>
</xsl:template>

</xsl:stylesheet>
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,29 @@
<div class="articleSection">
<xsl:attribute name="data-anchor"><xsl:value-of select="$title"/></xsl:attribute>
<h1 class="articleSectionTitle"><xsl:value-of select="$title"/></h1>
<xsl:apply-templates select=".//article-meta" mode="data-availability"/>
<xsl:apply-templates select=".//ref-list" mode="data-availability"/>
</div>
</xsl:if>
</xsl:template>
</div>
<xsl:choose>
<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:when>
<xsl:otherwise>
<!-- article -->
<xsl:apply-templates select="body/sec[@sec-type='supplementary-material']" mode="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:if>

<xsl:template match="article-meta" mode="data-availability">
<xsl:apply-templates select="element-citation[@publication-type='data' or @publication-type='database']" mode="data-availability"/>
</xsl:template>

<xsl:template match="ref-list" mode="data-availability">
<xsl:if test=".//element-citation[@publication-type='data' or @publication-type='database']">
<h2><xsl:apply-templates select="." mode="text-labels">
<xsl:with-param name="text">Data citations</xsl:with-param>
</xsl:apply-templates></h2>
<xsl:apply-templates select=".//element-citation[@publication-type='data' or @publication-type='database']" mode="data-availability"/>
</xsl:if>
</xsl:template>
Expand All @@ -48,4 +59,8 @@
</div>
</xsl:template>

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

</xsl:stylesheet>
4 changes: 2 additions & 2 deletions packtools/catalogs/htmlgenerator/v2.0/article.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,12 @@
<xsl:apply-templates select="." mode="text-body"/>
<xsl:apply-templates select="." mode="text-back"/>
<xsl:apply-templates select="." mode="text-fn"/>
<xsl:apply-templates select="." mode="author-notes-as-sections"/>
<xsl:apply-templates select="." mode="article-text-sub-articles"/>

<xsl:apply-templates select="." mode="data-availability"/>
<xsl:apply-templates select="front/article-meta" mode="generic-pub-date"/>
<xsl:apply-templates select="front/article-meta" mode="generic-history"/>
<xsl:apply-templates select="." mode="data-availability"/>

<section class="documentLicense">
<div class="container-license">
<div class="row">
Expand Down
45 changes: 41 additions & 4 deletions packtools/catalogs/htmlgenerator/v2.0/config-labels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@
<name lang="pt">Dados de pesquisa</name>
<name lang="es">Datos de investigación</name>
</term>
<term>
<name>Data citations</name>
<name lang="pt">Citações de dados</name>
<name lang="es">Citaciones de datos</name>
</term>
<term>
<name>data-availability</name>
<name lang="en">Data availability statement</name>
<name lang="pt">Declaração de disponibilidade de dados</name>
<name lang="es">Declaración de disponibilidad de datos</name>
</term>

<term>
<name>Text</name>
<name lang="pt">Texto</name>
Expand Down Expand Up @@ -118,6 +130,18 @@
<name lang="es">Preprint</name>
<name lang="en">Preprint</name>
</term>
<term>
<name>date-type-preprint</name>
<name lang="pt">Preprint depositado em</name>
<name lang="es">Preprint depositado en</name>
<name lang="en">Preprint uploaded on</name>
</term>
<term>
<name>reviewer-report-received</name>
<name lang="pt">Parecer recebido em</name>
<name lang="es">Parecer recibido en</name>
<name lang="en">Peer review received</name>
</term>
<term>
<name>retracted</name>
<name lang="pt">Retratado</name>
Expand Down Expand Up @@ -402,6 +426,13 @@
<name lang="es">Traducción de</name>
</term>

<term>
<name>edited-by</name>
<name lang="en">Edited by</name>
<name lang="pt">Editado por</name>
<name lang="es">Editado por</name>
</term>

<term>
<name>This retraction retracts</name>
<name lang="en">This retraction retracts</name>
Expand All @@ -427,10 +458,16 @@
<name lang="es">Este artículo tiene versión preprint</name>
</term>
<term>
<name>Peer reviewed article</name>
<name lang="en">Peer reviewed article</name>
<name lang="pt">Artigo revisado</name>
<name lang="es">Artículo revisado</name>
<name>This recommendation refers to the article</name>
<name lang="en">This recommendation refers to the article</name>
<name lang="pt">Esta recomendação é referente ao artigo</name>
<name lang="es">Esta recomendación se refiere al artículo</name>
</term>
<term>
<name>This document has the publication of reviewers' recommendation</name>
<name lang="en">This document has the publication of reviewers' recommendation</name>
<name lang="pt">Este documento tem a publicação de recomendação de pareceristas</name>
<name lang="es">Este documento tiene la publicación de la recomendación de los revisores</name>
</term>
<term>
<name>This document is related to</name>
Expand Down
6 changes: 0 additions & 6 deletions packtools/catalogs/htmlgenerator/v2.0/config-labels.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,6 @@
</xsl:apply-templates>
</xsl:template>

<xsl:template match="history/date" mode="generated-label">
<xsl:apply-templates select="." mode="text-labels">
<xsl:with-param name="text"><xsl:value-of select="@date-type"/></xsl:with-param>
</xsl:apply-templates>
</xsl:template>

<xsl:template match="*" mode="title">
<!--
<xsl:comment> * mode=title </xsl:comment>
Expand Down
48 changes: 9 additions & 39 deletions packtools/catalogs/htmlgenerator/v2.0/generic-history.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,13 @@
<div class="col-md-12 col-sm-12">
<ul class="articleTimeline">
<xsl:apply-templates select="." mode="generic-history-history-dates"></xsl:apply-templates>
<xsl:apply-templates select="." mode="generic-history-errata-date"></xsl:apply-templates>
<xsl:apply-templates select="." mode="generic-history-retraction-date"></xsl:apply-templates>
<xsl:apply-templates select="." mode="generic-history-manisfestation-date"></xsl:apply-templates>
</ul>
</div>
</div>
</div>
</xsl:if>
</xsl:template>

<!--xsl:template match="front-stub | *[name()!='article']/front" mode="generic-history">
<div>
<div class="row">
<div class="col-md-12 col-sm-12">
<h1><xsl:apply-templates select="." mode="text-labels">
<xsl:with-param name="text">History</xsl:with-param>
</xsl:apply-templates></h1>
</div>
</div>
<div class="row">
<div class="col-md-12 col-sm-12">
<ul class="articleTimeline">
<xsl:apply-templates select="." mode="generic-history-history-dates"></xsl:apply-templates>
<xsl:apply-templates select="." mode="generic-history-epub-date"></xsl:apply-templates>
<xsl:apply-templates select="." mode="generic-history-publication-date"></xsl:apply-templates>
<xsl:apply-templates select="." mode="generic-history-errata-date"></xsl:apply-templates>
<xsl:apply-templates select="." mode="generic-history-retraction-date"></xsl:apply-templates>
<xsl:apply-templates select="." mode="generic-history-manisfestation-date"></xsl:apply-templates>
</ul>
</div>
</div>
</div>
</xsl:template-->

<xsl:template match="article-meta" mode="generic-history-history-dates">
<xsl:choose>
<xsl:when test="$article//sub-article[@xml:lang=$TEXT_LANG and @article-type='translation']//history">
Expand All @@ -67,25 +40,22 @@
<xsl:template match="history/date" mode="generic-history-list-item">
<li>
<strong>
<xsl:apply-templates select="." mode="generated-label"></xsl:apply-templates>
<xsl:apply-templates select="@date-type" mode="history-item-label"/>
</strong><br/>
<xsl:apply-templates select="."></xsl:apply-templates>
</li>
</xsl:template>

<xsl:template match="*" mode="generic-history-errata-date">
<!-- FIXME -->
<!-- li><strong>Errata:</strong><br/> 01/11/2013</li -->
</xsl:template>

<xsl:template match="*" mode="generic-history-retraction-date">
<!-- FIXME -->
<!-- li><strong>Retratação:</strong><br/> 01/11/2013</li -->
<xsl:template match="@date-type" mode="history-item-label">
<xsl:apply-templates select="." mode="text-labels">
<xsl:with-param name="text"><xsl:value-of select="."/></xsl:with-param>
</xsl:apply-templates>
</xsl:template>

<xsl:template match="*" mode="generic-history-manisfestation-date">
<!-- FIXME -->
<!-- li><strong>Manifestação de preocupação:</strong><br/> 01/11/2013</li -->
<xsl:template match="@date-type[.='preprint']" mode="history-item-label">
<xsl:apply-templates select="." mode="text-labels">
<xsl:with-param name="text">date-type-<xsl:value-of select="."/></xsl:with-param>
</xsl:apply-templates>
</xsl:template>

<xsl:template match="*[month or year or day or season]">
Expand Down
12 changes: 9 additions & 3 deletions packtools/catalogs/htmlgenerator/v2.0/html-modals-how2cite.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@
<xsl:when test="count(contrib)=1">
<xsl:apply-templates select="contrib" mode="how2cite-contrib">
<xsl:with-param name="sep"></xsl:with-param>
</xsl:apply-templates>
</xsl:apply-templates>.
</xsl:when>
<xsl:when test="count(contrib)&lt;=3">
<xsl:apply-templates select="contrib" mode="how2cite-contrib">
<xsl:with-param name="sep"><xsl:apply-templates select="." mode="text-labels">
<xsl:with-param name="text">and</xsl:with-param>
</xsl:apply-templates></xsl:with-param>
</xsl:apply-templates>
</xsl:apply-templates>.
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="contrib[1]" mode="how2cite-contrib">
Expand All @@ -127,7 +127,13 @@
<xsl:otherwise>&#160;<xsl:value-of select="$sep"/>&#160;</xsl:otherwise>
</xsl:choose>
</xsl:if>
<xsl:apply-templates select="name | collab" mode="how2cite-contrib"/>
<xsl:apply-templates select="anonymous | name | collab" mode="how2cite-contrib"/>
</xsl:template>

<xsl:template match="anonymous" mode="how2cite-contrib">
<xsl:value-of select="."/><xsl:if test=".=''"><xsl:apply-templates select="." mode="text-labels">
<xsl:with-param name="text">Anonymous</xsl:with-param>
</xsl:apply-templates></xsl:if>
</xsl:template>

<xsl:template match="name" mode="how2cite-contrib">
Expand Down
2 changes: 1 addition & 1 deletion packtools/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Single source to the version across setup.py and the whole project.
"""
from __future__ import unicode_literals
__version__ = '2.17.1'
__version__ = '2.17.3'
Loading

0 comments on commit 94c5810

Please sign in to comment.