lostplaces-backend/django_lostplaces/lostplaces/templates/partials/icons/place_favorite.html

14 lines
532 B
HTML
Raw Normal View History

2020-12-24 16:43:14 +01:00
{%load static %}
{% load i18n %}
{% if request.user %}
{% if place in request.user.explorer.favorite_places.all %}
<a href="{% url 'place_unfavorite' place_id=place.id %}" class="LP-Link" title="{% trans 'Remove from favorites' %}">
2020-12-25 19:20:44 +01:00
<img class="LP-Icon" src="{% static '/icons/favorite_filled.svg' %}" />
2020-12-24 16:43:14 +01:00
</a>
{%else%}
<a href="{% url 'place_favorite' place_id=place.id %}" class="LP-Link" title="{% trans 'Save as favorite' %}">
2020-12-25 19:20:44 +01:00
<img class="LP-Icon" src="{% static '/icons/favorite.svg' %}" />
2020-12-24 16:43:14 +01:00
</a>
{% endif %}
{% endif %}