in bedrock/firefox/views.py [0:0]
def get_template_names(self):
country = get_country_from_request(self.request)
locale = l10n_utils.get_locale(self.request)
version = self.kwargs.get("version") or ""
variant = self.request.GET.get("v", None)
nimbus_branch = self.request.GET.get("branch", None)
nimbus_variant = self.request.GET.get("variant", None)
# ensure variant matches pre-defined value
if variant not in self.variations:
variant = None
oldversion = self.request.GET.get("oldversion", "")
# old versions of Firefox sent a prefixed version
if oldversion.startswith("rv:"):
oldversion = oldversion[3:]
channel = detect_channel(version)
if channel == "nightly":
template = "firefox/nightly/whatsnew.html"
elif channel == "developer":
if show_57_dev_whatsnew(version):
template = "firefox/developer/whatsnew.html"
else:
template = "firefox/whatsnew/index.html"
elif channel == "beta":
if version.startswith("135."):
if locale.startswith("en-"):
template = "firefox/whatsnew/whatsnew-fx135beta.html"
else:
template = "firefox/whatsnew/index.html"
else:
template = "firefox/whatsnew/index.html"
elif version.startswith("138."):
if locale in ["en-US", "en-CA", "en-GB", "de", "fr"]:
template = "firefox/whatsnew/whatsnew-fx138-tab-groups.html"
else:
template = "firefox/whatsnew/index.html"
elif version.startswith("137."):
if locale in ["en-US", "en-CA", "en-GB", "de", "fr"]:
template = "firefox/whatsnew/whatsnew-fx137-vertical-tabs.html"
else:
template = "firefox/whatsnew/index.html"
elif version.startswith("136."):
if locale in ["de", "fr", "en-GB"]:
template = "firefox/whatsnew/whatsnew-fx136-eu-pip.html"
elif locale in ["en-US", "en-CA"]:
template = "firefox/whatsnew/whatsnew-fx136-na-pip.html"
else:
template = "firefox/whatsnew/index.html"
elif version.startswith("135."):
if locale in ["de", "fr", "en-GB"]:
template = "firefox/whatsnew/whatsnew-fx135-eu.html"
elif locale in ["en-US", "en-CA"]:
template = "firefox/whatsnew/whatsnew-fx135-na.html"
else:
template = "firefox/whatsnew/index.html"
elif version.startswith("134."):
if locale == "en-US":
template = "firefox/whatsnew/whatsnew-fx134-us.html"
elif locale == "en-CA":
template = "firefox/whatsnew/whatsnew-fx134-ca.html"
elif locale == "en-GB":
template = "firefox/whatsnew/whatsnew-fx134-gb.html"
elif locale == "de":
template = "firefox/whatsnew/whatsnew-fx134-de.html"
elif locale == "fr":
template = "firefox/whatsnew/whatsnew-fx134-fr.html"
else:
template = "firefox/whatsnew/index.html"
elif version.startswith("133."):
if locale in self.wnp_133_vpn_langs and country in settings.VPN_MOBILE_SUB_COUNTRY_CODES:
template = "firefox/whatsnew/whatsnew-fx133-vpn.html"
elif country in ["GB", "FR", "DE"] and locale in ["en-GB", "de", "fr"]:
if variant == "2" or variant == "3":
template = "firefox/whatsnew/whatsnew-fx133-donation-eu.html"
else:
template = "firefox/whatsnew/whatsnew-fx133-eu-newsletter.html"
elif country == "US" and locale in ["en-US", "en-CA"]:
if variant == "2" or variant == "3":
template = "firefox/whatsnew/whatsnew-fx133-donation-na.html"
else:
template = "firefox/whatsnew/whatsnew-fx133-na-fakespot.html"
elif country == "CA" and locale in ["en-US", "en-CA"]:
if variant == "2" or variant == "3":
template = "firefox/whatsnew/whatsnew-fx133-donation-na.html"
else:
template = "firefox/whatsnew/whatsnew-fx133-na-mobile.html"
elif locale in ["fr", "de", "it", "pl", "es-ES", "en-GB", "en-US", "en-CA"]:
template = "firefox/whatsnew/whatsnew-fx133-donation.html"
else:
template = "firefox/whatsnew/index.html"
elif version.startswith("132."):
if locale in ["en-US", "en-CA", "en-GB"]:
template = "firefox/whatsnew/whatsnew-fx132-na.html"
elif locale in ["de", "fr"]:
template = "firefox/whatsnew/whatsnew-fx132-eu.html"
else:
template = "firefox/whatsnew/index.html"
elif version.startswith("131."):
if locale in ["en-US", "en-CA"]:
if nimbus_variant == "v1":
template = "firefox/whatsnew/index.html"
else:
template = "firefox/whatsnew/whatsnew-fx131-na.html"
elif locale in ["en-GB", "de", "fr"]:
if nimbus_variant == "v1":
template = "firefox/whatsnew/index.html"
else:
template = "firefox/whatsnew/whatsnew-fx131-eu.html"
else:
template = "firefox/whatsnew/index.html"
elif version.startswith("130."):
if locale in ["en-US", "en-GB", "en-CA", "de", "fr", "es-ES", "it", "pl"]:
if nimbus_branch == "experiment-wnp-130-tabs":
if nimbus_variant == "v1":
template = "firefox/whatsnew/index.html"
else:
template = "firefox/whatsnew/whatsnew-fx130.html"
else:
template = "firefox/whatsnew/whatsnew-fx130.html"
else:
template = "firefox/whatsnew/index.html"
else:
template = "firefox/whatsnew/index.html"
# do not promote Mozilla VPN in excluded countries.
if country in settings.VPN_EXCLUDED_COUNTRY_CODES and template in self.vpn_excluded_templates:
template = "firefox/whatsnew/index.html"
# return a list to conform with original intention
return [template]