|
{% set _counts = (_reactions or {}).get('counts', {}) %}
|
|
{% set _mine = (_reactions or {}).get('mine', []) %}
|
|
{% if user or _counts %}
|
|
<div class="reaction-bar" data-reaction-type="{{ _type }}" data-reaction-uid="{{ _uid }}">
|
|
<div class="reaction-list">
|
|
{% for emoji in REACTION_EMOJI %}
|
|
<button type="button" class="reaction-chip{% if emoji in _mine %} reacted{% endif %}" data-reaction-emoji="{{ emoji }}"{% if not _counts.get(emoji) and emoji not in _mine %} hidden{% endif %}{% if not user %} disabled{% endif %}>
|
|
<span class="reaction-emoji">{{ emoji }}</span>
|
|
<span class="reaction-count">{{ _counts.get(emoji, 0) }}</span>
|
|
</button>
|
|
{% endfor %}
|
|
</div>
|
|
{% if user %}
|
|
<div class="reaction-add">
|
|
<button type="button" class="reaction-add-btn" aria-label="Add reaction" title="Add reaction"><span class="reaction-add-icon">🙂</span><span class="reaction-add-label">React</span></button>
|
|
<div class="reaction-palette" hidden>
|
|
{% for emoji in REACTION_EMOJI %}
|
|
<button type="button" class="reaction-palette-btn" data-reaction-emoji="{{ emoji }}">{{ emoji }}</button>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
{% endif %}
|