Files
slump-x-land-studio/templates/reaction-strip.html
T

9 lines
1.1 KiB
HTML

{% if group %}<div class="reaction-strip">
{% if user.is_authenticated %}<form method="post" action="{% url 'slx-react' group.kind group.pk %}" aria-label="{{ reaction_for|default:'React' }}">{% csrf_token %}
{% if request.resolver_match.url_name == 'chapter' %}<input type="hidden" name="surface" value="reader">{% endif %}
{% for option in group.options %}<button class="react-chip react-{{ option.icon }}" type="submit" name="value" value="{% if option.active %}0{% else %}{{ option.value }}{% endif %}" aria-pressed="{% if option.active %}true{% else %}false{% endif %}" aria-label="{{ option.label }}: {{ option.count }}{% if option.active %}, remove reaction{% endif %}" title="{{ option.label }}">
{% include 'reaction-icon.html' %}<span>{{ option.count }}</span></button>{% endfor %}
</form>{% else %}
<div class="reaction-totals" aria-label="Reaction totals">{% for option in group.options %}{% if option.count %}<span class="react-chip react-{{ option.icon }}" aria-label="{{ option.label }}: {{ option.count }}" title="{{ option.label }}">{% include 'reaction-icon.html' %}{{ option.count }}</span>{% endif %}{% endfor %}</div>
{% endif %}</div>{% endif %}