{% import 'badger/includes/macros.html' as macros %}

{% set recent_awards = request.recent_badge_awards.get_queryset() %}

{% if recent_awards %}
    {% set award_ct = recent_awards | count %}
    <div id="badges-tray">
        {% set award_list = recent_awards[:5] %}
        <ul class="badge-list">
            {% for award in award_list %}
                <li class="badge-item"><a href="{{ award.get_absolute_url() }}">
                    {{ macros.badge_image(award.badge, MEDIA_URL) }}
                    <span class="badge-notify">{{ _("You've earned a badge!") }}</span>
                    <span class="badge-text">{{ award.badge.title }}</span>
                </a></li>
            {% endfor %}
        </ul>
    </div>
{% endif %}