Add ORCID to author search links in TOC when available via authors_meta#424
Add ORCID to author search links in TOC when available via authors_meta#424
Conversation
Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
opac/webapp/templates/issue/toc.html
Outdated
| {% if not loop.last %};{% endif %} | ||
| {% endif %} | ||
| {% endfor -%} | ||
| {%- if article.authors_meta %} |
There was a problem hiding this comment.
Refactored to use article.authors_meta or article.authors in a single loop, with author.name|default(author) to handle both object and string items. This eliminates the duplicated block. See ef7fcac.
Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Updates the Issue TOC author search links to include an author’s ORCID in the search.scielo.org query when article.authors_meta is available, while preserving the current fallback behavior to article.authors.
Changes:
- Update TOC template to iterate over
article.authors_meta or article.authorsand appendorcid:...to the search query when present. - Add interface tests covering (1)
authors_metawith ORCID and (2) fallback whenauthors_metais absent.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| opac/webapp/templates/issue/toc.html | Builds author search href using authors_meta when present and appends orcid:... for authors that have ORCID. |
| opac/tests/test_interface_TOC.py | Adds two TOC interface tests validating ORCID inclusion and fallback behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
opac/tests/test_interface_TOC.py
Outdated
| self.assertNotIn( | ||
| "orcid:", | ||
| response_data.split("Author Two")[1].split("</a>")[0], | ||
| ) |
| response_data = response.data.decode("utf-8") | ||
|
|
||
| self.assertIn("q=au:Simple Author", response_data) | ||
| self.assertNotIn("orcid:", response_data) |
|
@copilot corrigir o link considerando que o formato ideal é orcid:0000-0001-7639-2627 OR au:(Flores-Ortiz Renzo), sendo Flores-Ortiz o surname ou last name e Renzo o nome |
Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
Updated the search query format. When ORCID is available the URL now generates: Authors without ORCID keep the original format |
Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
|
@copilot notei que o link leva a uma outra aplicação perdendo o contexto onde o usuário estava, modifique para que o usuário possa permanecer na mesma página, mas ao mesmo tempo o usuário percebe que o link abriu a outra aplicação. |
Co-authored-by: robertatakenaka <505143+robertatakenaka@users.noreply.github.com>
Added |
O que esse PR faz?
No sumário (TOC), os links de busca dos autores no search.scielo.org agora incluem o ORCID quando disponível em
authors_meta.orpara selecionararticle.authors_meta or article.authorsem um único loop, eliminando duplicação de códigoauthors_metaestá presente e o autor possui ORCID, gera a query de busca no formatoorcid:ORCID OR au:(Nome)au:Nomearticle.authors(comportamento atual) quandoauthors_metanão está disponíveltarget="_blank"), mantendo o usuário na página do sumário enquanto a busca abre separadamentetarget="_blank"Exemplo de URL gerada (com ORCID):
Exemplo de URL gerada (sem ORCID):
Onde a revisão poderia começar?
opac/webapp/templates/issue/toc.html— bloco<!-- Autores -->(linha ~210).Como este poderia ser testado manualmente?
authors_metapopulado (incluindo ORCID)orcid:VALOR OR au:(NOME)na URL de buscaq=au:NOME)authors_metacontinuam usandoarticle.authorsnormalmenteAlgum cenário de contexto que queira dar?
O padrão segue o mesmo usado em
article/includes/meta.html: priorizaauthors_metaquando disponível, com fallback paraauthors. A estrutura deAuthorMetano schema (opac_schema) incluiname,affiliationeorcid. O template usaauthor.name|default(author)para extrair o nome tanto de objetosAuthorMetaquanto de strings simples, eauthor.orcid is defined and author.orcidpara verificar a presença do ORCID de forma segura. Os links usamtarget="_blank"para abrir em nova aba, evitando que o usuário perca o contexto da página atual.Screenshots
N/A — alteração apenas na URL do
hrefe adição detarget="_blank", sem mudança visual na página.Quais são tickets relevantes?
N/A
Referências
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.