mirror of
https://gitlab.unicamp.br/infimecc_drupal11_modules/site_users.git
synced 2026-05-03 21:50:40 -03:00
Adiciona links acadêmicos ao MicrositeHeaderBlock e formatadores de campo
- Formatadores FieldFormatter para Lattes, ORCID e MathSciNet: geram link para o perfil na plataforma a partir do ID armazenado no campo - MicrositeHeaderBlock: inclui lattes_id, orcid_id e mathscinet_id - Template: exibe ícones SVG via site_tools_academic_icon() (extensão Twig do módulo site_tools) com links acessíveis para cada plataforma - CSS: estilos para .msite-header-block__academic-links com animação de hover nos ícones Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -17,9 +17,12 @@ function site_users_microsite_theme(): array {
|
||||
'photo_url' => NULL,
|
||||
'photo_alt' => '',
|
||||
'name' => NULL,
|
||||
'bio' => NULL,
|
||||
'phone' => NULL,
|
||||
'email' => NULL,
|
||||
'bio' => NULL,
|
||||
'phone' => NULL,
|
||||
'email' => NULL,
|
||||
'lattes_id' => NULL,
|
||||
'orcid_id' => NULL,
|
||||
'mathscinet_id' => NULL,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
@@ -68,6 +68,9 @@ class MicrositeHeaderBlock extends BlockBase implements ContainerFactoryPluginIn
|
||||
'#bio' => $this->getProcessedValue($user, 'field_user_bio'),
|
||||
'#phone' => $this->getFieldValue($user, 'field_user_phone'),
|
||||
'#email' => $user->getEmail(),
|
||||
'#lattes_id' => $this->getFieldValue($user, 'field_user_id_lattes'),
|
||||
'#orcid_id' => $this->getFieldValue($user, 'field_user_orcid'),
|
||||
'#mathscinet_id' => $this->getFieldValue($user, 'field_user_mathscinetid'),
|
||||
'#cache' => [
|
||||
'tags' => $user->getCacheTags(),
|
||||
'contexts' => ['route'],
|
||||
|
||||
@@ -11,6 +11,9 @@
|
||||
* - bio: Biografia (string|null).
|
||||
* - phone: Telefone (string|null).
|
||||
* - email: E-mail (string|null).
|
||||
* - lattes_id: ID do Currículo Lattes (string|null).
|
||||
* - orcid_id: ORCID iD (string|null).
|
||||
* - mathscinet_id: MathSciNet Author ID (string|null).
|
||||
*/
|
||||
#}
|
||||
<div class="msite-header-block">
|
||||
@@ -54,6 +57,39 @@
|
||||
</ul>
|
||||
{% endif %}
|
||||
|
||||
{% if lattes_id or orcid_id or mathscinet_id %}
|
||||
<div class="msite-header-block__academic-links">
|
||||
|
||||
{% if lattes_id %}
|
||||
<a href="https://lattes.cnpq.br/{{ lattes_id }}"
|
||||
class="msite-header-block__academic-link msite-header-block__academic-link--lattes"
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
aria-label="{{ 'Currículo Lattes'|t }}">
|
||||
{{ site_tools_academic_icon('lattes') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if orcid_id %}
|
||||
<a href="https://orcid.org/{{ orcid_id }}"
|
||||
class="msite-header-block__academic-link msite-header-block__academic-link--orcid"
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
aria-label="{{ 'Perfil ORCID'|t }}">
|
||||
{{ site_tools_academic_icon('orcid') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
{% if mathscinet_id %}
|
||||
<a href="https://mathscinet.ams.org/mathscinet/author?AuthorID={{ mathscinet_id }}"
|
||||
class="msite-header-block__academic-link msite-header-block__academic-link--mathscinet"
|
||||
target="_blank" rel="noopener noreferrer"
|
||||
aria-label="{{ 'Perfil MathSciNet'|t }}">
|
||||
{{ site_tools_academic_icon('mathscinet') }}
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user