diff --git a/media/css/devreg/payments.styl b/media/css/devreg/payments.styl
index a63316c963..ea937476e3 100644
--- a/media/css/devreg/payments.styl
+++ b/media/css/devreg/payments.styl
@@ -437,7 +437,7 @@ label.disabled {
padding-bottom: 0;
}
-.regions {
+.devhub-form table .regions {
.region-heading {
display: block;
hidetext();
@@ -449,4 +449,25 @@ label.disabled {
td .local-retail {
display: block;
}
+ table td {
+ line-height: 1.5em;
+ min-height: 1.5em;
+ padding: 1em 0;
+ }
+}
+
+.paid-regions {
+ margin-bottom: 10px;
+}
+
+body > label {
+ font-weight: normal;
+}
+
+.note p:only-child {
+ margin-bottom: 1em;
+}
+
+.region-choices li {
+ min-height: 19px;
}
diff --git a/media/js/devreg/payments.js b/media/js/devreg/payments.js
index 397f31e908..5f36a04ff0 100644
--- a/media/js/devreg/payments.js
+++ b/media/js/devreg/payments.js
@@ -5,16 +5,18 @@ define('payments', [], function() {
var $regions = $('#region-list');
var $regionsIsland = $('#regions');
var $regionCheckboxes = $regions.find('input[type=checkbox]');
- var $regionsChangedWarning = $('#regions-changed');
- var $regionsInappropriateWarning = $('#regions-inappropriate');
- var $before = $regions.find('input[type=checkbox]:disabled');
- var apiErrorMsg = $regions.data('apiErrorMsg');
- var disabledGeneralRegions = $regions.data('disabledGeneralRegions');
- var tierZeroId = $regions.data('tierZeroId');
- var notApplicableMsg = $regions.data('notApplicableMsg');
- var paymentMethods = $regions.data('paymentMethods') || {};
- var pricesApiEndpoint = $regions.data('pricelistApiUrl') + '{0}/';
+ var regionsData = $regions.data();
+
+ var allPaidRegionIds = regionsData.allPaidRegionIds;
+ var apiErrorMsg = regionsData.apiErrorMsg;
+ var disabledRegions = regionsData.disabledRegions;
+ var tierZeroId = regionsData.tierZeroId;
+ var notApplicableMsg = regionsData.notApplicableMsg;
+ var paymentMethods = regionsData.paymentMethods || {};
+ var pricesApiEndpoint = regionsData.pricelistApiUrl + '{0}/';
+ var $tdNodes = $('
| | | ');
+ var $paidRegionTableTbody = $('#paid-regions tbody');
function getOverlay(opts) {
var id = opts;
@@ -83,6 +85,42 @@ define('payments', [], function() {
}));
}
+ function moveAnimate(element, newParent, $elmToRemove, zIndex) {
+ zIndex = zIndex || 100;
+ var $element = $(element);
+ var $newParent = $(newParent);
+ var oldOffset = $element.offset();
+
+ $element.appendTo($newParent);
+ var newOffset = $element.offset();
+ var $temp = $element.clone().appendTo('body');
+ $temp.css({'position': 'absolute',
+ 'left': oldOffset.left,
+ 'top': oldOffset.top,
+ 'zIndex': zIndex});
+
+ element.hide();
+ $temp.animate({'top': parseInt(newOffset.top, 10), 'left': parseInt(newOffset.left, 10) }, 'slow', function(){
+ $temp.remove();
+ $element.show();
+ if ($elmToRemove) {
+ $elmToRemove.hide(500, function() { this.remove(); });
+ }
+ });
+ }
+
+ function createTableRow(checkBox, ident, localPriceText, localMethodText) {
+ var $tds = $tdNodes.clone();
+ var $tr = $paidRegionTableTbody.find('tr[data-region="' + ident + '"]');
+ var $checkBoxContainer = $($tds[0]);
+ var $localPriceContainer = $($tds[1]);
+ var $localMethodContainer = $($tds[2]);
+ $localMethodContainer.text(localMethodText);
+ $localPriceContainer.text(localPriceText);
+ $tr.append($tds);
+ return $tr;
+ }
+
function disableCheckbox() {
/*jshint validthis:true */
var $this = $(this);
@@ -94,57 +132,14 @@ define('payments', [], function() {
$this.closest('tr').find('.local-retail, .local-method').text('');
}
- function compareDisabledCheckboxes($before) {
- var hasChanged = false;
- var $after = $regions.find('input[type=checkbox]:disabled');
- if ($before.length && $after.length && $before.length === $after.length) {
- $after.each(function() {
- // If current element isn't in $before the state has changed and we can
- // exit the each.
- var beforeIndex = $.inArray(this, $before);
- if (beforeIndex === -1) {
- hasChanged = true;
- return false;
- // As soon as a disabled prop doesn't match flag the change and exit each.
- } else if ($(this).prop('disabled') !== $($before[beforeIndex]).prop('disabled')) {
- hasChanged = true;
- return false;
- }
- });
- } else if (($before.length || $after.length) && $before.length !== $after.length) {
- hasChanged = true;
- }
- if (hasChanged) {
- $regionsChangedWarning.removeClass('hidden');
- } else {
- $regionsChangedWarning.addClass('hidden');
- }
- }
-
- function updatePrices(checkForChanges) {
+ function updatePrices() {
/*jshint validthis:true */
var $this = $(this);
var selectedPrice = $this.val();
- checkForChanges = checkForChanges === false ? checkForChanges : true;
-
- // Check for NaN which will be caused by selectedPrice being ''.
- if (selectedPrice != 'free') {
- selectedPrice = parseInt(selectedPrice, 10);
- selectedPrice = isNaN(selectedPrice) ? false : selectedPrice;
- }
-
- // No-op if nothing has changed.
- if (currentPrice === selectedPrice) {
- return;
- }
-
- // Handle the 'Please select a price' case.
- if (selectedPrice === false) {
- $regionCheckboxes.each(disableCheckbox);
- currentPrice = selectedPrice;
+ if (!selectedPrice) {
return;
}
@@ -154,73 +149,80 @@ define('payments', [], function() {
$('input[name=allow_inapp][value=True]').prop('checked', true);
$('input[name=allow_inapp][value=False]').prop('disabled', true)
.parent('label').hide();
-
- // Enable all the checkboxes save for those that should be disabled.
- // e.g. unrated games in Brazil.
- $regionCheckboxes.each(function() {
- $this = $(this);
- if (disabledGeneralRegions.indexOf(parseInt($this.prop('value'), 10)) === -1) {
- $this.prop('disabled', false).closest('label').removeClass('disabled')
- .closest('tr').find('.local-method, .local-retail')
- .text(notApplicableMsg);
- } else {
- disableCheckbox.call(this);
- }
- });
$('#paid-upsell-island').hide();
- currentPrice = selectedPrice;
- if (checkForChanges) {
- compareDisabledCheckboxes($before);
- }
- return;
+ // For free apps we are using the same data for tier zero apps
+ // to populate the region list.
+ selectedPrice = tierZeroId;
} else {
$('#paid-upsell-island').show();
$('input[name=allow_inapp][value=False]').prop('disabled', false)
.parent('label').show();
}
+ // From here on numbers should be used.
+ selectedPrice = parseInt(selectedPrice, 10);
+
+ // No-op if nothing else has changed.
+ if (currentPrice === selectedPrice) {
+ return;
+ }
+
$.ajax({
url: format(pricesApiEndpoint, selectedPrice),
beforeSend: function() {
$regionsIsland.addClass('loading');
},
success: function(data) {
+ var moveQueue = [];
var prices = data.prices || [];
- var tierPrice = data.price;
var seen = [];
+ var tierPrice = data.price;
+
// Iterate over the prices for the regions
for (var i=0, j=prices.length; i -1) {
- continue;
+ var localPrice = price.price + ' ' + price.currency;
+ var localMethod = selectedPrice === tierZeroId ? notApplicableMsg : billingMethodText;
+
+ // If the checkbox we're interested is already in the table just update it.
+ // Otherwise we need to create a new tableRow and move it into position.
+ var $chkbox = $regions.find('input:checkbox[value=' + regionId + ']');
+ var $row = $('#paid-regions tr[data-region=' + regionId + ']');
+ if ($row.find('td').length) {
+ $row.find('.lp').text(localPrice);
+ $row.find('.lm').text(localMethod);
+ } else {
+ var $tr = createTableRow($chkbox.closest('label'), regionId, localPrice, localMethod);
+ moveQueue.push([$chkbox.closest('label'), $tr.find('.cb')]);
+ $chkbox.closest('li').hide(500);
}
- // Enable checkboxes for those that we have price info for.
- $chkbox.prop('disabled', false)
- .closest('label').removeClass('disabled');
-
- var $tr = $chkbox.closest('tr');
-
- $tr.find('.local-retail')
- .text(price.price + ' ' + price.currency);
-
- $tr.find('.local-method')
- .text(selectedPrice === tierZeroId ? notApplicableMsg : billingMethodText);
-
seen.push($chkbox[0]);
-
}
- // Disable everything else.
- $regionCheckboxes.not(seen).each(disableCheckbox);
- if (checkForChanges) {
- compareDisabledCheckboxes($before);
+ for (var k=0, l=moveQueue.length; k -1],
key=lambda v: v.slug)
+
REGIONS_CHOICES_SLUG = ([('worldwide', WORLDWIDE)] +
[(v.slug, v) for v in BY_SLUG])
REGIONS_CHOICES_ID = ([(WORLDWIDE.id, WORLDWIDE)] +
[(v.id, v) for v in BY_SLUG])
-REGIONS_CHOICES_NAME = ([(WORLDWIDE.id, WORLDWIDE.name)] +
- [(v.id, v.name) for v in BY_SLUG])
+# Worldwide last here so we can display it after all the other regions.
+REGIONS_CHOICES_NAME = ([(v.id, v.name) for v in BY_SLUG] +
+ [(WORLDWIDE.id, WORLDWIDE.name)])
+
REGIONS_DICT = dict(REGIONS_CHOICES)
REGIONS_CHOICES_ID_DICT = dict(REGIONS_CHOICES_ID)
@@ -214,4 +217,9 @@ ALL_PAID_REGIONS = frozenset(r for r in ALL_REGIONS if r.has_payments)
ALL_REGION_IDS = sorted(REGIONS_CHOICES_ID_DICT.keys())
ALL_PAID_REGION_IDS = sorted(r.id for r in ALL_PAID_REGIONS)
+ALL_PAID_REGIONS_BY_SLUG = sorted(ALL_PAID_REGIONS,
+ key=lambda x: getattr(x, 'slug', None))
+ALL_PAID_REGION_IDS_BY_SLUG = [r.id for r in ALL_PAID_REGIONS_BY_SLUG]
+
+# Regions not including worldwide.
REGION_IDS = sorted(REGIONS_CHOICES_ID_DICT.keys())[1:]
diff --git a/mkt/developers/forms.py b/mkt/developers/forms.py
index e57b814f00..b7ffc4d47e 100644
--- a/mkt/developers/forms.py
+++ b/mkt/developers/forms.py
@@ -44,7 +44,6 @@ from mkt.constants import MAX_PACKAGED_APP_SIZE
from mkt.constants.ratingsbodies import (ALL_RATINGS, RATINGS_BODIES,
RATINGS_BY_NAME)
from mkt.site.forms import AddonChoiceField
-from mkt.regions import ALL_PAID_REGION_IDS, ALL_REGION_IDS
from mkt.webapps.models import AddonExcludedRegion, ContentRating, Webapp
from mkt.webapps.tasks import index_webapps
from mkt.zadmin.models import FeaturedApp
@@ -669,105 +668,44 @@ class AppAppealForm(happyforms.Form):
class RegionForm(forms.Form):
regions = forms.MultipleChoiceField(required=False,
label=_lazy(u'Choose the regions your app will be listed in:'),
- choices=mkt.regions.REGIONS_CHOICES_NAME[1:],
+ choices=mkt.regions.REGIONS_CHOICES_NAME,
widget=forms.CheckboxSelectMultiple,
error_messages={'required':
_lazy(u'You must select at least one region.')})
- other_regions = forms.BooleanField(required=False, initial=True,
- label=_lazy(u'Other and new regions'))
+ enable_new_regions = forms.BooleanField(required=False,
+ label=_lazy(u'Enable new regions'))
def __init__(self, *args, **kw):
self.product = kw.pop('product', None)
self.request = kw.pop('request', None)
- self.price = kw.pop('price', None)
- self.region_ids = self.product.get_region_ids()
+ self.region_ids = self.product.get_region_ids(worldwide=True)
super(RegionForm, self).__init__(*args, **kw)
- # Initialise the price for free_inapp.
- if not self.price and self.product and self.product.is_free_inapp():
- self.price = 'free'
-
- is_paid = self._product_is_paid()
-
# If we have excluded regions, uncheck those.
# Otherwise, default to everything checked.
- self.regions_before = self.product.get_region_ids()
+ self.regions_before = self.product.get_region_ids(worldwide=True)
# If we have future excluded regions, uncheck box.
- # Note: this is currently only relevant for non-paid apps.
- self.future_exclusions = self.product.addonexcludedregion.filter(
- region=mkt.regions.WORLDWIDE.id)
+ self.future_exclusions = self.product.enable_new_regions
self.initial = {
'regions': self.regions_before,
+ 'enable_new_regions': self.product.enable_new_regions,
}
- # If the app is paid, disable regions that use payments.
- if is_paid:
-
- # For paid apps enabling new regions is not based on the worldwide
- # region it's based on enable_new_regions.
- self.fields['other_regions'].label = _(u'Enable new regions')
- self.initial['other_regions'] = self.product.enable_new_regions
-
- # Premium form was valid.
- if self.price and self.price != 'free':
- self.price_region_ids = (self.price.pricecurrency_set
- .values_list('region', flat=True))
- # Free app with in-app payments for this we just want to make
- # sure it's in a region that allows payments.
- # self.price is intialised above for free_inapp even if
- # this isn't a post.
- elif self.price and self.price == 'free':
- self.price_region_ids = ALL_PAID_REGION_IDS
- # Premium form wasn't valid and it is a POST. Since we can't
- # determine what price they wanted, just make sure it isn't a
- # disabled price.
- elif self.data:
- self.price_region_ids = []
- # Not a post, we can trust the price on the product.
- else:
- self.price_region_ids = (self.product
- .get_possible_price_region_ids())
-
- else:
- # Set initial of other_regions for non-paid apps.
- self.initial['other_regions'] = (not
- self.future_exclusions.exists())
-
- # These are split out so we can distinguish regions that are totally
- # disabled vs those that are disabled based on price.
- self.disabled_general_regions = sorted(
- self._disabled_general_regions())
self.disabled_regions = sorted(self._disabled_regions())
def _disabled_regions(self):
- """All disabled regions (varys based on current price)."""
- return self._disabled_general_regions().union(
- self._disabled_paid_regions())
-
- def _disabled_general_regions(self):
- """Regions that are disabled for general reasons."""
- disabled_general_regions = set()
+ disabled_regions = set()
# Games cannot be listed in Brazil without a content rating.
games = Webapp.category('games')
if (games and
self.product.categories.filter(id=games.id).exists() and
not self.product.content_ratings_in(mkt.regions.BR)):
- disabled_general_regions.add(mkt.regions.BR.id)
+ disabled_regions.add(mkt.regions.BR.id)
- return disabled_general_regions
-
- def _disabled_paid_regions(self):
- """Regions disabled based on current price."""
- dpr = set()
- if self._product_is_paid():
- # Ensure price_regions are in ALL_PAID_REGION_IDS.
- valid_price_regions = (set(self.price_region_ids).intersection(
- set(ALL_PAID_REGION_IDS)))
- dpr = set(ALL_REGION_IDS).difference(valid_price_regions)
- return dpr
+ return disabled_regions
def is_toggling(self):
if not self.request or not hasattr(self.request, 'POST'):
@@ -779,29 +717,11 @@ class RegionForm(forms.Form):
return (self.product.premium_type in amo.ADDON_PREMIUMS
or self.product.premium_type == amo.ADDON_FREE_INAPP)
- def has_inappropriate_regions(self):
- """Returns whether the app is listed in regions that it shouldn't
- otherwise be registered in."""
-
- if self._product_is_paid():
- return set(self.region_ids).intersection(
- set(self.disabled_regions))
-
def clean(self):
data = self.cleaned_data
- if (not data.get('regions') and not data.get('other_regions')
- and not self.is_toggling()):
+ if (not data.get('regions') and not self.is_toggling()):
raise forms.ValidationError(
- _('You must select at least one region or '
- '"Other and new regions."'))
-
- if data.get('regions'):
- self.region_ids = [int(r) for r in data['regions']]
- if self.has_inappropriate_regions():
- raise forms.ValidationError(
- _('You have selected a region that is not valid for your '
- 'price point.'))
-
+ _('You must select at least one region.'))
return data
def save(self):
@@ -812,10 +732,6 @@ class RegionForm(forms.Form):
before = set(self.regions_before)
after = set(map(int, self.cleaned_data['regions']))
- # If the app is paid, disable regions that do not use payments.
- if self._product_is_paid():
- after &= set(self.price_region_ids)
-
# Add new region exclusions.
to_add = before - after
for r in to_add:
@@ -832,33 +748,14 @@ class RegionForm(forms.Form):
log.info(u'[Webapp:%s] No longer exluded from region (%s).'
% (self.product, r))
- if self.cleaned_data['other_regions']:
-
- # For a paid app enable_new_regions is distinct from
- # the worldwide region.
- if self._product_is_paid():
- self.product.update(enable_new_regions=True)
- log.info(u'[Webapp:%s] will be added to future regions.'
- % self.product)
- else:
- # Developer wants to be visible in future regions, then
- # delete excluded regions.
- self.future_exclusions.delete()
- log.info(u'[Webapp:%s] No longer excluded from future regions.'
+ if self.cleaned_data['enable_new_regions']:
+ self.product.update(enable_new_regions=True)
+ log.info(u'[Webapp:%s] will be added to future regions.'
% self.product)
else:
- if self._product_is_paid():
- self.product.update(enable_new_regions=False)
- log.info(u'[Webapp:%s] will not be added to future regions.'
+ self.product.update(enable_new_regions=False)
+ log.info(u'[Webapp:%s] will not be added to future regions.'
% self.product)
- else:
- # Developer does not want future regions, then
- # exclude all future apps.
- g, c = AddonExcludedRegion.objects.get_or_create(
- addon=self.product, region=mkt.regions.WORLDWIDE.id)
- if c:
- log.info(u'[Webapp:%s] Excluded from future regions.'
- % self.product)
ban_game_in_brazil(self.product)
diff --git a/mkt/developers/forms_payments.py b/mkt/developers/forms_payments.py
index 7432f376b1..77815fe880 100644
--- a/mkt/developers/forms_payments.py
+++ b/mkt/developers/forms_payments.py
@@ -104,7 +104,6 @@ class PremiumForm(DeviceTypeForm, happyforms.Form):
def group_tier_choices(self):
"""Creates tier choices with optgroups based on payment methods"""
price_choices = [
- ('', _('Please select a price')),
('free', _('Free (with in-app payments)')),
]
card_billed = []
diff --git a/mkt/developers/management/commands/check_paid_app_regions.py b/mkt/developers/management/commands/check_paid_app_regions.py
deleted file mode 100644
index e7f177b273..0000000000
--- a/mkt/developers/management/commands/check_paid_app_regions.py
+++ /dev/null
@@ -1,161 +0,0 @@
-from optparse import make_option
-
-from django.core.management.base import BaseCommand, CommandError
-
-import amo
-from mkt.developers.forms import RegionForm
-from mkt.regions import ALL_REGION_IDS, REGIONS_CHOICES_ID_DICT
-from mkt.webapps.models import AddonExcludedRegion as AER, Webapp
-
-ALL_REGIONS = set(ALL_REGION_IDS)
-DIVIDER = '-' * 28
-
-
-class Command(BaseCommand):
- args = ''
- option_list = BaseCommand.option_list + (
- make_option('--exclude_region_by_id', action='store',
- type='int', dest='exclude_region_id',
- help='Adds an exclusion record for a region by id'),
- make_option('--include_region_by_id', action='store',
- type='int', dest='include_region_id',
- help='Removes an exclusion record for a region by id'),
- )
- help = ('Check regions for a given paid app and flag if they have '
- 'incorrect regions.')
-
- def _region_obj(self, id_):
- return REGIONS_CHOICES_ID_DICT.get(id_)
-
- def _region_name(self, id_):
- region_obj_ = self._region_obj(id_)
- return unicode(region_obj_.name)
-
- def write_output(self, value=''):
- self.stdout.write(value + '\n')
-
- def write_error(self, value=''):
- self.stderr.write(value + '\n')
-
- def get_regions(self, app):
- region_excludes = (AER.objects.filter(addon=app)
- .values_list('region', flat=True))
- return ALL_REGIONS.difference(region_excludes)
-
- def get_bad_regions(self, app, regions):
- # Initialise RegionForm so we can get the disabled region data
- # based on our app.
-
- if app.premium_type == amo.ADDON_FREE_INAPP:
- price = 'free'
- else:
- price = app.premium.price
-
- region_form = RegionForm(data={'regions': regions},
- product=app, price=price)
-
- # We manually construct bad_regions so we can make sure we catch
- # worldwide regions (Worldwide is not a valid choice in the form).
- return regions.intersection(region_form.disabled_regions)
-
- def exclude_region(self, app, app_slug, exclude_region_id):
- aer, created = AER.objects.get_or_create(addon=app,
- region=exclude_region_id)
- if not created:
- self.write_error('Could not create exclusion record for '
- 'region_id %s (%s). It already exists' % (
- exclude_region_id,
- self._region_name(exclude_region_id)))
- else:
- self.write_output('')
- self.write_output("Excluding from region_id %s (%s) for "
- "app '%s'" % (exclude_region_id,
- self._region_name(exclude_region_id),
- app_slug))
- self.include_exclude_region = True
-
- def include_region(self, app, app_slug, include_region_id):
- self.write_output()
- self.write_output("Including from region_id %s (%s) for app "
- "'%s'" % (include_region_id,
- self._region_name(include_region_id),
- app_slug))
- try:
- aer = AER.objects.get(addon=app, region=include_region_id)
- aer.delete()
- self.include_exclude_region = True
- except AER.DoesNotExist:
- self.write_error('Could not remove exclusion record for '
- 'region_id %s (%s)' % (include_region_id,
- self._region_name(include_region_id)))
-
- def output_regions(self, app, app_slug):
- regions = self.get_regions(app)
- bad_regions = self.get_bad_regions(app, regions)
-
- self.write_output('App Slug: %s' % app_slug)
- self.write_output('App Status: %s' % unicode(
- amo.STATUS_CHOICES.get(app.status)))
- self.write_output('App Id: %s' % app.pk)
- self.write_output(DIVIDER)
- self.write_output('id | region.name')
- self.write_output(DIVIDER)
-
- has_bad_region = False
- for region_id in regions:
- region_name = self._region_name(region_id)
- asterisk = ''
- if region_id in bad_regions:
- has_bad_region = True
- asterisk = ' *'
-
- self.write_output('%s | %s%s' % (str(region_id).ljust(2),
- region_name, asterisk))
-
- if has_bad_region:
- self.write_output('* Inappropriate region')
-
- def handle(self, *args, **options):
- self.include_exclude_region = False
-
- if not args:
- raise CommandError('An app_slug is required.')
-
- if len(args) > 1:
- raise CommandError('Only a single app_slug is accepted.')
-
- app_slug = args[0]
-
- # Look up the app by slug.
- try:
- app = Webapp.objects.get(app_slug=app_slug,
- premium_type__in=amo.ADDON_HAS_PAYMENTS)
- except Webapp.DoesNotExist:
- raise CommandError('Paid app with slug %s not '
- 'found.' % app_slug)
-
- # Bail if the app doesn't have a price.
- if (app.premium_type != amo.ADDON_FREE_INAPP and
- not app.has_premium() and
- not getattr('app.premium', 'price', False)):
- raise CommandError("App %s doesn't have a price" % app_slug)
-
- # Outputs the region info.
- self.output_regions(app, app_slug)
-
- # Handle including a region by deleting an exlusion record for the app.
- include_region_id = options.get('include_region_id')
- if include_region_id:
- self.include_region(app, app_slug, include_region_id)
-
- # Handle an exclusions record by adding an exclusion record for
- # the app.
- exclude_region_id = options.get('exclude_region_id')
- if exclude_region_id:
- self.exclude_region(app, app_slug, exclude_region_id)
-
- # If we've include/excluded a region show the regions now.
- if self.include_exclude_region:
- self.write_output()
- self.write_output('Regions are now as follows:')
- self.output_regions(app, app_slug)
diff --git a/mkt/developers/templates/developers/payments/includes/region_form.html b/mkt/developers/templates/developers/payments/includes/region_form.html
new file mode 100644
index 0000000000..0b372409ca
--- /dev/null
+++ b/mkt/developers/templates/developers/payments/includes/region_form.html
@@ -0,0 +1,20 @@
+{{ region_form.regions.errors }}
+
+{% if region_form.disabled_regions %}
+ {% include 'developers/payments/includes/regions_disabled.html' %}
+{% endif %}
+
+ {% include 'developers/payments/includes/regions_other.html' %}
+
diff --git a/mkt/developers/templates/developers/payments/includes/regions_other.html b/mkt/developers/templates/developers/payments/includes/regions_other.html
index 82fe6ca4f0..8caa81b0dd 100644
--- a/mkt/developers/templates/developers/payments/includes/regions_other.html
+++ b/mkt/developers/templates/developers/payments/includes/regions_other.html
@@ -1,20 +1,10 @@
-{{ region_form.other_regions }}
-{{ region_form.other_regions.label_tag() }}
-{{ region_form.other_regions.errors }}
+{{ region_form.enable_new_regions }}
+{{ region_form.enable_new_regions.label_tag() }}
+{{ region_form.enable_new_regions.errors }}
- {% if region_form._product_is_paid() %}
- {%- trans %}
- Your app will be displayed in any regional Marketplace that is
- added in the future.
- You will receive an email notification when a new region
- is added.
- {% endtrans -%}
- {% else %}
- {%- trans %}
- Your app will be displayed in the worldwide Marketplace and
- in any regional Marketplace that is added in the future.
- You will receive an email notification when a new region
- is added.
- {% endtrans -%}
- {% endif %}
+ {{ _('Your app will be displayed in any regional Marketplace that is added in the future.')}}
+ {% if region_form._product_is_paid() %}
+ {{ _('(Subject to payments being available in that region for the selected price point).') }}
+ {% endif %}
+ {{ _('You will receive an email notification when a new region is added.') }}
diff --git a/mkt/developers/templates/developers/payments/premium.html b/mkt/developers/templates/developers/payments/premium.html
index 122628ca73..806a655ad9 100644
--- a/mkt/developers/templates/developers/payments/premium.html
+++ b/mkt/developers/templates/developers/payments/premium.html
@@ -144,17 +144,6 @@
{{ _('Prices and countries') }}
- {% if region_form.has_inappropriate_regions() %}
- {% include 'developers/payments/includes/regions_inappropriate.html' %}
- {% endif %}
-
-
- {%- trans %}
- Based on your chosen price point the available regions have been updated.
- Please check them prior to saving your changes.
- {% endtrans -%}
-
-
@@ -175,63 +164,57 @@
{{ form.allow_inapp }}
-
-
- {% include 'developers/payments/includes/regions_toggle.html' %}
- |
-
{{ region_form.regions.errors }}
-
-
-
- {{ _('Region') }} |
- {{ _('Retail price') }}
- ({{ _('local currency') }}) |
- {{ _('Billing method') }} |
-
-
-
- {% for value, text in region_form.regions.field.choices %}
- {% if value|int in mkt.regions.ALL_PAID_REGION_IDS %}
+
+ {% include 'developers/payments/includes/regions_toggle.html' %}
+
+
+ {{ _('Available Regions') }}
+
+ {{ _('Your app will be available in the following selected regions:') }}
+
+
+
+
+ {% for id in all_paid_region_ids_by_slug %}
+
+ {% endfor %}
+
+
+
+
+ {{ _("Other regions") }}
+
+
+ {% trans %}
+ Your app will be available in the following selected regions in the future when payments are available based on your chosen price point.
+ To exclude your app from appearing in a region please un-check that region before saving.
+ {% endtrans %}
+
+
+
+ {% include 'developers/payments/includes/region_form.html' %}
+
|
- {% if region_form.disabled_regions %}
-
-
- {% include 'developers/payments/includes/regions_disabled.html' %}
- |
-
- {% endif %}
-
-
- {% include 'developers/payments/includes/regions_other.html' %}
- |
-