コード例 #1
0
def version_detail(context,
                   addon,
                   version,
                   src,
                   impala=False,
                   itemclass='item'):
    return new_context(**locals())
コード例 #2
0
ファイル: helpers.py プロジェクト: justinpotts/addons-server
def add_file_modal(context, title, action, action_label, modal_type='file'):
    addon = context['addon']
    upload_url = reverse('devhub.upload_for_addon', args=[addon.slug])
    return new_context(modal_type=modal_type,
                       context=context,
                       title=title,
                       action=action,
                       upload_url=upload_url,
                       action_label=action_label)
コード例 #3
0
ファイル: helpers.py プロジェクト: darktrojan/addons-server
def reviewers_score_bar(context, types=None, addon_type=None):
    user = context.get('user')

    return new_context(dict(
        request=context.get('request'),
        amo=amo, settings=settings,
        points=ReviewerScore.get_recent(user, addon_type=addon_type),
        total=ReviewerScore.get_total(user),
        **ReviewerScore.get_leaderboards(user, types=types,
                                         addon_type=addon_type)))
コード例 #4
0
def reviewers_score_bar(context, types=None, addon_type=None):
    user = context.get('user')

    return new_context(dict(
        request=context.get('request'),
        amo=amo, settings=settings,
        points=ReviewerScore.get_recent(user, addon_type=addon_type),
        total=ReviewerScore.get_total(user),
        **ReviewerScore.get_leaderboards(user, types=types,
                                         addon_type=addon_type)))
コード例 #5
0
def add_file_modal(context, title, action, action_label, modal_type='file'):
    addon = context['addon']
    version = context.get('version',
                          addon.find_latest_version_including_rejected())
    if version:
        channel = ('listed' if version.channel == amo.RELEASE_CHANNEL_LISTED
                   else 'unlisted')
    else:
        # short term fix - this function won't be used after new file upload.
        channel = 'listed' if addon.is_listed else 'unlisted'

    upload_url = reverse('devhub.upload_for_version',
                         args=[addon.slug, channel])
    return new_context(modal_type=modal_type, context=context, title=title,
                       action=action, upload_url=upload_url,
                       action_label=action_label)
コード例 #6
0
def add_file_modal(context, title, action, action_label, modal_type='file'):
    addon = context['addon']
    version = context.get('version',
                          addon.find_latest_version_including_rejected(None))
    if version:
        channel = ('listed' if version.channel == amo.RELEASE_CHANNEL_LISTED
                   else 'unlisted')
    else:
        # short term fix - this function won't be used after new file upload.
        channel = 'listed' if addon.is_listed else 'unlisted'

    upload_url = reverse('devhub.upload_for_version',
                         args=[addon.slug, channel])
    return new_context(modal_type=modal_type,
                       context=context,
                       title=title,
                       action=action,
                       upload_url=upload_url,
                       action_label=action_label)
コード例 #7
0
ファイル: helpers.py プロジェクト: darktrojan/addons-server
def all_distinct_files(context, version):
    """Only display a file once even if it's been uploaded
    for several platforms."""
    # hashes_to_file will group files per hash:
    # {<file.hash>: [<file>, 'Windows / Mac OS X']}
    hashes_to_file = {}
    for file_ in version.all_files:
        display_name = force_text(amo.PLATFORMS[file_.platform].name)
        if file_.hash in hashes_to_file:
            hashes_to_file[file_.hash][1] += ' / ' + display_name
        else:
            hashes_to_file[file_.hash] = [file_, display_name]
    return new_context(dict(
        # We don't need the hashes in the template.
        distinct_files=hashes_to_file.values(),
        amo=context.get('amo'),
        addon=context.get('addon'),
        show_diff=context.get('show_diff'),
        version=version))
コード例 #8
0
def all_distinct_files(context, version):
    """Only display a file once even if it's been uploaded
    for several platforms."""
    # hashes_to_file will group files per hash:
    # {<file.hash>: [<file>, 'Windows / Mac OS X']}
    hashes_to_file = {}
    for file_ in version.all_files:
        display_name = force_text(amo.PLATFORMS[file_.platform].name)
        if file_.hash in hashes_to_file:
            hashes_to_file[file_.hash][1] += ' / ' + display_name
        else:
            hashes_to_file[file_.hash] = [file_, display_name]
    return new_context(dict(
        # We don't need the hashes in the template.
        distinct_files=hashes_to_file.values(),
        amo=context.get('amo'),
        addon=context.get('addon'),
        show_diff=context.get('show_diff'),
        version=version))
コード例 #9
0
ファイル: helpers.py プロジェクト: Mritrocker96/addons-server
def add_file_modal(context, title, action, action_label, modal_type='file'):
    addon = context['addon']
    upload_url = reverse('devhub.upload_for_addon', args=[addon.slug])
    return new_context(modal_type=modal_type, context=context, title=title,
                       action=action, upload_url=upload_url,
                       action_label=action_label)
コード例 #10
0
ファイル: helpers.py プロジェクト: aelawson/addons-server
def collection_grid(context, collections, src=None, pagesize=4, cols=2):
    pages = chunked(collections, pagesize)
    columns = 'cols-%d' % cols
    return new_context(**locals())
コード例 #11
0
def collection_grid(context, collections, src=None, pagesize=4, cols=2):
    pages = chunked(collections, pagesize)
    columns = 'cols-%d' % cols
    return new_context(**locals())
コード例 #12
0
def mobile_version_detail(context, addon, version, src):
    return new_context(**locals())
コード例 #13
0
def dev_addon_listing_items(context, addons, src=None, notes=None):
    if notes is None:
        notes = {}
    return new_context(**locals())
コード例 #14
0
ファイル: helpers.py プロジェクト: Natim/addons-server
def version_detail(context, addon, version, src, impala=False,
                   skip_contrib=False, itemclass='item'):
    return new_context(**locals())
コード例 #15
0
ファイル: helpers.py プロジェクト: Natim/addons-server
def mobile_version_detail(context, addon, version, src):
    return new_context(**locals())
コード例 #16
0
def dev_addon_listing_items(context, addons, src=None, notes=None):
    if notes is None:
        notes = {}
    return new_context(**locals())
コード例 #17
0
ファイル: helpers.py プロジェクト: Mritrocker96/addons-server
def dev_addon_listing_items(context, addons, src=None, notes={}):
    return new_context(**locals())
コード例 #18
0
ファイル: helpers.py プロジェクト: justinpotts/addons-server
def dev_addon_listing_items(context, addons, src=None, notes={}):
    return new_context(**locals())