switch the stats urls (bug 697474)
This commit is contained in:
Родитель
2d9b74c537
Коммит
034c3b4496
|
@ -83,8 +83,7 @@
|
|||
<strong class="downloads">{{
|
||||
addon.total_downloads|numberfmt }}</strong>
|
||||
{% if addon.public_stats %}
|
||||
{# TODO real reverse URL #}
|
||||
<a href="{{ locale_url('/statistics/addon/{0}'|f(addon.id)) }}">
|
||||
<a href="{{ url('stats.overview', addon.slug) }}">
|
||||
{{ _('View Statistics') }}</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
|
@ -96,8 +95,7 @@
|
|||
<strong class="downloads">{{
|
||||
addon.average_daily_users|numberfmt }}</strong>
|
||||
{% if addon.public_stats %}
|
||||
{# TODO real reverse URL #}
|
||||
<a href="{{ locale_url('/statistics/addon/{0}'|f(addon.id)) }}">
|
||||
<a href="{{ url('stats.overview', addon.slug) }}">
|
||||
{{ _('View Statistics') }}</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
|
|
|
@ -29,15 +29,13 @@
|
|||
{% set adu = addon.average_daily_users %}
|
||||
{% if adu %}
|
||||
<div id="daily-users">
|
||||
{% set stats = addon.public_stats %}
|
||||
{% if stats %}
|
||||
{# TODO real reverse URL #}
|
||||
<a class='stats' title='View statistics' href="{{ locale_url('/statistics/addon/{0}'|f(addon.id)) }}">
|
||||
{% endif %}
|
||||
{{ ngettext('{0} user', '{0} users', adu)|f(adu|numberfmt) }}
|
||||
{% if stats %}
|
||||
</a>
|
||||
{% endif %}
|
||||
{% with num_users = ngettext('{0} user', '{0} users', adu)|f(adu|numberfmt) %}
|
||||
{% if addon.public_stats %}
|
||||
<a class="stats" title="{{ _('View statistics') }}" href="{{ url('stats.overview', addon.slug) }}">{{ num_users }}</a>
|
||||
{% else %}
|
||||
{{ num_users }}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
@ -40,8 +40,7 @@
|
|||
{% endif %}
|
||||
{% if not addon.disabled_by_user %}
|
||||
<li>
|
||||
<a href="{{ locale_url('/statistics/addon/{0}')|f(addon.id) }}" class="tooltip"
|
||||
{# <a href="{{ url('stats.overview', addon.slug) }}" class="tooltip" #}
|
||||
<a href="{{ url('stats.overview', addon.slug) }}" class="tooltip"
|
||||
title="{{ _('Daily statistics on downloads and users.') }}">
|
||||
{{ _('Statistics') }}</a>
|
||||
</li>
|
||||
|
|
|
@ -19,8 +19,7 @@
|
|||
{{ _('View Add-on Listing') }}</a></li>
|
||||
<li><a href="{{ url('devhub.feed', addon.slug) }}">
|
||||
{{ _('View Recent Changes') }}</a></li>
|
||||
<li><a href="{{ locale_url('/statistics/addon/{0}')|f(addon.id) }}">
|
||||
{# <li><a href="{{ url('stats.overview', addon.slug) }}"> #}
|
||||
<li><a href="{{ url('stats.overview', addon.slug) }}">
|
||||
{{ _('View Statistics Dashboard') }}</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -5,7 +5,7 @@ import jinja2
|
|||
from jingo import register, env
|
||||
from tower import ugettext as _
|
||||
from access import acl
|
||||
from amo.helpers import locale_url
|
||||
from amo.urlresolvers import reverse
|
||||
|
||||
|
||||
@register.inclusion_tag('stats/report_menu.html')
|
||||
|
@ -73,10 +73,10 @@ def report_menu(context, request, addon, report):
|
|||
'title': _('Contributions')
|
||||
})
|
||||
|
||||
base_url = '/addon/%d/statistics' % (addon.id)
|
||||
base_url = reverse('stats.overview', args=[addon.slug])
|
||||
|
||||
"""Reports Menu. navigation for the various statistic reports."""
|
||||
c = {'report': report,
|
||||
'base_url': locale_url(base_url),
|
||||
'base_url': base_url,
|
||||
'report_tree': report_tree}
|
||||
return c
|
||||
|
|
|
@ -66,9 +66,6 @@ class DownloadCount(SearchMixin, models.Model):
|
|||
class Meta:
|
||||
db_table = 'download_counts'
|
||||
|
||||
def flush_urls(self):
|
||||
return ['*/addon/%d/statistics/downloads*' % self.addon_id, ]
|
||||
|
||||
|
||||
class UpdateCount(SearchMixin, models.Model):
|
||||
addon = models.ForeignKey('addons.Addon')
|
||||
|
@ -88,9 +85,6 @@ class UpdateCount(SearchMixin, models.Model):
|
|||
class Meta:
|
||||
db_table = 'update_counts'
|
||||
|
||||
def flush_urls(self):
|
||||
return ['*/addon/%d/statistics/usage*' % self.addon_id, ]
|
||||
|
||||
|
||||
class AddonShareCount(caching.base.CachingMixin, models.Model):
|
||||
addon = models.ForeignKey('addons.Addon')
|
||||
|
@ -184,9 +178,6 @@ class Contribution(caching.base.CachingMixin, models.Model):
|
|||
def __unicode__(self):
|
||||
return u'%s: %s' % (self.addon.name, self.amount)
|
||||
|
||||
def flush_urls(self):
|
||||
return ['*/addon/%d/statistics/contributions*' % self.addon_id, ]
|
||||
|
||||
@property
|
||||
def date(self):
|
||||
try:
|
||||
|
|
Загрузка…
Ссылка в новой задаче