예제 #1
0
def add_file_modal(context, title, action, upload_url, action_label):
    return new_context(modal_type='file',
                       context=context,
                       title=title,
                       action=action,
                       upload_url=upload_url,
                       action_label=action_label)
예제 #2
0
def version_detail(context,
                   addon,
                   version,
                   src,
                   show_versions_link=True,
                   itemclass='article'):
    return new_context(**locals())
예제 #3
0
def reviewers_score_bar(context):
    user = context.get('amo_user')

    return new_context(dict(
        amo=amo,
        points=ReviewerScore.get_recent(user),
        total=ReviewerScore.get_total(user),
        **ReviewerScore.get_leaderboards(user)))
예제 #4
0
def reviewers_score_bar(context):
    user = context.get('amo_user')

    return new_context(dict(
        amo=amo,
        points=ReviewerScore.get_recent(user),
        total=ReviewerScore.get_total(user),
        **ReviewerScore.get_leaderboards(user)))
예제 #5
0
파일: helpers.py 프로젝트: lauraxt/zamboni
def add_version_modal(context, title, action, upload_url, action_label):
    return new_context(
        modal_type="version",
        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']
    upload_url = reverse('devhub.upload_for_addon', args=[addon.slug])
    upload_url_unlisted = reverse('devhub.upload_for_addon_unlisted',
                                  args=[addon.slug])
    return new_context(modal_type=modal_type, context=context, title=title,
                       action=action, upload_url=upload_url,
                       upload_url_unlisted=upload_url_unlisted,
                       action_label=action_label)
예제 #7
0
def reviewers_score_bar(context, types=None):
    user = context.get('amo_user')

    return new_context(dict(
        request=context.get('request'),
        amo=amo, settings=settings,
        points=ReviewerScore.get_recent(user),
        total=ReviewerScore.get_total(user),
        **ReviewerScore.get_leaderboards(user, types=types)))
예제 #8
0
def reviewers_score_bar(context, types=None):
    user = context.get('amo_user')

    return new_context(
        dict(request=context.get('request'),
             amo=amo,
             settings=settings,
             points=ReviewerScore.get_recent(user),
             total=ReviewerScore.get_total(user),
             **ReviewerScore.get_leaderboards(user, types=types)))
예제 #9
0
파일: helpers.py 프로젝트: KKcorps/zamboni
def reviewers_score_bar(context, types=None, addon_type=None):
    user = context.get("amo_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)
        )
    )
예제 #10
0
파일: helpers.py 프로젝트: Nolski/olympia
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))
예제 #11
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))
예제 #12
0
def hub_addon_listing_items(context, addons, src=None, notes=None):
    return new_context(**locals())
예제 #13
0
def add_file_modal(context, title, action, upload_url, action_label):
    return new_context(modal_type='file', context=context, title=title,
                       action=action, upload_url=upload_url,
                       action_label=action_label)
예제 #14
0
def mobile_version_detail(context, addon, version, src):
    return new_context(**locals())
예제 #15
0
파일: helpers.py 프로젝트: 21echoes/zamboni
def mobile_version_detail(context, addon, version, src):
    return new_context(**locals())
예제 #16
0
파일: helpers.py 프로젝트: 21echoes/zamboni
def version_detail(context, addon, version, src, impala=False,
                   show_versions_link=True, itemclass='article'):
    return new_context(**locals())
예제 #17
0
파일: helpers.py 프로젝트: 21echoes/zamboni
def collection_grid(context, collections, src=None, pagesize=4, cols=2):
    pages = chunked(collections, pagesize)
    columns = 'cols-%d' % cols
    return new_context(**locals())
예제 #18
0
def version_detail(context, addon, version, src, impala=False,
                   itemclass='item'):
    return new_context(**locals())
예제 #19
0
def hub_addon_listing_items(context, addons, src=None, notes=None):
    return new_context(**locals())
예제 #20
0
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)
예제 #21
0
def collection_grid(context, collections, src=None, pagesize=4, cols=2):
    pages = chunked(collections, pagesize)
    columns = 'cols-%d' % cols
    return new_context(**locals())
예제 #22
0
def collection_grid(context, collections, src=None, pagesize=4, cols=2):
    pages = chunked(collections, pagesize)
    columns = '' if cols != 3 else 'three-col'
    return new_context(**locals())