{% from 'components/timestamp.html' import timestamp %} {% from 'components/links.html' import fancy_link %} {% from 'components/fancy_image.html' import fancy_image, background_image %} {% macro dm_card( dm, is_private=false, is_global=false, artist={}, class_name=none ) %} {% set service = g.paysites[dm.service] %} {% set artist_link = service.user.profile(dm.user) %} {% set user_link = g.freesites.kemono.user.profile(dm.service, dm.user) %}
{% if is_global %} {% if artist %}
{% call fancy_link(url=user_link, class_name="dm-card__icon") %} {{ fancy_image('/icons/' ~ artist.service ~ '/' ~ artist.id) }} {% endcall %} {% call fancy_link(url=user_link) %} {{ artist.name }} {% endcall %}
{% else %}
{% call fancy_link( url=user_link, class_name='dms__user-link' ) %} {{ dm.user }} ({{ service.title }}) {% endcall %}
{% endif %} {% endif %} {% if is_private %}
{% call fancy_link( url=artist_link, class_name='dms__user-link' ) %} {{ dm.user }} ({{ service.title }}) {% endcall %}
{% endif %}
{# writing it like this so there wouldn't be whitespaces/newlines in the output #}
{{ dm.content }}
{% endmacro %}