Files
website-v2/templates/partials/avatar.html

56 lines
2.0 KiB
HTML

{# Intended to be used with a django tag: avatar_tags.avatar #}
{% with av_size=av_size|default:"w-9 h-9" av_title=av_title|default:av_name %}
{% with av_alt=av_alt|default:av_name av_icon_size=av_icon_size|default:"text-3xl" %}
<div class="flex gap-x-2 items-center hover:bg-gray-100 dark:hover:bg-black rounded-lg">
<a {% if av_href and av_is_link %}href="{{ av_href }}"{% endif %}>
<div class="w-min text-center flex flex-col justify-center items-center">
<div
class="{{ av_size }} bg-gray-300 dark:bg-slate flex items-center justify-center relative rounded-lg"
title="{{ av_title }}">
{% if av_image_url %}
<img src="{{ av_image_url }}"
alt="{{ av_alt }}"
class="
rounded-lg h-full w-full object-cover mx-auto
"
/>
{% else %}
<i
class="
{{ av_icon_size }}
align-middle fas fa-user text-white dark:text-white/60
"
></i>
{% endif %}
</div>
</div>
</a>
{% if av_avatar_type == "wide" or av_avatar_type == "with_name" %}
<div class="flex flex-col leading-tight min-w-[15rem]">
<div class="text-black dark:text-white">
{{ av_name }}
</div>
{% if av_avatar_type == "wide" %}
<div
class="
text-sm
{% if av_contributor_label|lower == 'maintainer' %}
text-green font-medium
{% elif av_contributor_label|lower == 'author' %}
text-orange font-medium
{% elif av_contributor_label|lower == 'contributor - new' %}
text-gray-400 font-light
{% elif av_contributor_label|lower == 'contributor' %}
text-gray-400 font-light
{% endif %}
"
>
{{ av_contributor_label }}
</div>
{% endif %}
</div>
{% endif %}
</div>
{% endwith %}
{% endwith %}