mirror of
https://github.com/tabler/tabler.git
synced 2025-12-22 01:44:25 +04:00
39 lines
1.8 KiB
HTML
39 lines
1.8 KiB
HTML
{%- assign src = include.src -%}
|
|
{%- assign placeholder = include.placeholder -%}
|
|
{%- if include.person-id -%}
|
|
{%- assign person-id = include.person-id | minus: 1 -%}
|
|
{%- assign person = people[person-id] -%}
|
|
{%- assign src = person.photo -%}
|
|
{%- unless src -%}
|
|
{%- assign placeholder = person.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 -%}
|
|
{%- if include.dropdown -%}
|
|
{%- assign link = true -%}
|
|
{%- endif -%}
|
|
{%- 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({{ page | relative }}/{{ src }})"{% endif %}{% if include.dropdown %} data-bs-toggle="dropdown"{% 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 include.brand -%}
|
|
<span class="avatar-brand" style="background-image: url({{ page | relative }}/static/brands/{{ include.brand }}.svg);"></span>
|
|
{%- endif -%}
|
|
{% if src %}
|
|
{% elsif placeholder %}
|
|
{{ placeholder }}
|
|
{% elsif include.icon %}
|
|
{% include "ui/icon.html" icon=include.icon class="avatar-icon" %}
|
|
{% else %}
|
|
{% include "ui/icon.html" icon="user" class="avatar-icon" %}
|
|
{% endif %}
|
|
</{{ el }}>
|