mirror of
https://github.com/tabler/tabler.git
synced 2025-12-26 11:16:12 +04:00
24 lines
1.5 KiB
HTML
24 lines
1.5 KiB
HTML
{% removeemptylines %}
|
|
{% assign src = include.src %}
|
|
{% assign placeholder = include.placeholder %}
|
|
{% if include.person-id %}
|
|
{% assign person = site.data.people | where: "id", include.person-id %}
|
|
{% assign src = person[0].photo %}
|
|
{% unless src %}
|
|
{% assign placeholder = person[0].full_name | first_letters %}
|
|
{% endunless %}
|
|
{% elsif include.person %}
|
|
{% assign person = include.person %}
|
|
{% assign src = person.photo %}
|
|
{% unless src %}
|
|
{% assign placeholder = person.full_name | first_letters %}
|
|
{% endunless %}
|
|
{% endif %}
|
|
{% assign link = include.link | default: false %}
|
|
{% assign el = 'span' %}
|
|
{% if link %}{% assign el = 'a' %}{% endif %}
|
|
<{{ el }} class="avatar{% if include['size'] %} avatar-{{ include['size'] }}{% endif %}{% if include.thumb %} avatar-thumb{% endif %}{% if include.class %} {{ include.class }}{% endif %}{% if include.shape %} {{ include.shape }}{% endif %}{% if include.color %} bg-{{ include.color }}-lt{% endif %}"{% if src %} style="background-image: url({{ site.base }}{{ src }})"{% endif %}>{% if include.status %}
|
|
<span class="badge bg-{{ include.status }}">{% if include.status-text %}{{ include.status-text }}{% elsif include.status-icon %}{% include ui/icon.html icon=include.status-icon class="avatar-status-icon" %}{% endif %}</span>
|
|
{% endif %}{% if placeholder %}{{ placeholder }}{% elsif include.icon %} {% include ui/icon.html icon=include.icon class="avatar-icon" %}{% endif %}</{{ el }}>
|
|
{% endremoveemptylines %}
|