コード例 #1
0
def _get_api_version_to_paddle_versions(content_id):
    versions = sitemap_helper.get_available_versions(content_id)

    fluid_min_version = '0.12.0'
    v1v2_min_version = '0.9.0'  # TODO: Implement upper bounds for v1v2 once its deprecated

    api_version_to_paddle_version = [{
        'key':
        'fluid',
        'title':
        'Fluid',
        'versions': [
            v for v in versions
            if sitemap_helper.is_version_greater_eq(v, fluid_min_version)
        ]
    }, {
        'key':
        'v2/v1',
        'title':
        'V2/V1',
        'versions': [
            v for v in versions
            if sitemap_helper.is_version_greater_eq(v, v1v2_min_version)
        ]
    }]
    return api_version_to_paddle_version
コード例 #2
0
def version_links(context, content_id):
    versions = sitemap_helper.get_available_versions()

    is_hidden = True
    if context.template and content_id:
        is_hidden = False

    return _common_context(context, {
        'version_list': versions,
        'is_hidden': is_hidden
    })
コード例 #3
0
def version_links(context, content_id, category):
    if content_id == portal_helper.Content.DOCUMENTATION or \
                    content_id == portal_helper.Content.API:
        # API section needs to be additonally filtered by API Version
        versions = _get_api_version_to_paddle_versions(content_id)
    else:
        versions = [{
            "versions":
            sitemap_helper.get_available_versions(content_id)
        }]

    is_hidden = True
    if context.template and content_id:
        is_hidden = False

    return _common_context(context, {
        'versions': versions,
        'category': category,
        'is_hidden': is_hidden
    })