示例#1
0
文件: views.py 项目: Bartelo/openjumo
def signed_out_home(request):
    lists = Section.get_lists(Sections.HOME)
    list_ids = [l.id for l in lists]
    top_lists = TopList.get_entities_for_lists(list_ids)

    top_categories, sub_category_groups, discovery_item_groups = DiscoveryMap.get_lists()

    return render(request, 'etc/home.html', {
            'title' : None,
            'login_form':LoginForm(),
            'top_categories': top_categories,
            'sub_category_groups': sub_category_groups,
            'discovery_item_groups': discovery_item_groups,
            'top_lists': top_lists
        })
示例#2
0
def signed_out_home(request):
    lists = Section.get_lists(Sections.HOME)
    list_ids = [l.id for l in lists]
    top_lists = TopList.get_entities_for_lists(list_ids)

    top_categories, sub_category_groups, discovery_item_groups = DiscoveryMap.get_lists(
    )

    return render(
        request, 'etc/home.html', {
            'title': None,
            'login_form': LoginForm(),
            'top_categories': top_categories,
            'sub_category_groups': sub_category_groups,
            'discovery_item_groups': discovery_item_groups,
            'top_lists': top_lists
        })
示例#3
0
文件: views.py 项目: Bartelo/openjumo
def home(request):
    top_categories, sub_category_groups, discovery_item_groups = DiscoveryMap.get_lists()
    list_ids = [l.id for l in Section.get_lists(Sections.SIGNED_IN_HOME)]
    lists = TopList.get_entities_for_lists(list_ids)
    if len(lists) > 0:
        recommended_orgs = lists.items()[0][1]
    else:
        recommended_orgs = []


    form = PhotoUploadForm(instance=request.user)

    return render(request, 'user/home.html', {
            'user_photo_upload_form': form,
            'title' : 'Home',
            'entity' : None,
            'top_categories': top_categories,
            'sub_category_groups': sub_category_groups,
            'discovery_item_groups': discovery_item_groups,
            'recommended_orgs': recommended_orgs
    })
示例#4
0
def home(request):
    top_categories, sub_category_groups, discovery_item_groups = DiscoveryMap.get_lists(
    )
    list_ids = [l.id for l in Section.get_lists(Sections.SIGNED_IN_HOME)]
    lists = TopList.get_entities_for_lists(list_ids)
    if len(lists) > 0:
        recommended_orgs = lists.items()[0][1]
    else:
        recommended_orgs = []

    form = PhotoUploadForm(instance=request.user)

    return render(
        request, 'user/home.html', {
            'user_photo_upload_form': form,
            'title': 'Home',
            'entity': None,
            'top_categories': top_categories,
            'sub_category_groups': sub_category_groups,
            'discovery_item_groups': discovery_item_groups,
            'recommended_orgs': recommended_orgs
        })