Skip to content

Commit

Permalink
Sincroniza os branches version27 com master - página do artigo (#456)
Browse files Browse the repository at this point in the history
* Corrige ausência de "contrib-type"

* Corrige a ausência da apresentação de link de relacionamento entre documentos na versão traduzida

* Corrige a obtenção dos caminhos dos ativos digitais

* Troca a lista de autores por um botão de autoria e adiciona botão para acessar dados de scimago
  • Loading branch information
robertatakenaka authored Aug 14, 2023
1 parent 8ad2fc1 commit 779eb63
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 82 deletions.
64 changes: 26 additions & 38 deletions packtools/catalogs/htmlgenerator/v2.0/article-meta-contrib.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@
<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">
<!--
Remove a apresentação dos autores, deixando apenas o botão "sobre os autores" e adicionando scimago
<xsl:apply-templates select="contrib[@contrib-type='author']" mode="article-meta-contrib"/>
-->
<xsl:apply-templates select="." mode="about-the-contrib-group-button"/>
<xsl:apply-templates select="." mode="scimago-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',
Expand All @@ -51,6 +55,20 @@
</a>
</xsl:if>
</xsl:template>

<xsl:template match="article-meta/contrib-group | front/contrib-group | front-stub/contrib-group" mode="scimago-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="#ModalScimago{$id}">
SCIMAGO INSTITUTIONS RANKINGS
</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">
Expand Down Expand Up @@ -216,53 +234,23 @@
<xsl:template match="contrib-id[@contrib-id-type='researchid']" mode="url"
>http://www.researcherid.com/rid/</xsl:template>

<xsl:template match="aff//*" mode="insert-separator">
<xsl:apply-templates select="*|text()" mode="insert-separator"/>
<xsl:template match="aff" mode="insert-separator">
<xsl:apply-templates select="institution" mode="insert-separator"/>
<xsl:apply-templates select="addr-line/*" mode="insert-separator"/>
<xsl:apply-templates select="country" mode="insert-separator"/>
</xsl:template>

<xsl:template match="aff//text()" mode="insert-separator">
<xsl:value-of select="."/>,&#160; </xsl:template>
<xsl:template match="aff/institution" mode="insert-separator"><xsl:if test="position()!=1">, </xsl:if><xsl:value-of select="."/></xsl:template>

<xsl:template match="aff/*[position()=last()]/text()" mode="insert-separator">
<xsl:value-of select="."/>
</xsl:template>

<xsl:template match="aff/text()" mode="insert-separator">
<xsl:value-of select="."/>
</xsl:template>
<xsl:template match="aff/addr-line/* | aff/country" mode="insert-separator">, <xsl:value-of select="."/></xsl:template>

<xsl:template match="aff" mode="display">
<xsl:variable name="text"><xsl:apply-templates select="text()"/></xsl:variable>
<!--
<xsl:comment> $text: <xsl:value-of select="$text"/> </xsl:comment>
<xsl:comment> text(): <xsl:apply-templates select="text()"></xsl:apply-templates></xsl:comment>
-->
<xsl:choose>
<xsl:when test="institution[@content-type='original']">
<!--
<xsl:comment> aff original </xsl:comment>
-->
<xsl:apply-templates select="institution[@content-type='original']"/>
</xsl:when>
<xsl:when
test="institution[@content-type='orgname'] and contains($text,institution[@content-type='orgname'])">
<!--
<xsl:comment> $text </xsl:comment>
-->
<xsl:value-of select="$text"/>
</xsl:when>
<xsl:when
test="*[name()!='label']">
<!--
<xsl:comment> aff insert separator </xsl:comment>
-->
<xsl:apply-templates select="*[name()!='label']" mode="insert-separator"/>
</xsl:when>
<xsl:otherwise>
<!--
<xsl:comment> $text </xsl:comment>
-->
<xsl:value-of select="$text"/>
<xsl:apply-templates select="." mode="insert-separator"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@
</xsl:when>
<xsl:otherwise>
<!-- article -->
<xsl:apply-templates select=".//article-meta//related-article[@related-article-type!='preprint']" mode="article-meta-related-article-box-item"/>
<xsl:apply-templates select="body//related-article[@related-article-type!='preprint']" mode="article-meta-related-article-box-item"/>
<xsl:apply-templates select="front | body | back" mode="article-meta-related-article-box-item"/>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:if>
</xsl:template>

<xsl:template match="article/front | article/body | article/back" mode="article-meta-related-article-box-item">
<xsl:apply-templates select=".//related-article[@related-article-type!='preprint']" mode="article-meta-related-article-box-item"/>
</xsl:template>

<xsl:template match="related-article" mode="article-meta-related-article-box-item">
<xsl:apply-templates select="." mode="article-meta-related-article-message"/>
<div class="panel-body">
Expand Down
24 changes: 15 additions & 9 deletions packtools/catalogs/htmlgenerator/v2.0/article-text-graphic.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -129,29 +129,35 @@
<xsl:value-of select="@xlink:href"/>
</xsl:template>

<!-- ORIGINAL FILE LOCATION -->
<xsl:template match="*" mode="original-file-location">
<xsl:template match="table-wrap-group | fig-group" mode="original-file-location">
<!--
CAMINHO DO ARQUIVO DA IMAGEM ORIGINAL (TAMANHO MAIOR)
-->
<xsl:apply-templates select="*" mode="original-file-location"/>
<xsl:apply-templates select="table-wrap | fig" mode="original-file-location"/>
</xsl:template>

<xsl:template match="alternatives" mode="original-file-location">
<xsl:template match="table-wrap | fig | disp-formula" mode="original-file-location">
<!--
CAMINHO DO ARQUIVO DA IMAGEM ORIGINAL (TAMANHO MAIOR)
-->
<xsl:apply-templates select="*[@xlink:href!='' and not(@specific-use) and not(@content-type)][1]" mode="original-file-location"/>
<xsl:apply-templates select="alternatives | graphic" mode="original-file-location"/>
</xsl:template>

<xsl:template match="graphic | inline-graphic" mode="original-file-location">
<xsl:template match="alternatives" mode="original-file-location">
<!--
CAMINHO DO ARQUIVO DA IMAGEM ORIGINAL (TAMANHO MAIOR | TIFF)
CAMINHO DO ARQUIVO DA IMAGEM ORIGINAL (TAMANHO MAIOR)
-->
<xsl:apply-templates select="@xlink:href" mode="fix_extension"/>
<xsl:choose>
<xsl:when test="*[not(@content-type) and not(@specific-use) and @xlink:href!='']">
<xsl:apply-templates select="*[not(@content-type) and not(@specific-use) and @xlink:href!='']" mode="original-file-location"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="*[@xlink:href!=''][1]" mode="original-file-location"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="alternatives/graphic | alternatives/inline-graphic" mode="original-file-location">
<xsl:template match="graphic | inline-graphic" mode="original-file-location">
<!--
CAMINHO DO ARQUIVO DA IMAGEM ORIGINAL (TAMANHO MAIOR | TIFF)
-->
Expand Down
10 changes: 6 additions & 4 deletions packtools/catalogs/htmlgenerator/v2.0/config-labels.xml
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,15 @@
</term>
<term>
<name>About the authors</name>
<name lang="pt">Sobre os autores</name>
<name lang="es">Acerca de los autores</name>
<name lang="en">Authorship</name>
<name lang="pt">Autoria</name>
<name lang="es">Autoría</name>
</term>
<term>
<name>About the author</name>
<name lang="pt">Sobre o autor</name>
<name lang="es">Acerca del autor</name>
<name lang="en">Authorship</name>
<name lang="pt">Autoria</name>
<name lang="es">Autoría</name>
</term>
<term>
<name>About the reviewer</name>
Expand Down
93 changes: 64 additions & 29 deletions packtools/catalogs/htmlgenerator/v2.0/html-modals-contribs.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,38 @@
</div>
</div>
</div>
<xsl:apply-templates select="." mode="modal-scimago">
<xsl:with-param name="id" select="$id"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>

<xsl:template match="article-meta | front | front-stub" mode="modal-scimago">
<xsl:param name="id"/>
<!-- modal com as instituições scimago -->
<div class="modal fade ModalDefault ModalTutors" id="ModalScimago{$id}" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&#xd7;</span><span class="sr-only"><xsl:apply-templates select="." mode="interface">
<xsl:with-param name="text">Close</xsl:with-param>
</xsl:apply-templates></span></button>
<h4 class="modal-title">
SCIMAGO INSTITUTIONS RANKINGS
</h4>
</div>
<div class="modal-body">
<div class="info">
<xsl:apply-templates select="aff | contrib-group/aff" mode="modal-scimago"/>
<xsl:if test="not(aff) and not(contrib-group/aff) and ../@article-type='translation'">
<xsl:apply-templates select="$article//article-meta/front/aff | $article//article-meta/front/contrib-group/aff" mode="modal-scimago"/>
</xsl:if>
</div>
</div>
</div>
</div>
</div>
</xsl:template>

<xsl:template match="contrib" mode="modal-contrib-type">
<xsl:if test="@contrib-type!='author'">
Expand Down Expand Up @@ -98,8 +128,20 @@

<xsl:template match="aff" mode="modal-contrib">
<div>
<xsl:apply-templates select="." mode="display"/>
<xsl:apply-templates select="." mode="hidden-for-scimago"/>
<span data-aff-display="{@id}">
<xsl:apply-templates select="." mode="display"/>
</span>
<xsl:apply-templates select="." mode="hidden-for-scimago"/>
</div>
</xsl:template>

<xsl:template match="aff" mode="modal-scimago">
<div>
<span data-aff-display="{@id}">
<xsl:apply-templates select="." mode="display"/>
</span>
<xsl:apply-templates select="." mode="hidden-for-scimago"/>
<br/>
</div>
</xsl:template>

Expand All @@ -117,51 +159,44 @@
<xsl:apply-templates select="." mode="hidden-for-scimago-location"/>
</span>
<span data-aff-full="{@id}" hidden="">
<xsl:apply-templates select="." mode="hidden-for-scimago-orgname"/>, <xsl:apply-templates select="." mode="hidden-for-scimago-location"/>
<xsl:apply-templates select="." mode="display"/>
</span>
<a href="" class="scimago-link" data-scimago-link="{@id}"/>
</xsl:template>

<xsl:template match="aff" mode="hidden-for-scimago-orgname">
<xsl:variable name="text"><xsl:apply-templates select="text()"/></xsl:variable>
<!--
<xsl:comment> $text: <xsl:value-of select="$text"/> </xsl:comment>
<xsl:comment> text(): <xsl:apply-templates select="text()"></xsl:apply-templates></xsl:comment>
-->

<xsl:choose>
<xsl:when
test="institution[@content-type='orgname']">
<!--
<xsl:comment> $text </xsl:comment>
-->
<xsl:value-of select="institution[@content-type='orgname']"/>
</xsl:when>
<xsl:when test="institution[@content-type='original']">
<!--
<xsl:comment> aff original </xsl:comment>
-->
<xsl:apply-templates select="institution[@content-type='original']"/>
</xsl:when>
<xsl:when
test="*[name()!='label']">
<!--
<xsl:comment> aff insert separator </xsl:comment>
-->
<xsl:apply-templates select="*[name()!='label']" mode="insert-separator"/>
</xsl:when>
<xsl:otherwise>
<!--
<xsl:comment> $text </xsl:comment>
-->
<xsl:value-of select="$text"/>
<xsl:apply-templates select="institution" mode="insert-separator"/>
</xsl:otherwise>
</xsl:choose>

</xsl:choose>
</xsl:template>

<xsl:template match="aff" mode="hidden-for-scimago-location">
<xsl:apply-templates select=".//city | .//*[@content-type='city']"/>, <xsl:apply-templates select=".//state | .//*[@content-type='state']"/>, <xsl:apply-templates select=".//country"/>
<xsl:choose>
<xsl:when test=".//*[@content-type='city'] and .//*[@content-type='state']">
<xsl:apply-templates select=".//*[@content-type='city']"/>, <xsl:apply-templates select=".//*[@content-type='state']"/><xsl:if test="country">, </xsl:if><xsl:apply-templates select=".//country"/>
</xsl:when>
<xsl:when test=".//city and .//state">
<xsl:apply-templates select=".//city"/>, <xsl:apply-templates select=".//state"/><xsl:if test="country">, </xsl:if><xsl:apply-templates select=".//country"/>
</xsl:when>
<xsl:when test=".//*[@content-type='city'] or .//city">
<xsl:apply-templates select=".//*[@content-type='city']|.//city"/><xsl:if test="country">, </xsl:if><xsl:apply-templates select=".//country"/>
</xsl:when>
<xsl:when test=".//*[@content-type='state'] or .//state">
<xsl:apply-templates select=".//*[@content-type='state']|.//state"/><xsl:if test="country">, </xsl:if><xsl:apply-templates select=".//country"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select=".//country"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template match="contrib-id" mode="list-item">
Expand Down

0 comments on commit 779eb63

Please sign in to comment.