def news_category_list(request, portal): page = get_page_obj(request, portal.news_set.all().filter(deleted=False).filter(hidden=False).filter(sticky=False).order_by('-created_at')) categories = get_page_obj(request, portal.newscategory_set.all().filter(deleted=False).order_by('title')) return render_to_response('f/news_category_list.html', { 'page': page, 'total': page.paginator.count, 'categories': categories, }, portal_request_context(request, portal))
def event_category_list(request, portal): page = get_page_obj(request, portal.event_set.filter(deleted=False).filter(hidden=False).filter(sticky=False).order_by('-begin')) categories = get_page_obj(request, portal.eventcategory_set.all().filter(deleted=False).order_by('title')) return render_to_response('f/event_category_list.html', { 'page': page, 'total': page.paginator.count, 'categories': categories, 'sticky_event_list': portal.event_set.filter(deleted=False).filter(hidden=False).filter(sticky=True).order_by('-begin'), }, portal_request_context(request, portal))
def page_keyword(request, portal, k): page = get_page_obj(request, k.page_set.all().filter(deleted=False).filter(hidden=False).order_by('-modified_at')) return render_to_response('f/page_list.html', { 'title': '%s: %s' % (__('Keyword'), k.title), 'page': page, 'total': page.paginator.count, }, portal_request_context(request, portal))
def news_list_by_category(request, portal, s): try: category = portal.newscategory_set.get(slug__exact=s) except ObjectDoesNotExist: return redirect(reverse('portals.frontend.views.news_category_list', args=[portal.address])) page = get_page_obj(request, portal.news_set.all().filter(deleted=False).filter(hidden=False).filter(sticky=False).filter(category=category).order_by('-created_at')) return render_to_response('f/news_list.html', { 'title': '%s: %s' % (__('Category'), category.title), 'page': page, 'total': page.paginator.count, }, portal_request_context(request, portal))
def system_portal_list(request, portal): page = get_page_obj(request, Portal.objects.filter(deleted=False).filter(suspended=False).order_by('-created_at')) return render_to_response('f/system_portal_list.html', { 'page': page, 'total': page.paginator.count, }, portal_request_context(request, portal))