add subnav link to Mobile Add-ons (bug 684928)
This commit is contained in:
Родитель
bfd2e2a5a3
Коммит
7ea3bb597d
|
@ -477,7 +477,7 @@ def _site_nav(context):
|
|||
groups = utils.sorted_groupby(qs, key=attrgetter('type'))
|
||||
cats = dict((key, sorted(cs, key=attrgetter('weight', 'name')))
|
||||
for key, cs in groups)
|
||||
ctx = dict(request=request,
|
||||
ctx = dict(request=request, amo=amo,
|
||||
extensions=cats.get(amo.ADDON_EXTENSION, []),
|
||||
personas=cats.get(amo.ADDON_PERSONA, []),
|
||||
themes=cats.get(amo.ADDON_THEME, []))
|
||||
|
|
|
@ -51,7 +51,11 @@
|
|||
<li id="more">
|
||||
<a href="#">{{ _('More…') }}</a>
|
||||
<ul>
|
||||
<li><a href="{{ url('browse.language-tools') }}">
|
||||
{% if request.APP == amo.FIREFOX %}
|
||||
<li class="more-mobile"><a href="{{ locale_url(amo.MOBILE.short) }}">
|
||||
{{ _('Add-ons for Mobile') }}</a></li>
|
||||
{% endif %}
|
||||
<li class="more-lang"><a href="{{ url('browse.language-tools') }}">
|
||||
{{ _('Dictionaries & Language Packs') }}</a></li>
|
||||
<li><a href="{{ url('home') + 'browse/type:7' }}">{{ _('Plugins') }}</a></li>
|
||||
<li><a href="{{ url('browse.search-tools') }}">{{ _('Search Tools') }}</a></li>
|
||||
|
|
|
@ -19,6 +19,7 @@ from waffle import helpers
|
|||
import amo.tests
|
||||
from access import acl
|
||||
from addons.models import Addon, AddonUser
|
||||
from amo.helpers import locale_url
|
||||
from amo.urlresolvers import reverse
|
||||
from amo.pyquery_wrapper import PyQuery
|
||||
from stats.models import SubscriptionEvent, Contribution
|
||||
|
@ -500,8 +501,18 @@ class TestOtherStuff(amo.tests.TestCase):
|
|||
|
||||
def test_dictionaries_link(self):
|
||||
doc = pq(test.Client().get('/', follow=True).content)
|
||||
link = doc('#site-nav #more a[href*="language-tools"]')
|
||||
eq_(link.text(), 'Dictionaries & Language Packs')
|
||||
eq_(doc('#site-nav #more .more-lang a').attr('href'),
|
||||
reverse('browse.language-tools'))
|
||||
|
||||
def test_mobile_link_firefox(self):
|
||||
doc = pq(test.Client().get('/firefox', follow=True).content)
|
||||
eq_(doc('#site-nav #more .more-mobile a').attr('href'),
|
||||
locale_url(amo.MOBILE.short))
|
||||
|
||||
def test_mobile_link_nonfirefox(self):
|
||||
for app in ('thunderbird', 'mobile'):
|
||||
doc = pq(test.Client().get('/' + app, follow=True).content)
|
||||
eq_(doc('#site-nav #more .more-mobile').length, 0)
|
||||
|
||||
def test_opensearch(self):
|
||||
client = test.Client()
|
||||
|
|
Загрузка…
Ссылка в новой задаче