{% load i18n %}

{% if product in products_for_comparison %}
<a class="btn btn-warning action-compare" href="{% url 'compare:remove_product' pk=product.pk %}">{% trans 'Remove from compare' %}</a>
{% else %}
<a class="btn btn-success action-compare" href="{% url 'compare:add_product' pk=product.pk %}">{% trans 'Add to compare' %}</a>
{% endif %}