let /ecosystem/ become /developers/ (bug 756178)

This commit is contained in:
Chris Van 2012-06-04 22:19:59 -07:00
Родитель 1bafd46b55
Коммит a8e6a1f478
14 изменённых файлов: 59 добавлений и 44 удалений

Просмотреть файл

@ -120,4 +120,9 @@ z.page.on('fragmentloaded', function() {
$purchased.prepend(installed);
}
});
// Hijack external links if we're on mobile.
if (z.capabilities.touch) {
$('a[rel=external]').attr('target', '_blank');
}
});

Просмотреть файл

@ -63,7 +63,7 @@ def hub_breadcrumbs(context, addon=None, items=None, add_default=False):
"""
can_view = getattr(context['request'], 'can_view_consumer', True)
if can_view:
crumbs = [(reverse('mkt.developers.index'), _('Developers'))]
crumbs = [(reverse('ecosystem.landing'), _('Developers'))]
else:
crumbs = [(reverse('mkt.developers.apps'), _('My Submissions'))]
if can_view:

Просмотреть файл

@ -6,7 +6,7 @@
{% block content %}
{% set dst = request.GET.get('to') %}
{% if dst and dst not in (url('mkt.developers.index'), url('mkt.developers.apps')) %}
{% if dst and dst not in (url('ecosystem.landing'), url('mkt.developers.apps')) %}
<section class="notification-box error full">
<div>
{{ _('You must log in to access that page.') }}

Просмотреть файл

@ -64,7 +64,8 @@
</ul>
</nav>
{% block masthead %}
<h1><a href="{{ url('ecosystem.landing') }}">Mozilla Marketplace Developers</a></h1>
<h1><a href="{{ url('ecosystem.landing') }}">
{{ _('Mozilla Marketplace Developers') }}</a></h1>
{% endblock %}
</div>
{% block site_header_title %}

Просмотреть файл

@ -57,7 +57,7 @@ class TestNewDevBreadcrumbs(amo.tests.TestCase):
crumbs = pq(s)('li')
expected = [
('Home', reverse('home')),
('Developers', reverse('mkt.developers.index')),
('Developers', reverse('ecosystem.landing')),
('foo', '/foo'),
('bar', '/bar'),
]
@ -74,7 +74,7 @@ class TestNewDevBreadcrumbs(amo.tests.TestCase):
crumbs = pq(s)('li')
expected = [
('Home', reverse('home')),
('Developers', reverse('mkt.developers.index')),
('Developers', reverse('ecosystem.landing')),
('My Submissions', reverse('mkt.developers.apps')),
('Steamcube', None),
]
@ -95,7 +95,7 @@ class TestNewDevBreadcrumbs(amo.tests.TestCase):
crumbs = pq(s)('li')
expected = [
('Home', reverse('home')),
('Developers', reverse('mkt.developers.index')),
('Developers', reverse('ecosystem.landing')),
('My Submissions', reverse('mkt.developers.apps')),
('Steamcube', product.get_dev_url()),
('foo', '/foo'),

Просмотреть файл

@ -101,7 +101,7 @@ class TestAppBreadcrumbs(AppHubTest):
eq_(r.status_code, 200)
expected = [
('Home', reverse('home')),
('Developers', reverse('mkt.developers.index')),
('Developers', reverse('ecosystem.landing')),
('Submit App', None),
]
amo.tests.check_links(expected, pq(r.content)('#breadcrumbs li'))
@ -113,7 +113,7 @@ class TestAppBreadcrumbs(AppHubTest):
eq_(r.status_code, 200)
expected = [
('Home', reverse('home')),
('Developers', reverse('mkt.developers.index')),
('Developers', reverse('ecosystem.landing')),
('My Submissions', reverse('mkt.developers.apps')),
(unicode(webapp.name), None),
]

Просмотреть файл

@ -88,8 +88,6 @@ ajax_patterns = patterns('',
)
urlpatterns = decorate(write, patterns('',
url('^$', views.index, name='mkt.developers.index'),
# Redirect people who have /apps/ instead of /app/.
('^apps/\d+/.*',
lambda r: redirect(r.path.replace('addons', 'addon', 1))),

Просмотреть файл

@ -1065,6 +1065,6 @@ def docs(request, doc_name=None, doc_page=None):
filename = None
if not filename:
return redirect('mkt.developers.index')
return redirect('ecosystem.landing')
return jingo.render(request, 'developers/docs/%s' % filename)

Просмотреть файл

@ -1,20 +1,24 @@
<header id="site-header">
<section>
<div class="wrapper">
<h1><a href="{{ url('home') }}">{{ _('Mozilla Marketplace') }}</a></h1>
<h1><a href="{{ url('ecosystem.landing') }}">
{{ _('Mozilla Marketplace Developers') }}</a></h1>
<nav>
{#
<a href="{{ url('ecosystem.tutorial') }}">Tutorials</a>
#}
{% if not request.user.is_authenticated() %}
<a class="browserid" href="{{ url('users.login') }}?to={{ url('ecosystem.landing') }}">Log in / Register</a>
<a class="external" href="https://developer.mozilla.org/en-US/apps">Reference</a>
<a class="browserid" href="{{ url('users.login') }}?to={{ url('ecosystem.landing') }}">
{{ _('Log in / Register') }}</a>
<a class="external" href="https://developer.mozilla.org/en-US/apps">
{{ _('Reference') }}</a>
{% else %}
<a href="{{ url('submit.app') }}">Submit an App</a>
<a href="{{ url('mkt.developers.apps') }}">My Apps</a>
<a class="external" href="https://developer.mozilla.org/en-US/apps">Reference</a>
<a href="{{ url('users.logout') }}">Logout</a>
<a href="{{ url('submit.app') }}">
{{ _('Submit an App') }}</a>
<a href="{{ url('mkt.developers.apps') }}">{{ _('My Apps') }}</a>
<a class="external" href="https://developer.mozilla.org/en-US/apps">{{ _('Reference') }}</a>
<a href="{{ url('users.logout') }}">{{ _('Logout') }}</a>
{% endif %}
</nav>
</div>

Просмотреть файл

@ -6,7 +6,22 @@ from amo.urlresolvers import reverse
from mkt.ecosystem.models import MdnCache
class TutorialsHome(amo.tests.TestCase):
class TestLanding(amo.tests.TestCase):
def setUp(self):
self.url = reverse('ecosystem.landing')
def test_legacy_redirect(self):
r = self.client.get('/en-US/ecosystem/')
self.assertRedirects(r, '/en-US/developers/', 301)
def test_tutorials_default(self):
r = self.client.get(self.url)
eq_(r.status_code, 200)
self.assertTemplateUsed(r, 'ecosystem/landing.html')
class TestTutorialsHome(amo.tests.TestCase):
fixtures = ['ecosystem/mdncache-item']
def setUp(self):
@ -44,14 +59,3 @@ class TutorialsHome(amo.tests.TestCase):
r = self.client.get(self.url)
eq_(r.status_code, 200)
eq_(pq(r.content)('#nav strong').text(), 'pizza')
class LandingTests(amo.tests.TestCase):
def setUp(self):
self.url = reverse('ecosystem.landing')
def test_tutorials_default(self):
r = self.client.get(self.url)
eq_(r.status_code, 200)
self.assertTemplateUsed(r, 'ecosystem/landing.html')

Просмотреть файл

@ -37,11 +37,11 @@ def global_settings(request):
]
if '/developers/' not in request.path:
if amo_user.is_app_developer:
dev_url = reverse('mkt.developers.index')
tools_links.append({'text': _('My Submissions'),
'href': reverse('mkt.developers.apps')})
else:
dev_url = reverse('ecosystem.landing')
tools_links.append({'text': _('Developers'),
'href': dev_url})
tools_links.append({'text': _('Developers'),
'href': reverse('ecosystem.landing')})
if '/reviewers/' not in request.path and context['is_reviewer']:
tools_links.append({'text': _('Reviewer Tools'),
'href': reverse('reviewers.home')})

Просмотреть файл

@ -90,22 +90,24 @@ class TestFooter(amo.tests.TestCase):
fixtures = ['base/users', 'webapps/337141-steamcube']
def test_developers_links_to_dashboard(self):
# I've already submitted an app.
assert self.client.login(username='steamcube@mozilla.com',
password='password')
r = self.client.get(reverse('home'))
eq_(r.status_code, 200)
f = pq(r.content)('#site-footer')
eq_(f.find('a[href="%s"]' % reverse('mkt.developers.index')).length, 1)
eq_(f.find('a[href="%s"]' % reverse('ecosystem.landing')).length, 0)
links = pq(r.content)('#site-footer a[rel=external]')
eq_(links.length, 1)
eq_(links.attr('href'), reverse('mkt.developers.apps'))
def test_developers_links_to_landing(self):
# I've ain't got no apps.
assert self.client.login(username='regular@mozilla.com',
password='password')
r = self.client.get(reverse('home'))
eq_(r.status_code, 200)
f = pq(r.content)('#site-footer')
eq_(f.find('a[href="%s"]' % reverse('mkt.developers.index')).length, 0)
eq_(f.find('a[href="%s"]' % reverse('ecosystem.landing')).length, 1)
links = pq(r.content)('#site-footer a[rel=external]')
eq_(links.length, 1)
eq_(links.attr('href'), reverse('ecosystem.landing'))
def test_language_selector(self):
# TODO: Remove log-in bit when we remove `request.can_view_consumer`.

Просмотреть файл

@ -82,7 +82,7 @@
<nav class="footer-links">
{% if logged %}
{% for link in tools_links %}
<a href="{{ link.href }}">{{ link.text }}</a>
<a href="{{ link.href }}" rel="external">{{ link.text }}</a>
{% endfor %}
{% if request.can_view_consumer %}
<a href="{{ url('account.purchases') }}">

Просмотреть файл

@ -31,15 +31,16 @@ urlpatterns = patterns('',
# Browse pages.
('^apps/', include('mkt.browse.urls')),
# Dev Ecosystem
('^developers/', include('mkt.ecosystem.urls')),
('^ecosystem/', lambda r: redirect('ecosystem.landing', permanent=True)),
# Replace the "old" Developer Hub with the "new" Marketplace one.
('^developers/', include('mkt.developers.urls')),
# Submission.
('^developers/submit/app/', include('mkt.submit.urls')),
# Dev Ecosystem
('^ecosystem/', include('mkt.ecosystem.urls')),
# In-app payments.
('^inapp-pay/', include('mkt.inapp_pay.urls')),