{% load humanize %} {% load i18n %}
{% if type == 'user' %}
{% if request.user.is_superuser %} {% include "accounts/_avatar.html" with user=share.user %} {% else %} {% include "accounts/_avatar.html" with user=share.user %} {% endif %}
{{ share.user.get_full_name }}
@{{ share.user.username }}
{% elif type == 'group' %}
{{ share.group.name }}
{{ share.group.user_set.count }} {% translate "users" %}
{% for user in share.group.user_set.all|dictsort:'username' %} {% if forloop.counter <= 14 %} {% if forloop.counter > 8 %} {% include "accounts/_avatar.html" with user=user classes="d-lg-inline d-none avatar-sm" tooltip_title=user.username %} {% else %} {% include "accounts/_avatar.html" with user=user classes="d-lg-inline avatar-sm" tooltip_title=user.username %} {% endif %} {% endif %} {% endfor %}
{% with share.group.user_set.count|add:"-12" as diff %} {% if diff > 0 %}
+ {{ diff }} {% translate "more" %}
{% endif %} {% endwith %}
{% endif %}
{% if share.grant_description %} 80 %} title="{{ share.grant_description }}" data-bs-toggle="tooltip" data-bs-placement="top"{% endif %}> {{ share.grant_description|truncatechars:80 }} {% endif %}
{% if share.is_expired %} {% comment %} This should only rarely be true, since all expired shares *should* be cleaned up immediately {% endcomment %} {% translate "Expired since" %} {{ share.granted_until|timesince }} {% elif share.granted_until %} {% translate "Expires in" %} {{ share.granted_until|timeuntil }} {% else %} {% translate "Permanent" %} {% endif %}
{% translate "Unknown" as unknown %} {% blocktranslate asvar share_meta with granted_by=share.granted_by|default_if_none:unknown granted_on=share.granted_on|date:"Y-m-d H:i:s e" %} Granted by: {{ granted_by }}
on {{ granted_on }} {% endblocktranslate %} {% if shareable %} {% endif %}