migrate /recommended to /featured bug 577350
This commit is contained in:
Родитель
0b4e569b58
Коммит
461626612b
|
@ -0,0 +1,19 @@
|
|||
{% extends "browse/base_listing.html" %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<div>
|
||||
{% trans %}
|
||||
With so many great add-ons available, there's something for everyone.
|
||||
To get you started, here's a list of some of the most popular. Enjoy!
|
||||
{% endtrans %}
|
||||
</div>
|
||||
|
||||
{% cache addons %}
|
||||
<div class="featured listing">
|
||||
<div class="featured-inner">
|
||||
{{ addon_listing_items(addons|list|shuffle) }}
|
||||
</div>
|
||||
</div>
|
||||
{% endcache %}
|
||||
{% endblock content %}
|
|
@ -249,3 +249,13 @@ class TestLegacyRedirects(test_utils.TestCase):
|
|||
redirects('/browse/type:4', '/search-tools/')
|
||||
redirects('/search-engines', '/search-tools/')
|
||||
# redirects('/browse/type:7', '/plugins/')
|
||||
redirects('/recommended', '/featured')
|
||||
|
||||
class TestFeaturedPage(amo.test_utils.ExtraSetup, test_utils.TestCase):
|
||||
fixtures = ['base/fixtures', 'addons/featured']
|
||||
|
||||
def test_featured_addons(self):
|
||||
"""Make sure that only featured add-ons are shown"""
|
||||
|
||||
response = self.client.get(reverse('browse.featured'))
|
||||
eq_([1003], [a.id for a in response.context['addons']])
|
||||
|
|
|
@ -7,6 +7,8 @@ urlpatterns = patterns('',
|
|||
url('^language-tools/(?P<category>[^/]+)?$', views.language_tools,
|
||||
name='browse.language-tools'),
|
||||
|
||||
url('^featured$', views.featured, name='browse.featured'),
|
||||
|
||||
url('^themes/(?P<category>[^/]+)?$', views.themes,
|
||||
name='browse.themes'),
|
||||
|
||||
|
|
|
@ -314,3 +314,7 @@ def search_tools(request, category=None):
|
|||
{'categories': categories, 'category': category,
|
||||
'addons': addons, 'filter': filter,
|
||||
'unreviewed': unreviewed})
|
||||
|
||||
def featured(request, category=None):
|
||||
addons = Addon.objects.featured(request.APP)
|
||||
return jingo.render(request, 'browse/featured.html', {'addons': addons})
|
||||
|
|
3
urls.py
3
urls.py
|
@ -99,6 +99,9 @@ urlpatterns = patterns('',
|
|||
('^addons/contribute/(\d+)/?$',
|
||||
lambda r, id: redirect('addons.contribute', id, permanent=True)),
|
||||
|
||||
('^recommended$',
|
||||
lambda r: redirect('browse.featured', permanent=True)),
|
||||
|
||||
)
|
||||
|
||||
if settings.DEBUG:
|
||||
|
|
Загрузка…
Ссылка в новой задаче