{% load humanize filters i18n %}

{% with wishes=topic.wish_collection %}
    <ul class="list-group mb-3{{ wishes|yesno:", dj-hidden" }}" id="wish-list">
        {% for wish in wishes %}
            <li class="list-group-item{% if user == wish.author %} owner{% endif %}">
                {% blocktrans trimmed with naturaltime=wish.date_created|naturaltime url=wish.author.get_absolute_url username=wish.author.username %}
                    the user <a href="{{ url }}">{{ username }}</a> wants this topic to be populated. it was wished {{ naturaltime }}.
                {% endblocktrans %}
                {% if wish.hint %}{% trans "hints:" %}<p class="m-0 p-0 text-formatted"><i>{{ wish.hint|formatted|linebreaksbr }}</i></p>{% endif %}
            </li>
        {% endfor %}
    </ul>
{% endwith %}


{% if user.is_authenticated %}
    <div class="wish" data-topic="{{ topic.title }}">
        <textarea class="form-control normalize dj-hidden" rows="3" placeholder="{% trans "hints (optional)" %}" aria-label="{% trans "Wish hint" %}"></textarea>
        <a role="button" tabindex="0" class="wish-send mr-2 fw-600 dj-hidden">{% trans "someone should populate this" %}</a>
        {% with wished=topic|wished_by:user %}
            <a role="button" tabindex="0" class="wish-purge{{ wished|yesno:', dj-hidden' }}">{% trans "remove the wish i asked" %}</a>
            <a role="button" tabindex="0" class="wish-prepare{{ wished|yesno:' dj-hidden,' }}">{% trans "someone should populate this" %}</a>
        {% endwith %}
    </div>
{% endif %}
