コード例 #1
0
ファイル: forms.py プロジェクト: landas/zamboni
def get_search_groups(app):
    sub = []
    for type_ in (amo.ADDON_DICT, amo.ADDON_SEARCH, amo.ADDON_THEME):
        sub.append(_Cat(0, amo.ADDON_TYPES[type_], 0, type_))
    sub.extend(helpers.sidebar(app)[0])
    sub = [('%s,%s' % (a.type_id, a.id), a.name) for a in
           sorted(sub, key=lambda x: (x.weight, x.name))]
    top_level = [('all', _('all add-ons')),
                 ('collections', _('all collections')),
                 ('personas', _('all personas'))]
    return top_level[:1] + sub + top_level[1:], top_level
コード例 #2
0
def get_search_groups(app):
    sub = []

    types_ = [t for t in (amo.ADDON_DICT, amo.ADDON_SEARCH, amo.ADDON_THEME)
                if t in app.types]

    for type_ in types_:
        sub.append(_Cat(0, amo.ADDON_TYPES[type_], 0, type_))
    sub.extend(helpers.sidebar(app)[0])
    sub = [('%s,%s' % (a.type, a.id), a.name) for a in
           sorted(sub, key=lambda x: (x.weight, x.name))]
    top_level = [('all', _('all add-ons')),
                 ('collections', _('all collections')), ]

    if amo.ADDON_PERSONA in app.types:
        top_level += (('personas', _('all personas')),)

    return top_level[:1] + sub + top_level[1:], top_level
コード例 #3
0
ファイル: forms.py プロジェクト: atsay/zamboni
def get_search_groups(app):
    sub = []

    types_ = [t for t in (amo.ADDON_DICT, amo.ADDON_SEARCH, amo.ADDON_THEME)
                if t in app.types]

    for type_ in types_:
        sub.append(_Cat(0, amo.ADDON_TYPES[type_], 0, type_))
    sub.extend(helpers.sidebar(app)[0])
    sub = [('%s,%s' % (a.type, a.id), a.name) for a in
           sorted(sub, key=lambda x: (x.weight, x.name))]
    top_level = [('all', _('all add-ons')),
                 ('collections', _('all collections')), ]

    if amo.ADDON_PERSONA in app.types:
        top_level += (('themes', _('all themes')),)

    return top_level[:1] + sub + top_level[1:], top_level