fix heading and page title for devhub apps pages (bug 701230)
This commit is contained in:
Родитель
d3d8c118f2
Коммит
71fc00bfac
|
@ -32,7 +32,7 @@ def dev_page_title(context, title=None, addon=None):
|
|||
else:
|
||||
devhub = _('Developer Hub')
|
||||
title = '%s :: %s' % (title, devhub) if title else devhub
|
||||
return page_title(context, title)
|
||||
return page_title(context, title, force_webapps=context.get('webapp'))
|
||||
|
||||
|
||||
@register.function
|
||||
|
|
|
@ -20,17 +20,27 @@
|
|||
|
||||
{% block site_header_title %}
|
||||
<h1 class="site-title prominent">
|
||||
<a title="{{ _('Return to the Add-on Developer Hub') }}"
|
||||
href="{{ url('devhub.index') }}">
|
||||
{# l10n: 'Developer Hub' is larger/emphasized and should appear in the <strong> tag' #}
|
||||
{{ _('<small>Add-on</small> Developer Hub')|safe }}
|
||||
<a href="{{ url('devhub.index') }}" title="{{ _('Return to the DevHub homepage') }}">
|
||||
{% if webapp %}
|
||||
Apps Developer Preview
|
||||
{% else %}
|
||||
{# L10n: Text in small tag is smaller and on its own line. #}
|
||||
{% trans %}
|
||||
<small>Add-on</small> Developer Hub
|
||||
{% endtrans %}
|
||||
{% endif %}
|
||||
</a>
|
||||
</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block aux_nav %}
|
||||
<li class="nomenu"><a class="return" href="{{ url('home') }}">
|
||||
{{ _('Back to Add-ons') }}</a></li>
|
||||
<li class="nomenu">
|
||||
{% if webapp %}
|
||||
<a class="return" href="{{ url('apps.home') }}">{{ _('Back to Apps') }}</a>
|
||||
{% else %}
|
||||
<a class="return" href="{{ url('home') }}">{{ _('Back to Add-ons') }}</a>
|
||||
{% endif %}
|
||||
</li>
|
||||
{% endblock %}
|
||||
|
||||
{% block navbar %}
|
||||
|
|
|
@ -27,9 +27,9 @@
|
|||
|
||||
{% block site_header_title %}
|
||||
<h1 class="site-title prominent">
|
||||
<a href="{{ url('devhub.index') }}" title="{{ _('Return to the DevHub homepage')|f(request.APP.pretty) }}">
|
||||
<a href="{{ url('devhub.index') }}" title="{{ _('Return to the DevHub homepage') }}">
|
||||
{% if webapp %}
|
||||
{% trans %}App Developer Preview{% endtrans %}
|
||||
Apps Developer Preview
|
||||
{% else %}
|
||||
{# L10n: Text in small tag is smaller and on its own line #}
|
||||
{% trans %}
|
||||
|
|
|
@ -149,8 +149,19 @@ class TestDashboard(HubTest):
|
|||
def setUp(self):
|
||||
super(TestDashboard, self).setUp()
|
||||
self.url = reverse('devhub.addons')
|
||||
self.apps_url = reverse('devhub.apps')
|
||||
eq_(self.client.get(self.url).status_code, 200)
|
||||
|
||||
def test_addons_page_title(self):
|
||||
eq_(pq(self.client.get(self.url).content)('title').text(),
|
||||
'Manage My Add-ons :: Developer Hub :: Add-ons for Firefox')
|
||||
|
||||
@mock.patch.object(settings, 'APP_PREVIEW', False)
|
||||
def test_apps_page_title(self):
|
||||
waffle.models.Flag.objects.create(name='accept-webapps', everyone=True)
|
||||
eq_(pq(self.client.get(self.apps_url).content)('title').text(),
|
||||
'Manage My Apps :: Developer Hub :: Apps Marketplace')
|
||||
|
||||
def get_action_links(self, addon_id):
|
||||
r = self.client.get(self.url)
|
||||
doc = pq(r.content)
|
||||
|
@ -216,7 +227,7 @@ class TestDashboard(HubTest):
|
|||
waffle.models.Flag.objects.create(name='accept-webapps', everyone=True)
|
||||
app = Addon.objects.get(id=self.clone_addon(1)[0])
|
||||
app.update(type=amo.ADDON_WEBAPP)
|
||||
doc = pq(self.client.get(reverse('devhub.apps')).content)
|
||||
doc = pq(self.client.get(self.apps_url).content)
|
||||
item = doc('.item[data-addonid=%s]' % app.id)
|
||||
assert item.find('p.downloads'), 'Expected weekly downloads'
|
||||
assert not item.find('p.users'), 'Unexpected ADU'
|
||||
|
@ -238,7 +249,7 @@ class TestDashboard(HubTest):
|
|||
waffle.models.Flag.objects.create(name='accept-webapps', everyone=True)
|
||||
app = Addon.objects.get(id=self.clone_addon(1)[0])
|
||||
app.update(type=amo.ADDON_WEBAPP, status=amo.STATUS_NULL)
|
||||
doc = pq(self.client.get(reverse('devhub.apps')).content)
|
||||
doc = pq(self.client.get(self.apps_url).content)
|
||||
assert doc('.item[data-addonid=%s] p.incomplete' % app.id), (
|
||||
'Expected message about incompleted add-on')
|
||||
|
||||
|
@ -2933,6 +2944,11 @@ class BaseWebAppTest(BaseUploadTest, UploadAddon, amo.tests.TestCase):
|
|||
|
||||
class TestCreateWebApp(BaseWebAppTest):
|
||||
|
||||
@mock.patch.object(settings, 'APP_PREVIEW', False)
|
||||
def test_page_title(self):
|
||||
eq_(pq(self.client.get(self.url).content)('title').text(),
|
||||
'Step 2 :: Developer Hub :: Apps Marketplace')
|
||||
|
||||
def test_post_app_redirect(self):
|
||||
r = self.post()
|
||||
addon = Addon.objects.get()
|
||||
|
|
|
@ -1,5 +1,19 @@
|
|||
@import 'lib';
|
||||
|
||||
.developer-hub #masthead .site-title {
|
||||
small, strong {
|
||||
display: block;
|
||||
}
|
||||
strong {
|
||||
font-size: 48px;
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.developer-hub #page #masthead .site-title {
|
||||
margin-top: -10px;
|
||||
}
|
||||
|
||||
.html-rtl.developer-hub {
|
||||
.menu-nav {
|
||||
margin-right: 0;
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
|
||||
.amo-header {
|
||||
font-family: @head-sans;
|
||||
margin-bottom: 35px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
#masthead {
|
||||
padding-top: 35px;
|
||||
padding-top: 45px;
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
|
|
|
@ -83,24 +83,10 @@ body {
|
|||
|
||||
.site-title {
|
||||
padding-top: 16px;
|
||||
max-width: 512px;
|
||||
max-width: 600px;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.developer-hub .site-title {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.developer-hub .site-title small {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.developer-hub .site-title strong {
|
||||
display: block;
|
||||
line-height: 40px;
|
||||
font-size: 48px;
|
||||
}
|
||||
|
||||
html[lang=it] .site-title a {
|
||||
font-size: 32px;
|
||||
}
|
||||
|
|
|
@ -63,9 +63,9 @@
|
|||
<div id="global-header-tab">
|
||||
<a href="http://mozilla.org/"><img src="{{ media('img/zamboni/mozilla-tab.png') }}"></a>
|
||||
</div>
|
||||
<div class="amo-header c">
|
||||
<nav id="aux-nav" role="navigation" class="menu-nav">
|
||||
<ul class="c">
|
||||
<div class="amo-header">
|
||||
<nav id="aux-nav" role="navigation" class="menu-nav c">
|
||||
<ul>
|
||||
{% if not settings.READ_ONLY %}
|
||||
{% include "impala/user_login.html" %}
|
||||
{% endif %}
|
||||
|
|
|
@ -55,8 +55,8 @@
|
|||
<a href="http://mozilla.org/"><img src="{{ media('img/zamboni/mozilla-tab.png') }}"></a>
|
||||
</div>
|
||||
<div class="amo-header">
|
||||
<nav id="aux-nav" role="navigation" class="menu-nav">
|
||||
<ul class="c">
|
||||
<nav id="aux-nav" role="navigation" class="menu-nav c">
|
||||
<ul>
|
||||
{% if not settings.READ_ONLY %}
|
||||
{% include "impala/user_login.html" %}
|
||||
{% endif %}
|
||||
|
|
Загрузка…
Ссылка в новой задаче