mirror of
https://gitlab.unicamp.br/infimecc_drupal11_modules/site_users.git
synced 2026-04-27 03:41:56 -03:00
feat: Adiciona field type social_link para redes sociais do usuário
Implementa o field type 'social_link' com seletor de rede e URL de
perfil, composto por:
- SocialLinkItem: field type com colunas 'network' (varchar 64) e
'url' (varchar 2048), cardinalidade ilimitada
- SocialLinkWidget: widget com select de rede e input de URL
- SocialLinkFormatter: formatter que renderiza links com classe CSS
por rede (social-link--{network}), target _blank e rel noopener
- config/optional: field.storage e field.field para user
- config/translations/pt-br: tradução do label e description
- hook_install e update_10002: configura form/view displays
- UserInfoBlock: expõe social_links via getSocialLinks()
- Template: adiciona seção de redes sociais e remove referências
obsoletas a category e dept_code
- translations/site_users.pt-br.po: strings do novo field type
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
{#
|
||||
/**
|
||||
* @file
|
||||
* Template para o bloco de informações do usuário.
|
||||
* Template for the user information block.
|
||||
*
|
||||
* Variáveis disponíveis:
|
||||
* - user_info: Array com informações do usuário:
|
||||
* - uid: ID do usuário
|
||||
* - username: Nome de usuário (display name)
|
||||
* - name: Nome completo
|
||||
* - phone: Telefone
|
||||
* - category: Categoria
|
||||
* - dept_code: Código do departamento
|
||||
* - bio: Biografia
|
||||
* - photo_url: URL da foto padrão
|
||||
* - photo_alt: Texto alternativo da foto
|
||||
* - user: Entidade do usuário.
|
||||
* Available variables:
|
||||
* - user_info: Array with user information:
|
||||
* - uid: User ID
|
||||
* - username: Display name
|
||||
* - name: Full name
|
||||
* - phone: Phone number
|
||||
* - bio: Biography
|
||||
* - social_links: Array of social links, each with 'network' and 'url' keys
|
||||
* - photo_url: Default photo URL
|
||||
* - photo_alt: Photo alternative text
|
||||
* - user: User entity.
|
||||
*/
|
||||
#}
|
||||
<div class="site-user-info-block">
|
||||
@@ -35,22 +34,9 @@
|
||||
{{ user_info.name ?: user_info.username }}
|
||||
</h2>
|
||||
|
||||
{% if user_info.category %}
|
||||
<div class="site-user-info-block__category">
|
||||
{{ user_info.category }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if user_info.dept_code %}
|
||||
<div class="site-user-info-block__dept">
|
||||
<span class="site-user-info-block__label">{{ 'Departamento:'|t }}</span>
|
||||
{{ user_info.dept_code }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if user_info.phone %}
|
||||
<div class="site-user-info-block__phone">
|
||||
<span class="site-user-info-block__label">{{ 'Telefone:'|t }}</span>
|
||||
<span class="site-user-info-block__label">{{ 'Phone:'|t }}</span>
|
||||
<a href="tel:{{ user_info.phone }}">{{ user_info.phone }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
@@ -60,5 +46,18 @@
|
||||
{{ user_info.bio }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if user_info.social_links %}
|
||||
<div class="site-user-info-block__social-links">
|
||||
{% for link in user_info.social_links %}
|
||||
<a href="{{ link.url }}"
|
||||
class="social-link social-link--{{ link.network }}"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer">
|
||||
{{ link.network }}
|
||||
</a>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user