diff --git a/media/css/devreg/login.less b/media/css/devreg/login.less index 8da89376b9..ef1683a7c1 100644 --- a/media/css/devreg/login.less +++ b/media/css/devreg/login.less @@ -167,3 +167,25 @@ text-align: right; padding-right: 120px; } + +.overlay#login { + font-family: @open-stack; + a { + display: inline; + &.button { + display: inline-block; + padding: 10px 15px; + } + } + h2 { + color: @teal; + font-weight: 600; + text-align: center; + } + p { + color: @medium-gray; + } + footer { + margin-top: 5px; + } +} diff --git a/media/css/mkt/login.less b/media/css/mkt/login.less index 250dc9549b..deeeff9e98 100644 --- a/media/css/mkt/login.less +++ b/media/css/mkt/login.less @@ -34,11 +34,18 @@ margin-bottom: 24px; } h1 { - font-size: 32px; - line-height: 34px; + font-size: 24px; + line-height: 26px; + margin-top: 30px; + } + .prose { + overflow: hidden; + } + .still-open a { + display: block; + font-weight: bold; } #welcome { - margin-top: 20px; min-height: 210px; position: relative; &:before { @@ -57,7 +64,6 @@ width: 40%; z-index: 1; .proceed { - margin: 0; } .forgot { margin: 5px 0 0; @@ -207,7 +213,6 @@ } #welcome { min-height: 230px; -// margin: 0 10px; padding: 0 15px; &:before { content: none; diff --git a/media/css/mkt/overlay.less b/media/css/mkt/overlay.less index af8fa622d0..386f93474f 100644 --- a/media/css/mkt/overlay.less +++ b/media/css/mkt/overlay.less @@ -60,7 +60,6 @@ footer { margin-top: 10px; backround-color: #ccc; - .grain; width: 100%; display: block; button { @@ -69,6 +68,18 @@ } } } + form { + margin: 0; + } + h2, .char-count { + margin-bottom: 10px; + } + .req-error { + float: left; + font-size: 13px; + line-height: 18px; + margin-top: 5px; + } } @media (max-width: @4col) { diff --git a/media/css/mkt/ratings.less b/media/css/mkt/ratings.less index a3281b8e12..d682ef9887 100644 --- a/media/css/mkt/ratings.less +++ b/media/css/mkt/ratings.less @@ -142,21 +142,6 @@ section.replies .review.reply { } } -.overlay { - form { - margin: 0; - } - h2, .char-count { - margin-bottom: 10px; - } - .req-error { - float: left; - font-size: 13px; - line-height: 18px; - margin-top: 5px; - } -} - header.product { margin-bottom: 15px; position: relative; diff --git a/media/css/mkt/site.less b/media/css/mkt/site.less index ab6100b9cd..a401d7598c 100644 --- a/media/css/mkt/site.less +++ b/media/css/mkt/site.less @@ -13,6 +13,11 @@ display: none; } +.emaillink-wrapper { + /* Necessary when emaillink is in a paragraph. */ + display: inline-block; +} + span.emaillink { direction: rtl; unicode-bidi: bidi-override; diff --git a/media/js/devreg/init.js b/media/js/devreg/init.js index ca3e21518a..c2b962cb8c 100644 --- a/media/js/devreg/init.js +++ b/media/js/devreg/init.js @@ -12,6 +12,12 @@ var z = { canInstallApps: true, }; +var data_user = $('body').data('user'); +_.extend(z, { + anonymous: data_user.anonymous, + pre_auth: data_user.pre_auth +}); + (function() { _.extend(z, {'nav': BrowserUtils()}); if (!z.nav.browser.firefox || z.nav.browser.mobile || diff --git a/media/js/devreg/submit-details.js b/media/js/devreg/submit.js similarity index 85% rename from media/js/devreg/submit-details.js rename to media/js/devreg/submit.js index f8fcae7bb6..73efb942c4 100644 --- a/media/js/devreg/submit-details.js +++ b/media/js/devreg/submit.js @@ -41,6 +41,17 @@ $(document).ready(function() { + + // Anonymous users can view the Developer Agreement page, + // and then we prompt for log in. + if (z.anonymous && $('#submit-terms').length) { + var $login = $('#login'); + $login.addClass('show'); + $('form').on('click', 'button', _pd(function() { + $login.addClass('show'); + })); + } + // Icon previews. imageStatus.start(true, false); $('#submit-media').bind('click', function() { diff --git a/mkt/asset_bundles.py b/mkt/asset_bundles.py index 4035b8a3bb..924f83c43f 100644 --- a/mkt/asset_bundles.py +++ b/mkt/asset_bundles.py @@ -61,6 +61,7 @@ CSS = { # Developer Log In / Registration. 'css/devreg/login.less', + 'css/mkt/login.less', # Footer. 'css/devreg/footer.less', @@ -195,7 +196,7 @@ JS = { # New stuff. 'js/devreg/devhub.js', - 'js/devreg/submit-details.js', + 'js/devreg/submit.js', 'js/devreg/edit.js', # Specific stuff for making payments nicer. diff --git a/mkt/developers/templates/developers/login.html b/mkt/developers/templates/developers/login.html index 84cd773f6c..dc732e26f7 100644 --- a/mkt/developers/templates/developers/login.html +++ b/mkt/developers/templates/developers/login.html @@ -17,14 +17,18 @@
-

