Skip to content

Commit

Permalink
Melhorias apresentacao ciencia aberta editores dados pareceres v2 e v3 (
Browse files Browse the repository at this point in the history
#412)

* [Página Artigo] Refatora apresentação de elementos de back v2.0

* [Página Artigo] Refatora apresentação de elementos de back v3.0

* [Página Artigo] Apresentação de elementos de fn v2.0
- cria seção para edited-by
- cria seção para data-availability
- padroniza o título de seção ref-list
- melhora apresentação de notas

* [Página Artigo] Apresentação de elementos de fn v3.0
- cria seção para edited-by
- cria seção para data-availability
- padroniza o título de seção ref-list
- melhora apresentação de notas

* Altera os títulos do menu de edited-by e data-availability

* [Página Artigo] Corrige h1 e h2 para o título da seção "disponibilidade de dados" v3.0

* Corrige apresentação do menu Text e sub-seções que estavam ausentes no texto de tradução

* [Página Artigo] Adiciona novos xml e seus html gerados após correções de back e fn

* [Página Artigo] Atualiza html gerados após correções de back e fn e padronização do menu esquerdo

* Adiciona XML com estrutura de Resenha / peer-review / traduções

* Adiciona os HTML gerados a partir de XML com estrutura resenha / peer-review / tradução

* Corrigi o valor de sub-article/@article-type de `'translation`' para `'reviewer-report'` e gera os HTML novamente

* Remove a restrição de idioma para apresentar sub-article que não é tradução
E gera novamente os HTML

* Remove a restrição de idioma para apresentar 'About the author' do sub-article que não é tradução
    E gera novamente os HTML

* Altera o texto do botão "Sobre o autor" para "Sobre o autor do parecer" quando o sub-article é do tipo reviewer-report

* Remove os "subject" excedentes, que não são do sub-article do tipo translation

* Adota como valor padrão 'Text' (Texto) para a opção "Texto Principal" no menu esquerdo

* Adequa o texto de "About the authors" ou About the reviewer

* Atualiza os html gerados com a correção do texto do botão About the reviewer

* Corrige a apresentação do histórico de Peer review report como sub-article
Corrige a referência de product

* Corrige o tooltip de xref do tipo bibr

* Corrige o conteúdo do tooltip de xref de bibr

* Melhora a apresentação de seções de back, inclusive as seções indicadoras de práticas Ciência Aberta

* Troca h1 por h3

* Corrige a apresentação de xref presente em author-notes (modal sobre autores)

* Remove a variável REFLIST_POSITION que era usada para identificar onde inserir a lista de referências para o sub-article. A estratégia para definir a posição mudou porque em caso de haver mais de um ref-list, REFLIST_POSITION não atendia a demanda.

* Move a variável article de article.xsl para config-vars.xsl

* Apresenta custom-meta-group de sub-article/front-stub

* Adiciona os html gerados que melhora destaque de práticas de Ciência Aberta: editores, dados e pareceres
  • Loading branch information
robertatakenaka authored May 25, 2023
1 parent e9b6997 commit 5aa6765
Show file tree
Hide file tree
Showing 129 changed files with 50,223 additions and 2,215 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:mml="http://www.w3.org/1998/Math/MathML"
exclude-result-prefixes="xlink mml">

<xsl:template match="custom-meta-group">
<!--
<custom-meta>
<meta-name>peer-review-recommendation</meta-name>
<meta-value>accept</meta-value>
</custom-meta>
-->
<div class="row">
<div class="col-md-12 col-sm-12">
<ul class="articleTimeline">
<xsl:apply-templates select="custom-meta"/>
</ul>
</div>
</div>
</xsl:template>

<xsl:template match="custom-meta">
<li>
<strong><xsl:apply-templates select="meta-name"/>: </strong>
<xsl:apply-templates select="meta-value"/>
</li>
</xsl:template>

<xsl:template match="meta-name | meta-value">
<xsl:apply-templates match="." mode="text-labels">
<xsl:with-param name="text" select="."/>
<xsl:with-param name="default_value" select="."/>
</xsl:apply-templates>
</xsl:template>
</xsl:stylesheet>
28 changes: 24 additions & 4 deletions packtools/catalogs/htmlgenerator/v2.0/article-meta-contrib.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,37 @@
<xsl:template match="article-meta/contrib-group | sub-article[@article-type='translation']/*/contrib-group" mode="modal-id"></xsl:template>

<xsl:template match="article-meta/contrib-group | front/contrib-group | front-stub/contrib-group">
<xsl:variable name="id"><xsl:apply-templates select="." mode="modal-id"></xsl:apply-templates></xsl:variable>
<xsl:apply-templates select="contrib[@contrib-type='author']" mode="article-meta-contrib"/>
<xsl:apply-templates select="." mode="about-the-contrib-group-button"/>
</xsl:template>

<xsl:template match="article-meta/contrib-group | front/contrib-group | front-stub/contrib-group" mode="about-the-contrib-group-button">
<!--
Adiciona o botão 'About the contributor', trocando 'author',
pelo tipo de contribuição
-->
<xsl:if test="contrib/*[name()!='name' and name()!='collab']">
<xsl:variable name="id"><xsl:apply-templates select="." mode="modal-id"></xsl:apply-templates></xsl:variable>
<a href="" class="outlineFadeLink" data-toggle="modal"
data-target="#ModalTutors{$id}">
<xsl:apply-templates select="." mode="interface">
<xsl:with-param name="text">About the author<xsl:if test="count(contrib[@contrib-type='author'])&gt;1">s</xsl:if></xsl:with-param>
</xsl:apply-templates>
<xsl:apply-templates select="." mode="about-the-contrib-group-button-text"/>
</a>
</xsl:if>
</xsl:template>

<xsl:template match="article-meta/contrib-group | front/contrib-group | front-stub/contrib-group" mode="about-the-contrib-group-button-text">
<xsl:variable name="type">
<xsl:choose>
<xsl:when test="../../@article-type='reviewer-report'">reviewer</xsl:when>
<xsl:otherwise><xsl:value-of select="contrib[1]/@contrib-type"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="count"><xsl:value-of select="count(contrib[@contrib-type=$type])"/></xsl:variable>

<xsl:apply-templates select="." mode="interface">
<xsl:with-param name="text">About the <xsl:value-of select="$type"/><xsl:if test="number($count)&gt;1">s</xsl:if></xsl:with-param>
</xsl:apply-templates>
</xsl:template>

<!--xsl:template match="contrib" mode="article-meta-contrib">
<xsl:choose>
Expand Down
2 changes: 1 addition & 1 deletion packtools/catalogs/htmlgenerator/v2.0/article-meta.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-->
<xsl:choose>
<xsl:when test=".//sub-article[@xml:lang=$TEXT_LANG and @article-type='translation']">
<xsl:for-each select=".//sub-article[@xml:lang=$TEXT_LANG and @article-type='translation']//subject">
<xsl:for-each select=".//sub-article[@xml:lang=$TEXT_LANG and @article-type='translation']/*/article-categories//subject">
<xsl:value-of select="text()"/>
<xsl:choose>
<xsl:when test="position() != last()">, </xsl:when>
Expand Down
148 changes: 103 additions & 45 deletions packtools/catalogs/htmlgenerator/v2.0/article-text-back.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -4,73 +4,131 @@

<xsl:template match="*" mode="node-name"><xsl:value-of select="name()"/></xsl:template>

<xsl:template match="ref-list" mode="standard-title">
<xsl:apply-templates select="." mode="text-labels">
<xsl:with-param name="text">ref-list</xsl:with-param>
</xsl:apply-templates>
</xsl:template>

<xsl:template match="back/*" mode="real-title">
<!--
Apresentar o título de seção tal como está no XML.
Não forçar tradução do título,o que ocorria em sub-article do tipo
translation
Não criar título a partir do nome da tag ref-list
-->
<xsl:apply-templates select="label"/>
<xsl:if test="label and title">&#160;</xsl:if>
<xsl:apply-templates select="title"/>
</xsl:template>

<xsl:template match="article" mode="text-back">
<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']/back/*" mode="back"/>
<xsl:if test="count(.//sub-article[@xml:lang=$TEXT_LANG and @article-type='translation']/back/*) &lt; $REFLIST_POSITION">
<!--
<xsl:comment> ref-list inserted </xsl:comment>
-->
<xsl:apply-templates select=".//sub-article[@xml:lang=$TEXT_LANG and @article-type='translation']/back" mode="back"/>
<xsl:if test="not(.//sub-article[@xml:lang=$TEXT_LANG and @article-type='translation']/back)">
<xsl:apply-templates select="$article/back/ref-list" mode="back-section"/>
</xsl:if>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="./back/*" mode="back"></xsl:apply-templates>
<xsl:apply-templates select="back" mode="back"/>
</xsl:otherwise>
</xsl:choose>
</xsl:choose>
</xsl:template>


<xsl:template match="*" mode="back">
<!--
<xsl:comment> <xsl:value-of select="name()"/>, mode="back" </xsl:comment>
<xsl:comment> position()=<xsl:value-of select="position()"/> </xsl:comment>
<xsl:comment> $REFLIST_POSITION=<xsl:value-of select="$REFLIST_POSITION"/> </xsl:comment>
<xsl:comment> $REFLIST_INDEX=<xsl:value-of select="$REFLIST_INDEX"/> </xsl:comment>
-->
<xsl:apply-templates select="." mode="back-section"/>
<xsl:template match="back" mode="back">
<xsl:apply-templates select="*" mode="back-section"/>
</xsl:template>

<xsl:template match="sub-article[@article-type='translation']/back[not(ref-list)]/*" mode="back">
<!--
<xsl:comment> sub-article/<xsl:value-of select="name()"/>, mode="back" </xsl:comment>
<xsl:comment> position()=<xsl:value-of select="position()"/> </xsl:comment>
<xsl:comment> $REFLIST_POSITION=<xsl:value-of select="$REFLIST_POSITION"/> </xsl:comment>
<xsl:comment> $REFLIST_INDEX=<xsl:value-of select="$REFLIST_INDEX"/> </xsl:comment>
-->
<xsl:template match="sub-article[@article-type='translation']/back" mode="back">
<xsl:choose>
<xsl:when test="ref-list or not($article/back/ref-list)">
<!-- apresenta os elementos de back -->
<xsl:apply-templates select="*" mode="back-section"/>
</xsl:when>
<xsl:otherwise>
<!-- apresenta os elementos de back -->
<!-- como não existe sub-article/back/ref-list, apresenta ref-list de article/back/ref-list -->
<xsl:apply-templates select="." mode="back-section-insert-article-reflist"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="back" mode="back-section-insert-article-reflist">
<!-- apresenta os elementos de back -->
<!-- como não existe sub-article/back/ref-list, apresenta ref-list de article/back/ref-list -->
<xsl:variable name="count"><xsl:value-of select="count($article/back/*)"/></xsl:variable>

<xsl:if test="position()=$REFLIST_POSITION">
<!--
<xsl:comment> ref-list inserted </xsl:comment>
-->
<xsl:apply-templates select="$article/back/ref-list" mode="back-section"/>
<xsl:choose>
<xsl:when test="$article/back/*[position()=1 and name()='ref-list']">
<!-- insere no início -->
<xsl:apply-templates select="." mode="add-reflist-from-article-back"/>
<xsl:apply-templates select="*" mode="back-section"/>
</xsl:when>
<xsl:when test="$article/back/*[position()=$count and name()='ref-list']">
<!-- insere no final -->
<xsl:apply-templates select="*" mode="back-section"/>
<xsl:apply-templates select="." mode="add-reflist-from-article-back"/>
</xsl:when>
<xsl:otherwise>
<!-- insere antes de fn / fn-group -->
<xsl:apply-templates select="*[name()!='fn-group' and name()!='fn']" mode="back-section"/>
<xsl:apply-templates select="." mode="add-reflist-from-article-back"/>
<xsl:apply-templates select="*[name()='fn-group' or name()='fn']" mode="back-section"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="back" mode="add-reflist-from-article-back">
<xsl:apply-templates select="$article/back/ref-list" mode="back-section"/>
</xsl:template>

<xsl:template match="*" mode="back-section-menu">
<xsl:if test="title or label">
<xsl:attribute name="data-anchor">
<xsl:apply-templates select="label"/>
<xsl:if test="label and title">&#160;</xsl:if>
<xsl:apply-templates select="title"/>
</xsl:attribute>
</xsl:if>
</xsl:template>

<xsl:template match="ref-list" mode="back-section-menu">
<xsl:variable name="name" select="name()"/>
<!-- cria menu somente para o primeiro ref-list (há casos de série de ref-list) -->
<xsl:if test="not(preceding-sibling::node()) or preceding-sibling::*[1][name()!=$name]">
<xsl:attribute name="data-anchor">
<xsl:apply-templates select="." mode="text-labels">
<xsl:with-param name="text">ref-list</xsl:with-param>
</xsl:apply-templates>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="." mode="back-section"/>
</xsl:template>

<xsl:template match="*" mode="back-section">
<div>
<xsl:if test="label or title">
<xsl:attribute name="class">articleSection</xsl:attribute>
<xsl:attribute name="data-anchor"><xsl:apply-templates select="." mode="title"></xsl:apply-templates></xsl:attribute>
</xsl:if>
<h1>
<xsl:if test="label or title">
<xsl:attribute name="class">articleSectionTitle</xsl:attribute>
<xsl:apply-templates select="." mode="title"></xsl:apply-templates>
</xsl:if>
<xsl:template match="*" mode="back-section-h">
<xsl:if test="title or label">
<h1 class="articleSectionTitle">
<xsl:apply-templates select="label"/>
<xsl:if test="label and title">&#160;</xsl:if>
<xsl:apply-templates select="title"/>
</h1>
<xsl:apply-templates select="." mode="back-section-content"></xsl:apply-templates>
</xsl:if>
</xsl:template>

<xsl:template match="*" mode="back-section">
<div class="articleSection">
<xsl:apply-templates select="." mode="back-section-menu"/>
<xsl:apply-templates select="." mode="back-section-h"/>
<xsl:apply-templates select="." mode="back-section-content"/>
</div>
</xsl:template>

<xsl:template match="app-group" mode="back-section">
<xsl:apply-templates select="app" mode="back-section"></xsl:apply-templates>
<xsl:apply-templates select="app" mode="back-section"/>
</xsl:template>

<xsl:template match="*" mode="back-section-content">
<xsl:apply-templates select="*[name()!='title' and name()!='label'] | text()"></xsl:apply-templates>
<xsl:apply-templates select="*[name()!='title' and name()!='label'] | text()"/>
</xsl:template>

</xsl:stylesheet>
Loading

0 comments on commit 5aa6765

Please sign in to comment.