{% for badge in badges %}
<div style="clear:both;line-height:30px">
<div style="float:left;min-width:30px;text-align:right;height:30px">
- {% for a in mybadges %}
- {% ifequal a.badge_id badge.id %}
+ {% if badge.id in mybadges %}
<span style="font-size:175%; padding-right:5px; color:#5B9058;">✔</span>
- {% endifequal %}
- {% endfor %}
+ {% endif %}
</div>
<div style="float:left;width:230px;">
<a href="{{badge.get_absolute_url}}" title="{{ badge.get_type_display }} : {{ badge.description }}" class="medal"><span class="badge{{ badge.type }}">●</span> {{ badge.name }}</a><strong> × {{ badge.awarded_count|intcomma }}</strong>
badges = sorted([Badge.objects.get(id=id) for id in BadgesMeta.by_id.keys()], lambda b1, b2: cmp(b1.name, b2.name))
if request.user.is_authenticated():
- my_badges = Award.objects.filter(user=request.user).values('badge_id').distinct()
+ my_badges = Award.objects.filter(user=request.user).values_list('badge_id', flat=True).distinct()
else:
my_badges = []