2021-08-23 20:02:27 +00:00
|
|
|
{% load i18n %}
|
|
|
|
{% load interaction %}
|
|
|
|
|
|
|
|
{% if request.user.is_authenticated %}
|
|
|
|
|
2021-08-23 22:07:38 +00:00
|
|
|
{% with request.user|saved:list as saved %}
|
2021-08-23 20:02:27 +00:00
|
|
|
<form
|
2021-08-23 22:07:38 +00:00
|
|
|
name="save-{{ list.id }}"
|
|
|
|
action="{% url 'list-save' list.id %}"
|
2021-08-23 20:02:27 +00:00
|
|
|
method="POST"
|
2021-08-23 22:07:38 +00:00
|
|
|
class="interaction save_{{ list.id }} {% if saved %}is-hidden{% endif %}"
|
|
|
|
data-id="save_{{ list.id }}"
|
2021-08-23 20:02:27 +00:00
|
|
|
>
|
|
|
|
{% csrf_token %}
|
2021-08-23 22:07:38 +00:00
|
|
|
{% trans "Save" as text %}
|
|
|
|
<button class="button" type="submit">
|
2021-08-23 20:02:27 +00:00
|
|
|
<span class="icon icon-bookmark m-0-mobile" title="{{ text }}"></span>
|
|
|
|
<span class="is-sr-only-mobile">{{ text }}</span>
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
<form
|
2021-08-23 22:07:38 +00:00
|
|
|
name="unsave-{{ list.id }}"
|
|
|
|
action="{% url 'list-unsave' list.id %}"
|
2021-08-23 20:02:27 +00:00
|
|
|
method="POST"
|
2021-08-23 22:07:38 +00:00
|
|
|
class="interaction save_{{ list.id }} active {% if not saved %}is-hidden{% endif %}"
|
|
|
|
data-id="save_{{ list.id }}"
|
2021-08-23 20:02:27 +00:00
|
|
|
>
|
|
|
|
{% csrf_token %}
|
2021-08-23 22:07:38 +00:00
|
|
|
{% trans "Un-save" as text %}
|
|
|
|
<button class="button" type="submit">
|
2021-08-23 20:02:27 +00:00
|
|
|
<span class="icon icon-bookmark m-0-mobile has-text-primary" title="{{ text }}"></span>
|
|
|
|
<span class="is-sr-only-mobile">{{ text }}</span>
|
|
|
|
</button>
|
|
|
|
</form>
|
|
|
|
{% endwith %}
|
|
|
|
|
|
|
|
{% endif %}
|
|
|
|
|