def collection_view(request, collection_slug):
    collection = get_object_or_404(Collection,
        slug=collection_slug, visibility=Collection.PUBLIC)

    data = Resource.objects.filter(collectionresource__collection=collection,
                                   status=Resource.APPROVED).order_by('collectionresource__order_by')

    paginator = Paginator(data, settings.ORB_PAGINATOR_DEFAULT)

    try:
        page = int(request.GET.get('page', '1'))
    except ValueError:
        page = 1

    try:
        resources = paginator.page(page)
    except (EmptyPage, InvalidPage):
        resources = paginator.page(paginator.num_pages)

    return render(request, 'orb/collection/view.html', {
        'collection': collection,
        'page': resources,
        'total_results': paginator.count,
    })