Mozillian Preview

+

Check back soon!

- Our doors are now open for invited Mozillians to help test an early - preview of the Marketplace. We'll open for wider testing in just a - few months. + The Marketplace is currently only available to invited Mozillians. + If you're an active Mozilla contributor and would like access, please + send your vouched + mozillians.org + profile link to .

-

- If you've received an invitation, please log in below. +

Have an app to submit?

+

+ The Marketplace Developers site is still open. + Upload your app »

diff --git a/mkt/developers/templates/developers/skeleton_impala.html b/mkt/developers/templates/developers/skeleton_impala.html index ab626b714e..84d2e268d2 100644 --- a/mkt/developers/templates/developers/skeleton_impala.html +++ b/mkt/developers/templates/developers/skeleton_impala.html @@ -136,6 +136,18 @@ {% if not logged %}

+
+

{{ _('Please sign in') }}

+

+ {% trans url='https://persona.org/' %} + Just log in or register with your + Persona account below. + {% endtrans %} +

+ +

Additional authorization required

diff --git a/mkt/home/templates/home/home_walled.html b/mkt/home/templates/home/home_walled.html index 555f3bee7b..538b0b94c7 100644 --- a/mkt/home/templates/home/home_walled.html +++ b/mkt/home/templates/home/home_walled.html @@ -12,9 +12,9 @@ profile link to marketplace-testing@mozilla.org.

Have an app to submit?

-

+

The Marketplace Developers site is still open. - Upload your app » + Upload your app »

diff --git a/mkt/submit/tests/test_views.py b/mkt/submit/tests/test_views.py index bf06f17325..a79ef07f37 100644 --- a/mkt/submit/tests/test_views.py +++ b/mkt/submit/tests/test_views.py @@ -72,6 +72,27 @@ class TestSubmit(amo.tests.TestCase): unicode(mkt.APP_STEPS_TITLE[current])) +class TestProceed(TestSubmit): + fixtures = ['base/users'] + + def setUp(self): + super(TestProceed, self).setUp() + self.user.update(read_dev_agreement=None) + self.url = reverse('submit.app') + + def test_is_authenticated(self): + # Redirect user to Terms. + r = self.client.get(self.url) + self.assert3xx(r, reverse('submit.app.terms')) + + def test_is_anonymous(self): + # Show user to Terms page but with the login prompt. + self.client.logout() + r = self.client.get(self.url) + eq_(r.status_code, 200) + eq_(r.context['proceed'], True) + + class TestTerms(TestSubmit): fixtures = ['base/users'] diff --git a/mkt/submit/urls.py b/mkt/submit/urls.py index eeb3465d4d..aa9c76b39d 100644 --- a/mkt/submit/urls.py +++ b/mkt/submit/urls.py @@ -20,6 +20,7 @@ submit_apps_patterns = patterns('', urlpatterns = decorate(write, patterns('', # App submission. url('^$', views.submit, name='submit.app'), + url('^proceed$', views.proceed, name='submit.app.proceed'), url('^terms$', views.terms, name='submit.app.terms'), url('^choose$', views.choose, name='submit.app.choose'), url('^manifest$', views.manifest, name='submit.app.manifest'), diff --git a/mkt/submit/views.py b/mkt/submit/views.py index db8db7e955..e32fc128de 100644 --- a/mkt/submit/views.py +++ b/mkt/submit/views.py @@ -28,9 +28,10 @@ from .decorators import read_dev_agreement_required, submit_step log = commonware.log.getLogger('z.submit') -@login_required def submit(request): """Determine which step to redirect user to.""" + if not request.user.is_authenticated(): + return proceed(request) # If dev has already agreed, continue to next step. user = UserProfile.objects.get(pk=request.user.id) if user.read_dev_agreement: @@ -41,11 +42,28 @@ def submit(request): return redirect('submit.app.terms') +def proceed(request): + """ + This is a fake "Terms" view that we overlay the login. + We link here from the Developer Hub landing page. + """ + if request.user.is_authenticated(): + return submit(request) + agreement_form = forms.DevAgreementForm({'read_dev_agreement': True}, + instance=None) + return jingo.render(request, 'submit/terms.html', { + 'step': 'terms', + 'agreement_form': agreement_form, + 'proceed': True, + }) + + @login_required @submit_step('terms') def terms(request): # If dev has already agreed, continue to next step. - if request.amo_user.read_dev_agreement: + if (getattr(request, 'amo_user', None) and + request.amo_user.read_dev_agreement): if waffle.switch_is_active('allow-packaged-app-uploads'): return redirect('submit.app.choose') return redirect('submit.app.manifest') diff --git a/templates/impala/user_login.html b/templates/impala/user_login.html index a3a990a365..03f659a0d4 100644 --- a/templates/impala/user_login.html +++ b/templates/impala/user_login.html @@ -18,13 +18,10 @@ {% else %}