|
{% 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 }}" role="group" aria-label="Reactions">
|
|
<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 }}" aria-label="React with {{ emoji }}" aria-pressed="{% if emoji in _mine %}true{% else %}false{% endif %}"{% if not _counts.get(emoji) and emoji not in _mine %} hidden{% endif %}{{ guest_disabled(user) }}>
|
|
<span class="reaction-emoji">{{ emoji }}</span>
|
|
<span class="reaction-count">{{ _counts.get(emoji, 0) }}</span>
|
|
</button>
|
|
{% endfor %}
|
|
</div>
|
|
<div class="reaction-add">
|
|
<button type="button" class="reaction-add-btn" aria-label="Add reaction" title="Add reaction" aria-expanded="false"{{ guest_disabled(user) }}><span class="reaction-add-icon">🙂</span><span class="reaction-add-label">React</span></button>
|
|
{% if user %}
|
|
<div class="reaction-palette" hidden>
|
|
{% for emoji in REACTION_EMOJI %}
|
|
<button type="button" class="reaction-palette-btn" data-reaction-emoji="{{ emoji }}" aria-label="React with {{ emoji }}">{{ emoji }}</button>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|