diff --git a/apps/amo/tests/__init__.py b/apps/amo/tests/__init__.py index 9403d6c0be..a85d739d5f 100644 --- a/apps/amo/tests/__init__.py +++ b/apps/amo/tests/__init__.py @@ -349,15 +349,21 @@ class TestCase(RedisTest, test_utils.TestCase): addon.update(premium_type=amo.ADDON_PREMIUM) AddonPremium.objects.create(addon=addon, price=price) - def create_sample(self, **kw): + def create_sample(self, name=None, **kw): + if name is not None: + kw['name'] = name kw.setdefault('percent', 100) Sample.objects.create(**kw) - def create_switch(self, **kw): + def create_switch(self, name=None, **kw): + if name is not None: + kw['name'] = name kw.setdefault('active', True) Switch.objects.create(**kw) - def create_flag(self, **kw): + def create_flag(self, name=None, **kw): + if name is not None: + kw['name'] = name kw.setdefault('everyone', True) Flag.objects.create(**kw) diff --git a/media/css/devreg/devhub-forms.less b/media/css/devreg/devhub-forms.less index bca4557d6b..5a70dac873 100644 --- a/media/css/devreg/devhub-forms.less +++ b/media/css/devreg/devhub-forms.less @@ -85,6 +85,7 @@ textarea { border: 1px solid #CCD6E3; padding: 15px; background: #E3EDFA; + line-height: 1.3; margin-bottom: 1em; form { line-height: 28px; @@ -93,11 +94,37 @@ textarea { } } p { - margin: .5em 0 0; + margin: 0; + + p { + margin-top: 10px; + } } b { color: #333; } + a { + font-weight: bold; + text-decoration: underline; + &:hover { + text-decoration: none; + } + } + &.error { + b, a { + color: @maroon; + } + a:hover { + color: darken(@maroon, 10%); + } + } + &.notice { + b, a { + color: @blue; + } + a:hover { + color: darken(@blue, 10%); + } + } h1 { color: maroon; font-size: 14px; diff --git a/media/css/devreg/lib.less b/media/css/devreg/lib.less index e28e00809f..a31be3ca69 100644 --- a/media/css/devreg/lib.less +++ b/media/css/devreg/lib.less @@ -9,6 +9,7 @@ @black: #000; @white: #fff; @red: #C63717; +@maroon: #800; @error-red: #C00000; @orange: #D16B00; @notice-yellow: #FAF2BD; diff --git a/mkt/developers/helpers.py b/mkt/developers/helpers.py index ba9c94b2ca..883791c70f 100644 --- a/mkt/developers/helpers.py +++ b/mkt/developers/helpers.py @@ -197,3 +197,13 @@ def display_url(url): bytes = urllib.unquote(url) c = chardet.detect(bytes) return bytes.decode(c['encoding'], 'replace') + + +@register.inclusion_tag('developers/helpers/disabled_payments_notice.html') +@jinja2.contextfunction +def disabled_payments_notice(context): + """ + If payments are disabled, we show a friendly message urging the developer + to make his/her app free. + """ + return {'request': context.get('request'), 'addon': context.get('addon')} diff --git a/mkt/developers/templates/developers/apps/listing/item_actions_app.html b/mkt/developers/templates/developers/apps/listing/item_actions_app.html index cc7b7ccfcb..839bbe4dcc 100644 --- a/mkt/developers/templates/developers/apps/listing/item_actions_app.html +++ b/mkt/developers/templates/developers/apps/listing/item_actions_app.html @@ -28,10 +28,17 @@
+ {% if request.path == addon.get_dev_url('payments') %} + {% set payments_url = '#payments-premium-type' %} + {% else %} + {% set payments_url = addon.get_dev_url('payments') + '#payments-premium-type' %} + {% endif %} + {% trans %} + Sorry, payments are currently disabled but are coming soon. + If you would like users to be able to install your app, please, + for the time being, make your app free. + You will be notified via email when payments are re-enabled. + Thanks for your patience. + {% endtrans %} +
+