Permalink
Browse files

Prevent dashboard from displaying bad praise numbers (bug 663390)

  • Loading branch information...
1 parent bf59167 commit cf1bb5c6cf11aa47bde7c4a640cc2ac5a111cfb9 @tofumatt tofumatt committed Jun 10, 2011
@@ -49,7 +49,7 @@
</ul>
</div>
- {{ overview_block(sentiments) }}
+ {{ overview_block(sent) }}
{# TODO "URL provided?" filter #}
@@ -3,17 +3,19 @@ <h2><a class="toggle" href="#">{{ _('Type of Feedback') }}</a></h2>
<ul class="collapsee filters bars">
{% if not defaults['sentiment'] == 'sad' %}
- {% with sel = (defaults['sentiment'] == 'happy') %}
- {{ mobile_bar(name='sentiment', id='praise_bar', value='happy', selected=sel,
- count=sent.happy, total=sent.total, label=_('Praise')) }}
- {% endwith %}
+ {% with sel = (defaults['sentiment'] == 'happy') %}
+ {{ mobile_bar(name='sentiment', id='praise_bar', value='happy',
+ selected=sel, count=sent.happy, total=sent.total,
+ label=_('Praise')) }}
+ {% endwith %}
{% endif %}
{% if not defaults['sentiment'] == 'happy' %}
- {% with sel = (defaults['sentiment'] == 'sad') %}
- {{ mobile_bar(name='sentiment', id='issue_bar', value='sad', selected=sel,
- count=sent.sad, total=sent.total, label=_('Issues')) }}
- {% endwith %}
+ {% with sel = (defaults['sentiment'] == 'sad') %}
+ {{ mobile_bar(name='sentiment', id='issue_bar', value='sad',
+ selected=sel, count=sent.sad, total=sent.total,
+ label=_('Issues')) }}
+ {% endwith %}
{% endif %}
</ul>
</div>
View
@@ -66,7 +66,7 @@ def dashboard(request):
'opinion_count': total,
'product': prod,
'products': PROD_CHOICES,
- 'sentiments': get_sentiment(metas.get('type', [])),
+ 'sent': get_sentiment(metas.get('type', [])),
'locales': metas.get('locale'),
'platforms': metas.get('platform'),
'devices': metas.get('device'),
@@ -78,10 +78,10 @@
{{ platforms_block(demo.platform, opinion_count, defaults=defaults) }}
{% if product.short == 'mobile' %}
- {{ manufacturer_block(demo.manufacturer, total,
+ {{ manufacturer_block(demo.manufacturer, opinion_count,
defaults=defaults) }}
- {{ device_block(demo.device, total, defaults=defaults) }}
+ {{ device_block(demo.device, opinion_count, defaults=defaults) }}
{% endif %}
{{ locales_block(demo.locale, opinion_count, defaults=defaults) }}
View
@@ -183,7 +183,7 @@ def get_period(form):
@cache_page(use_get=True)
def index(request):
try:
- meta = ('_type', 'locale', 'platform', 'day_sentiment', 'manufacturer',
+ meta = ('type', 'locale', 'platform', 'day_sentiment', 'manufacturer',
'device')
(results, form, product, version, metas) = _get_results(
request, meta=meta)
@@ -218,7 +218,7 @@ def index(request):
data['page'] = pager.page(pager.num_pages)
data['opinions'] = data['page'].object_list
- data['sent'] = get_sentiment(metas.get('_type', {}))
+ data['sent'] = get_sentiment(metas.get('type', {}))
data['demo'] = dict(locale=metas.get('locale'),
platform=metas.get('platform'),
manufacturer=metas.get('manufacturer'),

0 comments on commit cf1bb5c

Please sign in to comment.