{% extends "base.html" %}{% load i18n %}

{% block content %}

<div class="section">
  <div class="header">
    <h2>{% trans "Favourites" %}</h2>
  </div>
    
    <table class="content">
      <tbody>
        {% for favourite in favourites %}
        <tr>
          <td class="favourite-link"><a href="{{ favourite.url }}">{{ favourite.metadata.title|safe }}</a>
          {% if favourite.metadata.additional %}<br /><span class="additional">{{ favourite.metadata.additional|safe }}</span>{% endif %}</td>
          <td>
            <form action="{% url favourites:index %}" method="post">
                <input type="hidden" name="URL" value="{{ favourite.url|escape }}" />
                <input type="hidden" name="return_to_favourites" value="True" />
                {% csrf_token %}
                <input type="submit" name="unfavourite" value="{% trans "Unfavourite" %}" />
            </form>
          </td>
        </tr>
        {% empty %}
        <tr>
          <td colspan="2" class="center"><em>{% trans "You haven't favourited anything yet!" %}</em></td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
</div>

{% endblock %}