def latest_notes(request, product='firefox', platform=None, channel=None): if not platform: platform = 'desktop' if not channel: channel = 'release' if channel in ['aurora', 'developer']: channel = 'alpha' if channel == 'organizations': channel = 'esr' if product == 'thunderbird': version = thunderbird_desktop.latest_version(channel) elif platform == 'android': version = firefox_android.latest_version(channel) elif platform == 'ios': version = firefox_ios.latest_version(channel) else: version = firefox_desktop.latest_version(channel) if channel == 'beta': version = re.sub(r'b\d+$', 'beta', version) if channel == 'esr': version = re.sub(r'esr$', '', version) dir = 'auroranotes' if channel == 'alpha' else 'releasenotes' path = [product, version, dir] locale = getattr(request, 'locale', None) if product == 'firefox' and platform != 'desktop': path.insert(1, platform) if locale: path.insert(0, locale) return HttpResponseRedirect('/' + '/'.join(path) + '/')
def latest_sysreq(request, channel, product): if product == 'firefox' and channel == 'developer': channel = 'alpha' if channel == 'organizations': channel = 'esr' if product == 'thunderbird': version = thunderbird_desktop.latest_version(channel) elif product == 'mobile': version = firefox_android.latest_version(channel) elif product == 'ios': version = firefox_ios.latest_version(channel) else: version = firefox_desktop.latest_version(channel) if channel == 'beta': version = re.sub(r'b\d+$', 'beta', version) if channel == 'esr': version = re.sub(r'^(\d+).+', r'\1.0', version) dir = 'system-requirements' path = [product, version, dir] locale = getattr(request, 'locale', None) if locale: path.insert(0, locale) return HttpResponseRedirect('/' + '/'.join(path) + '/')
def latest_sysreq(request, channel, product): if product == 'firefox' and channel == 'developer': channel = 'alpha' if channel == 'organizations': channel = 'esr' if product == 'thunderbird': version = thunderbird_desktop.latest_version(channel) elif product == 'mobile': version = firefox_android.latest_version(channel) elif product == 'ios': version = firefox_ios.latest_version(channel) else: version = firefox_desktop.latest_version(channel) if channel == 'beta': version = re.sub(r'b\d+$', 'beta', version) if channel == 'esr': version = re.sub(r'^(\d+).+', r'\1.0', version) dir = 'system-requirements' path = [product, version, dir] locale = getattr(request, 'locale', None) if locale: path.insert(0, locale) return HttpResponseRedirect('/' + '/'.join(path) + '/')
def latest_notes(request, product='firefox', platform=None, channel=None): if not platform: platform = 'desktop' if not channel: channel = 'release' if channel in ['aurora', 'developer']: channel = 'alpha' if channel == 'organizations': channel = 'esr' if product == 'thunderbird': version = thunderbird_desktop.latest_version(channel) elif platform == 'android': version = firefox_android.latest_version(channel) elif platform == 'ios': version = firefox_ios.latest_version(channel) else: version = firefox_desktop.latest_version(channel) if channel == 'beta': version = re.sub(r'b\d+$', 'beta', version) if channel == 'esr': version = re.sub(r'esr$', '', version) dir = 'auroranotes' if channel == 'alpha' else 'releasenotes' path = [product, version, dir] locale = getattr(request, 'locale', None) if product == 'firefox' and platform != 'desktop': path.insert(1, platform) if locale: path.insert(0, locale) return HttpResponseRedirect('/' + '/'.join(path) + '/')
def all_downloads(request, channel): if channel is None: channel = 'release' if channel == 'earlybird': channel = 'alpha' version = thunderbird_desktop.latest_version(channel) query = request.GET.get('q') context = { 'platform': 'desktop', 'platforms': thunderbird_desktop.platforms(channel), 'full_builds_version': version.split('.', 1)[0], 'full_builds': thunderbird_desktop.get_filtered_full_builds(channel, version, query), 'query': query, 'channel': channel, 'channel_label': thunderbird_desktop.channel_labels.get(channel, 'Thunderbird'), } return l10n_utils.render(request, 'thunderbird/all.html', context)
def all_downloads(request, channel): if channel is None: channel = 'release' if channel == 'earlybird': channel = 'alpha' version = thunderbird_desktop.latest_version(channel) query = request.GET.get('q') context = { 'platform': 'desktop', 'platforms': thunderbird_desktop.platforms(channel), 'full_builds_version': version.split('.', 1)[0], 'full_builds': thunderbird_desktop.get_filtered_full_builds(channel, version, query), 'query': query, 'channel': channel, 'channel_label': thunderbird_desktop.channel_labels.get(channel, 'Thunderbird'), } return l10n_utils.render(request, 'thunderbird/all.html', context)
def all_downloads(request, channel): if channel is None: channel = 'release' if channel == 'earlybird': channel = 'alpha' version = thunderbird_desktop.latest_version(channel) query = request.GET.get('q') channel_names = { 'release': _('Thunderbird'), 'beta': _('Thunderbird Beta'), 'alpha': _('Earlybird'), } context = { 'full_builds_version': version.split('.', 1)[0], 'full_builds': thunderbird_desktop.get_filtered_full_builds(channel, version, query), 'query': query, 'channel': channel, 'channel_name': channel_names[channel] } return l10n_utils.render(request, 'thunderbird/all.html', context)