45 lines
2.3 KiB
Twig
45 lines
2.3 KiB
Twig
{% macro user_card(user, profile_url, rank_url, actions) %}
|
|
<div class="usercard" {% if user.user_colour is defined %}style="{{ user.user_colour|html_colour('--accent-colour') }}"{% endif %}>
|
|
<a href="{{ profile_url|default('/profile.php?u=%d')|format(user.user_id) }}"
|
|
class="usercard__background" title="{{ user.username }}"></a>
|
|
|
|
<div class="usercard__container">
|
|
<div class="usercard__main">
|
|
<div class="avatar usercard__avatar"
|
|
style="background-image:url('/profile.php?u={{ user.user_id }}&m=avatar')">
|
|
</div>
|
|
|
|
<div class="usercard__details">
|
|
<div class="usercard__name">
|
|
{{ user.username }}
|
|
</div>
|
|
|
|
<div class="usercard__info">
|
|
{% if user.user_country is defined %}
|
|
<div class="flag flag--{{ user.user_country|lower }} usercard__item usercard__item--country usercard__item--active" title="{{ user.user_country|country_name }}">
|
|
{{ user.user_country }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if user.user_title is defined %}
|
|
<a class="usercard__item usercard__item--title{% if user.role_id is defined %} usercard__item--active{% endif %}"{% if user.role_id is defined %} href="{{ rank_url|default('/members.php?r=%d')|format(user.role_id) }}"{% endif %} title="{{ user.user_title }}">
|
|
{{ user.user_title }}
|
|
</a>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% if actions is iterable %}
|
|
<div class="usercard__actions">
|
|
{% for action in actions %}
|
|
<a class="usercard__action"
|
|
{% if action.href is defined %}href="{{ action.href }}"{% endif %}
|
|
{% if action.onclick is defined %}onclick="{{ action.onclick }}"{% endif %}>
|
|
{{ action.text }}
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endmacro %}
|