diff options
-rw-r--r-- | askbot/media/style/style.css | 11 | ||||
-rw-r--r-- | askbot/templates/badges.html | 17 | ||||
-rw-r--r-- | askbot/views/meta.py | 12 |
3 files changed, 19 insertions, 21 deletions
diff --git a/askbot/media/style/style.css b/askbot/media/style/style.css index b23526f5..3ca80614 100644 --- a/askbot/media/style/style.css +++ b/askbot/media/style/style.css @@ -213,6 +213,7 @@ body.user-messages { } .wait-icon-box { text-align: center; + margin-bottom: 8px; } #closeNotify { position: absolute; @@ -499,9 +500,6 @@ body.user-messages { text-align: center; padding-bottom: 10px; } -.search-drop-menu.empty { - padding-bottom: 8px; -} .search-drop-menu.empty ul { padding: 5px; margin: 0; @@ -536,6 +534,13 @@ input[type="submit"].searchBtn { height: 0; z-index: 0; } +.ask-page .search-drop-menu.empty { + border: none; + padding: 0; +} +.ask-page .search-drop-menu.empty ul { + padding: 0; +} .searchBtn:hover { background: -146px -36px url(../images/sprites.png) no-repeat; } diff --git a/askbot/templates/badges.html b/askbot/templates/badges.html index ce76e76b..e669b7d4 100644 --- a/askbot/templates/badges.html +++ b/askbot/templates/badges.html @@ -5,21 +5,16 @@ <h1 class="section-title">{% trans %}Badges{% endtrans %}</h1> <p> {% trans %}Community gives you awards for your questions, answers and votes.{% endtrans %}<br/> -{% trans %}Below is the list of available badges and number - of times each type of badge has been awarded. Have ideas about fun -badges? Please, give us your <a href='{{feedback_faq_url}}'>feedback</a> -{% endtrans %} +{% trans %}Below is the list of available badges and number of times each type of badge has been awarded.{% endtrans %} </p> <div id="medalList"> {% 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 %} - {% if a.badge_id == badge.id %} - <span style="font-size:175%; padding-right:5px; color:#5B9058;">✔</span> - {% endif %} - {% endfor %} - </div> + {% if badge.id in my_badge_ids %} + <div style="float:left;min-width:30px;text-align:right;height:30px"> + <span style="font-size:175%; padding-right:5px; color:#5B9058;">✔</span> + </div> + {% endif %} <div style="float:left;width:230px;"> <a href="{{badge.get_absolute_url()}}" title="{{badge.get_type_display()}} : {{badge.description}}" diff --git a/askbot/views/meta.py b/askbot/views/meta.py index d0c21965..092004e7 100644 --- a/askbot/views/meta.py +++ b/askbot/views/meta.py @@ -143,21 +143,19 @@ def badges(request):#user status/reputation system raise Http404 known_badges = badge_data.BADGES.keys() badges = BadgeData.objects.filter(slug__in = known_badges).order_by('slug') - my_badges = [] + my_badge_ids = list() if request.user.is_authenticated(): - my_badges = Award.objects.filter( + my_badge_ids = Award.objects.filter( user=request.user - ).values( - 'badge_id' + ).values_list( + 'badge_id', flat=True ).distinct() - #my_badges.query.group_by = ['badge_id'] data = { 'active_tab': 'badges', 'badges' : badges, 'page_class': 'meta', - 'mybadges' : my_badges, - 'feedback_faq_url' : reverse('feedback'), + 'my_badge_ids' : my_badge_ids } return render(request, 'badges.html', data) |