diff --git a/packtools/catalogs/htmlgenerator/v2.0/config-labels.xml b/packtools/catalogs/htmlgenerator/v2.0/config-labels.xml index 297d83c5b..cd988e69c 100644 --- a/packtools/catalogs/htmlgenerator/v2.0/config-labels.xml +++ b/packtools/catalogs/htmlgenerator/v2.0/config-labels.xml @@ -618,4 +618,89 @@ Navegação do artigo Navegación del artículo + + + author-notes-fn-edited-by + Edited by + Editado por + Editado por + + + author-notes-fn-corresp + Correspondence + Correspondência + Correspondencia + + + author-notes-fn-abbr + Abbreviations + Abreviações + Abreviaciones + + + author-notes-fn-con + Contributions + Contribuições + Contribuciones + + + author-notes-fn-coi-statement + Conflict of Interest + Conflito de Interesse + Conflicto de Interés + + + author-notes-fn-current-aff + Current Affiliation + Afiliação Atual + Afiliación Actual + + + author-notes-fn-deceased + Deceased + Falecido + Fallecido + + + author-notes-fn-equal + Equal Contribution + Contribuição Igualitária + Contribución Igualitaria + + + author-notes-fn-on-leave + On Leave + Em Licença + Con Licencia + + + author-notes-fn-participating-researchers + Researchers + Pesquisadores + Investigadores + + + author-notes-fn-previously-at + Previous Affiliation + Afiliação Anterior + Afiliación Anterior + + + author-notes-fn-study-group-members + Study Group + Grupo de Estudo + Grupo de Estudio + + + author-notes-fn-present-address + Present Address + Endereço Atual + Dirección Actual + + + author-notes-fn-presented-by + Presented by + Apresentado por + Presentado por + \ No newline at end of file diff --git a/packtools/catalogs/htmlgenerator/v3.0/article-meta-contrib.xsl b/packtools/catalogs/htmlgenerator/v3.0/article-meta-contrib.xsl index 3b535984e..a730e8d90 100644 --- a/packtools/catalogs/htmlgenerator/v3.0/article-meta-contrib.xsl +++ b/packtools/catalogs/htmlgenerator/v3.0/article-meta-contrib.xsl @@ -6,12 +6,23 @@ + scielo__contribGroup + + + + + + Author list + + + + @@ -40,10 +40,35 @@ - + author-notes-fn- + + + + + + + + + + + articleSection + + + author-notes-fn- + + + + + + + + + diff --git a/packtools/catalogs/htmlgenerator/v3.0/article.xsl b/packtools/catalogs/htmlgenerator/v3.0/article.xsl index 0b93d9d46..639739083 100644 --- a/packtools/catalogs/htmlgenerator/v3.0/article.xsl +++ b/packtools/catalogs/htmlgenerator/v3.0/article.xsl @@ -55,6 +55,7 @@ + @@ -62,6 +63,7 @@ + @@ -133,12 +135,13 @@ - + @@ -163,7 +166,9 @@ - + + + diff --git a/packtools/catalogs/htmlgenerator/v3.0/html-modals-contrib-group.xsl b/packtools/catalogs/htmlgenerator/v3.0/html-modals-contrib-group.xsl new file mode 100644 index 000000000..134b4019c --- /dev/null +++ b/packtools/catalogs/htmlgenerator/v3.0/html-modals-contrib-group.xsl @@ -0,0 +1,448 @@ + + + + + + + + + + + + + + + + + + + + + + About the authors + + + + + + Close + + + + + + + + + + + + + + + + + + + + + person + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + const MAX_VISIBLE_AUTHORS = 25; + const ALWAYS_VISIBLE_FIRST = 2; + const ALWAYS_VISIBLE_LAST = 1; + + const authorList = document.getElementById("authorList"); + + const authorModalElement = document.getElementById("ModalTutors"); + const authorCardsContainer = document.getElementById("authorCardsContainer"); + const correspondenceSection = document.getElementById("correspondenceSection"); + const correspondenceText = document.getElementById("correspondenceText"); + const correspondenceEmail = document.getElementById("correspondenceEmail"); + + const authorModal = authorModalElement + ? new bootstrap.Modal(authorModalElement) + : null; + + let expanded = false; + + + + + const affiliationMap = { + }; + + + + "": "", + + + , + + + + true + false + + + + ["", ] + + + + + + + + + + · + + + + + const authors = [ + + { + name: "", + affiliations: , + orcid: "", + email: "", + corresponding: , + roles: "" + }, + + ]; + + + + , + + + + + + + + function createAuthorButton(author, index) { + const button = document.createElement("button"); + + button.type = "button"; + button.className = "btn-link px-0"; + button.setAttribute("data-author-index", index); + button.setAttribute("aria-label", `Abrir detalhes de ${author.name}`); + + if (author.corresponding || author.email) { + const icon = document.createElement("span"); + + icon.className = "material-icons-outlined me-1 fs-6"; + icon.setAttribute("aria-hidden", "true"); + icon.textContent = "mail"; + + button.appendChild(icon); + } + + const name = document.createElement("span"); + name.textContent = author.name; + + button.appendChild(name); + + button.addEventListener("click", () => { + openAuthorModal(index); + }); + + return button; + } + + + + function appendAuthorItem(author, index, isLastVisibleItem) { + const li = document.createElement("li"); + + li.appendChild(createAuthorButton(author, index)); + + if (!isLastVisibleItem) { + const separator = document.createElement("span"); + separator.className = "author-separator"; + separator.setAttribute("aria-hidden", "true"); + separator.textContent = ","; + + li.appendChild(separator); + } + + authorList.appendChild(li); + } + + + + + function appendSummaryItem(hiddenCount, isLastItem = false) { + const li = document.createElement("li"); + + const button = document.createElement("button"); + button.type = "button"; + button.className = "btn btn-secondary btn-sm outlineFadeLink ms-0"; + + if (expanded) { + button.textContent = "Ocultar autores"; + button.setAttribute("aria-label", "Ocultar autores intermediários"); + button.setAttribute("aria-expanded", "true"); + } else { + button.textContent = `+ ${hiddenCount} autores`; + button.setAttribute("aria-label", `Mostrar os ${hiddenCount} autores ocultos`); + button.setAttribute("aria-expanded", "false"); + } + + button.addEventListener("click", () => { + expanded = !expanded; + renderAuthors(); + }); + + li.appendChild(button); + + if (!isLastItem) { + const separator = document.createElement("span"); + separator.className = "author-separator"; + separator.setAttribute("aria-hidden", "true"); + separator.textContent = ","; + + li.appendChild(separator); + } + + authorList.appendChild(li); + } + + + + + function renderAuthors() { + if (!authorList) return; + + authorList.innerHTML = ""; + + const total = authors.length; + const hiddenCount = total - (ALWAYS_VISIBLE_FIRST + ALWAYS_VISIBLE_LAST); + const canCollapse = total > MAX_VISIBLE_AUTHORS && hiddenCount > 0; + + if (!canCollapse) { + authors.forEach((author, index) => { + appendAuthorItem(author, index, index === total - 1); + }); + + return; + } + + if (expanded) { + authors.forEach((author, index) => { + appendAuthorItem(author, index, index === total - 1); + }); + + appendSummaryItem(hiddenCount, true); + return; + } + + const firstAuthors = authors.slice(0, ALWAYS_VISIBLE_FIRST); + const lastAuthors = authors.slice(total - ALWAYS_VISIBLE_LAST); + + firstAuthors.forEach((author, index) => { + appendAuthorItem(author, index, false); + }); + + appendSummaryItem(hiddenCount, false); + + lastAuthors.forEach((author, idx) => { + const realIndex = total - ALWAYS_VISIBLE_LAST + idx; + appendAuthorItem(author, realIndex, true); + }); + } + + + + + function buildInstitutionText(author) { + return author.affiliations + .map(code => affiliationMap[code] || `Afiliação ${code}`) + .join(" "); + } + + + + function buildAuthorCard(author) { + const card = document.createElement("div"); + card.className = "author-card"; + + const nameRow = document.createElement("div"); + nameRow.className = "author-grid-row"; + + const personIcon = document.createElement("span"); + personIcon.className = "material-icons-outlined"; + personIcon.setAttribute("aria-hidden", "true"); + personIcon.textContent = "person"; + + const nameWrapper = document.createElement("div"); + nameWrapper.className = "author-name"; + + const nameText = document.createElement("span"); + nameText.className = "author-name-text"; + nameText.textContent = author.name; + + nameWrapper.appendChild(nameText); + nameRow.appendChild(personIcon); + nameRow.appendChild(nameWrapper); + + card.appendChild(nameRow); + + const roles = document.createElement("div"); + roles.className = "author-roles author-subrow mb-2"; + roles.textContent = author.roles || "Sem funções informadas."; + + card.appendChild(roles); + + const institutionRow = document.createElement("div"); + institutionRow.className = "author-grid-row author-subrow mb-2"; + + const schoolIcon = document.createElement("span"); + schoolIcon.className = "material-icons-outlined"; + schoolIcon.setAttribute("aria-hidden", "true"); + schoolIcon.textContent = "school"; + + const institution = document.createElement("div"); + institution.className = "author-institution"; + + const institutionText = document.createElement("span"); + institutionText.className = "author-inst-text"; + institutionText.textContent = buildInstitutionText(author); + + institution.appendChild(institutionText); + institutionRow.appendChild(schoolIcon); + institutionRow.appendChild(institution); + + card.appendChild(institutionRow); + + if (author.orcid) { + const orcidWrap = document.createElement("div"); + orcidWrap.className = "orcid-button-wrap ms-4"; + + const orcidLink = document.createElement("a"); + orcidLink.target = "_blank"; + orcidLink.rel = "noopener noreferrer"; + orcidLink.className = "btn btn-secondary orcid-button"; + orcidLink.href = `https://orcid.org/${author.orcid}`; + orcidLink.textContent = author.orcid; + orcidLink.setAttribute( + "aria-label", + `Acessar perfil ORCID ${author.orcid}. Abre em nova aba.` + ); + + orcidWrap.appendChild(orcidLink); + card.appendChild(orcidWrap); + } + + return card; + } + + + + function openAuthorModal(index) { + if (!authorModal || !authorCardsContainer) return; + + const author = authors[index]; + + if (!author) return; + + authorCardsContainer.innerHTML = ""; + authorCardsContainer.appendChild(buildAuthorCard(author)); + + if (correspondenceSection){ + if (author.email) { + correspondenceSection.classList.remove("d-none"); + correspondenceText.textContent = `${author.name}. E-mail: `; + correspondenceEmail.href = `mailto:${author.email}`; + correspondenceEmail.textContent = author.email; + } else { + correspondenceSection.classList.add("d-none"); + correspondenceText.textContent = ""; + correspondenceEmail.removeAttribute("href"); + correspondenceEmail.textContent = ""; + } + } + + authorModal.show(); + } + + renderAuthors(); + + + \ No newline at end of file diff --git a/packtools/catalogs/htmlgenerator/v3.0/html-modals-contribs.xsl b/packtools/catalogs/htmlgenerator/v3.0/html-modals-contribs.xsl index ac5f35940..b6fff98a0 100644 --- a/packtools/catalogs/htmlgenerator/v3.0/html-modals-contribs.xsl +++ b/packtools/catalogs/htmlgenerator/v3.0/html-modals-contribs.xsl @@ -76,7 +76,7 @@ - SCIMAGO INSTITUTIONS RANKINGS + SCImago Institutions Rankings